Skip to content

Commit

Permalink
Add package level lint:fix back (#3799)
Browse files Browse the repository at this point in the history
* bring back package specific tsconfig.lint

* Revert "make eslint happy"

This reverts commit 3f3ef49.

* Bring back lint:fix

* Add parser options

* more devp2p specific stuff

* Bring back lint script because why not

* lint
  • Loading branch information
acolytec3 authored Nov 17, 2024
1 parent 65ab90c commit e86eace
Show file tree
Hide file tree
Showing 50 changed files with 348 additions and 10 deletions.
14 changes: 11 additions & 3 deletions config/eslint.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ module.exports = {
'no-dupe-class-members': 'off',
'no-extra-semi': 'off',
'no-redeclare': 'off',
'no-undef': 'off',
'no-unused-vars': 'off',
'no-var': 'error',
'object-shorthand': 'error',
Expand All @@ -130,11 +129,10 @@ module.exports = {
'implicit-dependencies/no-implicit': 'off',
'import/no-extraneous-dependencies': 'off',
'no-console': 'off',
'@typescript-eslint/no-floating-promises': 'warn',
},
},
{
files: ['**/examples/**/*', '**/benchmarks/*.ts', ],
files: ['**/examples/**/*.ts', '**/benchmarks/*.ts', ],
rules: {
'implicit-dependencies/no-implicit': 'off',
'import/no-extraneous-dependencies': 'off',
Expand All @@ -150,6 +148,16 @@ module.exports = {
'no-restricted-syntax': 'off',
},
},
{
files: ['packages/devp2p/**'],
rules: {
'@typescript-eslint/no-floating-promises': 'off',
'no-redeclare': 'off',
'no-undef': 'off', // temporary until fixed: 'NodeJS' is not defined
'no-console': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},
{
files: ['packages/wallet/**'],
rules: {
Expand Down
15 changes: 15 additions & 0 deletions packages/block/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
extends: '../../config/eslint.cjs',
parserOptions: {
project: ['./tsconfig.lint.json'],
},
overrides: [
{
files: ['examples/**/*'],
rules: {
'no-console': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},
],
}
2 changes: 2 additions & 0 deletions packages/block/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
"docs:build": "typedoc --options typedoc.cjs",
"examples": "tsx ../../scripts/examples-runner.ts -- block",
"examples:build": "npx embedme README.md",
"lint": "eslint --config .eslintrc.cjs . --ext .js,.ts",
"lint:fix": "eslint --fix --config .eslintrc.cjs . --ext .js,.ts",
"prepublishOnly": "../../config/cli/prepublish.sh",
"test": "npm run test:node && npm run test:browser",
"test:browser": "npx vitest run --config=../../config/vitest.config.browser.mts",
Expand Down
3 changes: 3 additions & 0 deletions packages/block/tsconfig.lint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../config/tsconfig.lint.json"
}
15 changes: 15 additions & 0 deletions packages/blockchain/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
extends: '../../config/eslint.cjs',
parserOptions: {
project: ['./tsconfig.lint.json'],
},
overrides: [
{
files: ['examples/**/*'],
rules: {
'no-console': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},
],
}
2 changes: 2 additions & 0 deletions packages/blockchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
"docs:build": "typedoc --options typedoc.cjs",
"examples": "tsx ../../scripts/examples-runner.ts -- blockchain",
"examples:build": "npx embedme README.md",
"lint": "eslint --config .eslintrc.cjs . --ext .js,.ts",
"lint:fix": "eslint --fix --config .eslintrc.cjs . --ext .js,.ts",
"prepublishOnly": "../../config/cli/prepublish.sh",
"test": "npm run test:node && npm run test:browser",
"test:browser": "npx vitest run --config=./vitest.config.browser.mts",
Expand Down
3 changes: 3 additions & 0 deletions packages/blockchain/tsconfig.lint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../config/tsconfig.lint.json"
}
2 changes: 2 additions & 0 deletions packages/client/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
devnets/**/*.ts
archive/**/*.ts
14 changes: 14 additions & 0 deletions packages/client/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
extends: '../../config/eslint.cjs',
parserOptions: {
project: ['./tsconfig.lint.json'],
},
overrides: [
{
files: ['bin/**.ts', 'test/sim/**.ts', 'examples/**/*.ts'],
rules: {
'no-console': 'off',
},
},
],
}
2 changes: 2 additions & 0 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
"coverage": "npx vitest --coverage --coverage.include=src --coverage.reporter=lcov run test/* -c=./vitest.config.unit.ts",
"docs:build": "typedoc --options typedoc.cjs --tsconfig tsconfig.prod.cjs.json",
"examples": "tsx ../../scripts/examples-runner.ts -- client",
"lint": "eslint --config .eslintrc.cjs . --ext .js,.ts",
"lint:fix": "eslint --fix --config .eslintrc.cjs . --ext .js,.ts",
"preinstall": "npm run binWorkaround",
"prepublishOnly": "../../config/cli/prepublish.sh",
"test": "npm run test:unit && npm run test:integration",
Expand Down
3 changes: 3 additions & 0 deletions packages/client/tsconfig.lint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../config/tsconfig.lint.json"
}
15 changes: 15 additions & 0 deletions packages/common/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
extends: '../../config/eslint.cjs',
parserOptions: {
project: ['./tsconfig.lint.json'],
},
overrides: [
{
files: ['examples/**/*'],
rules: {
'no-console': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},
],
}
2 changes: 2 additions & 0 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
"docs:build": "typedoc --options typedoc.cjs",
"examples": "tsx ../../scripts/examples-runner.ts -- common",
"examples:build": "npx embedme README.md",
"lint": "eslint --config .eslintrc.cjs . --ext .js,.ts",
"lint:fix": "eslint --fix --config .eslintrc.cjs . --ext .js,.ts",
"prepublishOnly": "../../config/cli/prepublish.sh",
"test": "npm run test:node && npm run test:browser",
"test:browser": "npx vitest run --config=../../config/vitest.config.browser.mts",
Expand Down
3 changes: 3 additions & 0 deletions packages/common/tsconfig.lint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../config/tsconfig.lint.json"
}
20 changes: 20 additions & 0 deletions packages/devp2p/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
extends: '../../config/eslint.cjs',
parserOptions: {
project: ['./tsconfig.lint.json'],
},
rules: {
'@typescript-eslint/no-floating-promises': 'off',
'no-redeclare': 'off',
'no-undef': 'off', // temporary until fixed: 'NodeJS' is not defined
},
overrides: [
{
files: ['examples/**/*'],
rules: {
'no-console': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},
],
}
2 changes: 2 additions & 0 deletions packages/devp2p/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
"docs:build": "typedoc --options typedoc.cjs",
"examples": "tsx ../../scripts/examples-runner.ts -- devp2p",
"examples:build": "npx embedme README.md",
"lint": "eslint --config .eslintrc.cjs . --ext .js,.ts",
"lint:fix": "eslint --fix --config .eslintrc.cjs . --ext .js,.ts",
"prepublishOnly": "../../config/cli/prepublish.sh",
"test": "vitest run",
"test:node": "npm run test",
Expand Down
3 changes: 3 additions & 0 deletions packages/devp2p/tsconfig.lint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../config/tsconfig.lint.json"
}
15 changes: 15 additions & 0 deletions packages/ethash/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
extends: '../../config/eslint.cjs',
parserOptions: {
project: ['./tsconfig.lint.json'],
},
overrides: [
{
files: ['examples/**/*'],
rules: {
'no-console': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},
],
}
2 changes: 2 additions & 0 deletions packages/ethash/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
"docs:build": "typedoc --options typedoc.cjs",
"examples": "tsx ../../scripts/examples-runner.ts -- ethash",
"examples:build": "npx embedme README.md",
"lint": "eslint --config .eslintrc.cjs . --ext .js,.ts",
"lint:fix": "eslint --fix --config .eslintrc.cjs . --ext .js,.ts",
"prepublishOnly": "../../config/cli/prepublish.sh",
"test": "npx vitest run",
"tsc": "../../config/cli/ts-compile.sh"
Expand Down
20 changes: 20 additions & 0 deletions packages/evm/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
extends: '../../config/eslint.cjs',
parserOptions: {
project: ['./tsconfig.lint.json'],
},
rules: {
'@typescript-eslint/no-use-before-define': 'off',
'no-invalid-this': 'off',
'no-restricted-syntax': 'off',
},
overrides: [
{
files: ['test/util.ts', 'test/tester/**/*.ts', 'examples/**/*.ts'],
rules: {
'no-console': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},
],
}
2 changes: 2 additions & 0 deletions packages/evm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
"examples": "tsx ../../scripts/examples-runner.ts -- evm",
"examples:build": "npx embedme README.md",
"formatTest": "node ./scripts/formatTest",
"lint": "eslint --config .eslintrc.cjs . --ext .js,.ts",
"lint:fix": "eslint --fix --config .eslintrc.cjs . --ext .js,.ts",
"prepublishOnly": "../../config/cli/prepublish.sh",
"profiling": "0x ./benchmarks/run.js profiling",
"test": "npm run test:node && npm run test:browser",
Expand Down
3 changes: 3 additions & 0 deletions packages/evm/tsconfig.lint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../config/tsconfig.lint.json"
}
15 changes: 15 additions & 0 deletions packages/genesis/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
extends: '../../config/eslint.cjs',
parserOptions: {
project: ['./tsconfig.lint.json'],
},
overrides: [
{
files: ['examples/**/*'],
rules: {
'no-console': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},
],
}
2 changes: 2 additions & 0 deletions packages/genesis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
"examples": "tsx ../../scripts/examples-runner.ts -- genesis",
"examples:build": "npx embedme README.md",
"docs:build": "typedoc --options typedoc.cjs",
"lint": "eslint --config .eslintrc.cjs . --ext .js,.ts",
"lint:fix": "eslint --fix --config .eslintrc.cjs . --ext .js,.ts",
"prepublishOnly": "../../config/cli/prepublish.sh",
"test": "npm run test:node",
"test:browser": "npx vitest run --config=../../config/vitest.config.browser.mts",
Expand Down
3 changes: 3 additions & 0 deletions packages/genesis/tsconfig.lint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../config/tsconfig.lint.json"
}
14 changes: 14 additions & 0 deletions packages/mpt/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
extends: '../../config/eslint.cjs',
parserOptions: {
project: ['./tsconfig.lint.json'],
},
overrides: [
{
files: ['benchmarks/*.ts', 'examples/**/*'],
rules: {
'no-console': 'off',
},
},
],
}
2 changes: 2 additions & 0 deletions packages/mpt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
"docs:build": "typedoc --options typedoc.cjs",
"examples": "tsx ../../scripts/examples-runner.ts -- mpt",
"examples:build": "npx embedme README.md",
"lint": "eslint --config .eslintrc.cjs . --ext .js,.ts",
"lint:fix": "eslint --fix --config .eslintrc.cjs . --ext .js,.ts",
"prepublishOnly": "../../config/cli/prepublish.sh",
"profiling": "tsc --target ES5 benchmarks/random.ts && 0x benchmarks/random.js",
"test": "npm run test:node && npm run test:browser",
Expand Down
3 changes: 3 additions & 0 deletions packages/mpt/tsconfig.lint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../config/tsconfig.lint.json"
}
15 changes: 15 additions & 0 deletions packages/rlp/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
extends: '../../config/eslint.cjs',
rules: {
'@typescript-eslint/no-use-before-define': 'off',
},
overrides: [
{
files: ['examples/**/*'],
rules: {
'no-console': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},
],
}
2 changes: 2 additions & 0 deletions packages/rlp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
"coverage": "npx vitest --coverage --coverage.include=src run",
"examples": "tsx ../../scripts/examples-runner.ts -- rlp",
"examples:build": "npx embedme README.md",
"lint": "eslint --config .eslintrc.cjs . --ext .js,.ts",
"lint:fix": "eslint --fix --config .eslintrc.cjs . --ext .js,.ts",
"prepublishOnly": "../../config/cli/prepublish.sh",
"test": "npm run test:node && npm run test:browser",
"test:browser": "npx vitest run --config=./vitest.config.browser.mts",
Expand Down
3 changes: 3 additions & 0 deletions packages/rlp/tsconfig.lint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../config/tsconfig.lint.json"
}
20 changes: 20 additions & 0 deletions packages/statemanager/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
extends: '../../config/eslint.cjs',
parserOptions: {
project: ['./tsconfig.lint.json'],
},
rules: {
'@typescript-eslint/no-use-before-define': 'off',
'no-invalid-this': 'off',
'no-restricted-syntax': 'off',
},
overrides: [
{
files: ['examples/**/*'],
rules: {
'no-console': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},
],
}
2 changes: 2 additions & 0 deletions packages/statemanager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
"docs:build": "typedoc --options typedoc.cjs",
"examples": "tsx ../../scripts/examples-runner.ts -- statemanager",
"examples:build": "npx embedme README.md",
"lint": "eslint --config .eslintrc.cjs . --ext .js,.ts",
"lint:fix": "eslint --fix --config .eslintrc.cjs . --ext .js,.ts",
"prepublishOnly": "../../config/cli/prepublish.sh && npm run test:node",
"test": "npm run test:node && npm run test:browser",
"test:browser": "npx vitest run --config=./vitest.config.browser.mts",
Expand Down
3 changes: 3 additions & 0 deletions packages/statemanager/tsconfig.lint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../config/tsconfig.lint.json"
}
15 changes: 15 additions & 0 deletions packages/tx/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
extends: '../../config/eslint.cjs',
parserOptions: {
project: ['./tsconfig.lint.json'],
},
overrides: [
{
files: ['examples/**/*'],
rules: {
'no-console': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},
],
}
2 changes: 2 additions & 0 deletions packages/tx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
"docs:build": "typedoc --options typedoc.cjs",
"examples": "tsx ../../scripts/examples-runner.ts -- tx",
"examples:build": "npx embedme README.md",
"lint": "eslint --config .eslintrc.cjs . --ext .js,.ts",
"lint:fix": "eslint --fix --config .eslintrc.cjs . --ext .js,.ts",
"prepublishOnly": "../../config/cli/prepublish.sh",
"test": "npm run test:node && npm run test:browser",
"test:browser": "npx vitest run --config=./vitest.config.browser.mts",
Expand Down
3 changes: 3 additions & 0 deletions packages/tx/tsconfig.lint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../config/tsconfig.lint.json"
}
Loading

0 comments on commit e86eace

Please sign in to comment.