From e86eace8c6bc4a848c260e6b652fc56e73ac16de Mon Sep 17 00:00:00 2001 From: acolytec3 <17355484+acolytec3@users.noreply.github.com> Date: Sun, 17 Nov 2024 04:50:09 -0500 Subject: [PATCH] Add package level `lint:fix` back (#3799) * bring back package specific tsconfig.lint * Revert "make eslint happy" This reverts commit 3f3ef49a832657f9dae0272f94a4cc65e079a1e1. * Bring back lint:fix * Add parser options * more devp2p specific stuff * Bring back lint script because why not * lint --- config/eslint.cjs | 14 +++++++++++--- packages/block/.eslintrc.cjs | 15 +++++++++++++++ packages/block/package.json | 2 ++ packages/block/tsconfig.lint.json | 3 +++ packages/blockchain/.eslintrc.cjs | 15 +++++++++++++++ packages/blockchain/package.json | 2 ++ packages/blockchain/tsconfig.lint.json | 3 +++ packages/client/.eslintignore | 2 ++ packages/client/.eslintrc.cjs | 14 ++++++++++++++ packages/client/package.json | 2 ++ packages/client/tsconfig.lint.json | 3 +++ packages/common/.eslintrc.cjs | 15 +++++++++++++++ packages/common/package.json | 2 ++ packages/common/tsconfig.lint.json | 3 +++ packages/devp2p/.eslintrc.cjs | 20 ++++++++++++++++++++ packages/devp2p/package.json | 2 ++ packages/devp2p/tsconfig.lint.json | 3 +++ packages/ethash/.eslintrc.cjs | 15 +++++++++++++++ packages/ethash/package.json | 2 ++ packages/evm/.eslintrc.cjs | 20 ++++++++++++++++++++ packages/evm/package.json | 2 ++ packages/evm/tsconfig.lint.json | 3 +++ packages/genesis/.eslintrc.cjs | 15 +++++++++++++++ packages/genesis/package.json | 2 ++ packages/genesis/tsconfig.lint.json | 3 +++ packages/mpt/.eslintrc.cjs | 14 ++++++++++++++ packages/mpt/package.json | 2 ++ packages/mpt/tsconfig.lint.json | 3 +++ packages/rlp/.eslintrc.cjs | 15 +++++++++++++++ packages/rlp/package.json | 2 ++ packages/rlp/tsconfig.lint.json | 3 +++ packages/statemanager/.eslintrc.cjs | 20 ++++++++++++++++++++ packages/statemanager/package.json | 2 ++ packages/statemanager/tsconfig.lint.json | 3 +++ packages/tx/.eslintrc.cjs | 15 +++++++++++++++ packages/tx/package.json | 2 ++ packages/tx/tsconfig.lint.json | 3 +++ packages/util/.eslintrc.cjs | 15 +++++++++++++++ packages/util/package.json | 2 ++ packages/util/tsconfig.lint.json | 3 +++ packages/verkle/.eslintrc.cjs | 15 +++++++++++++++ packages/verkle/package.json | 2 ++ packages/verkle/tsconfig.lint.json | 3 +++ packages/vm/.eslintrc.cjs | 19 +++++++++++++++++++ packages/vm/package.json | 2 ++ packages/vm/tsconfig.lint.json | 3 +++ packages/wallet/.eslintrc.cjs | 16 ++++++++++++++++ packages/wallet/.prettierignore | 7 ------- packages/wallet/package.json | 2 ++ packages/wallet/tsconfig.lint.json | 3 +++ 50 files changed, 348 insertions(+), 10 deletions(-) create mode 100644 packages/block/.eslintrc.cjs create mode 100644 packages/block/tsconfig.lint.json create mode 100644 packages/blockchain/.eslintrc.cjs create mode 100644 packages/blockchain/tsconfig.lint.json create mode 100644 packages/client/.eslintignore create mode 100644 packages/client/.eslintrc.cjs create mode 100644 packages/client/tsconfig.lint.json create mode 100644 packages/common/.eslintrc.cjs create mode 100644 packages/common/tsconfig.lint.json create mode 100644 packages/devp2p/.eslintrc.cjs create mode 100644 packages/devp2p/tsconfig.lint.json create mode 100644 packages/ethash/.eslintrc.cjs create mode 100644 packages/evm/.eslintrc.cjs create mode 100644 packages/evm/tsconfig.lint.json create mode 100644 packages/genesis/.eslintrc.cjs create mode 100644 packages/genesis/tsconfig.lint.json create mode 100644 packages/mpt/.eslintrc.cjs create mode 100644 packages/mpt/tsconfig.lint.json create mode 100644 packages/rlp/.eslintrc.cjs create mode 100644 packages/rlp/tsconfig.lint.json create mode 100644 packages/statemanager/.eslintrc.cjs create mode 100644 packages/statemanager/tsconfig.lint.json create mode 100644 packages/tx/.eslintrc.cjs create mode 100644 packages/tx/tsconfig.lint.json create mode 100644 packages/util/.eslintrc.cjs create mode 100644 packages/util/tsconfig.lint.json create mode 100644 packages/verkle/.eslintrc.cjs create mode 100644 packages/verkle/tsconfig.lint.json create mode 100644 packages/vm/.eslintrc.cjs create mode 100644 packages/vm/tsconfig.lint.json create mode 100644 packages/wallet/.eslintrc.cjs delete mode 100644 packages/wallet/.prettierignore create mode 100644 packages/wallet/tsconfig.lint.json diff --git a/config/eslint.cjs b/config/eslint.cjs index ecb3213baf..1b5f05b615 100644 --- a/config/eslint.cjs +++ b/config/eslint.cjs @@ -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', @@ -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', @@ -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: { diff --git a/packages/block/.eslintrc.cjs b/packages/block/.eslintrc.cjs new file mode 100644 index 0000000000..19094c2277 --- /dev/null +++ b/packages/block/.eslintrc.cjs @@ -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', + }, + }, + ], +} diff --git a/packages/block/package.json b/packages/block/package.json index 828c284527..fa33741fbe 100644 --- a/packages/block/package.json +++ b/packages/block/package.json @@ -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", diff --git a/packages/block/tsconfig.lint.json b/packages/block/tsconfig.lint.json new file mode 100644 index 0000000000..3698f4f0be --- /dev/null +++ b/packages/block/tsconfig.lint.json @@ -0,0 +1,3 @@ +{ + "extends": "../../config/tsconfig.lint.json" +} diff --git a/packages/blockchain/.eslintrc.cjs b/packages/blockchain/.eslintrc.cjs new file mode 100644 index 0000000000..19094c2277 --- /dev/null +++ b/packages/blockchain/.eslintrc.cjs @@ -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', + }, + }, + ], +} diff --git a/packages/blockchain/package.json b/packages/blockchain/package.json index 013b27c979..98b9a1b691 100644 --- a/packages/blockchain/package.json +++ b/packages/blockchain/package.json @@ -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", diff --git a/packages/blockchain/tsconfig.lint.json b/packages/blockchain/tsconfig.lint.json new file mode 100644 index 0000000000..3698f4f0be --- /dev/null +++ b/packages/blockchain/tsconfig.lint.json @@ -0,0 +1,3 @@ +{ + "extends": "../../config/tsconfig.lint.json" +} diff --git a/packages/client/.eslintignore b/packages/client/.eslintignore new file mode 100644 index 0000000000..3fa47340d9 --- /dev/null +++ b/packages/client/.eslintignore @@ -0,0 +1,2 @@ +devnets/**/*.ts +archive/**/*.ts \ No newline at end of file diff --git a/packages/client/.eslintrc.cjs b/packages/client/.eslintrc.cjs new file mode 100644 index 0000000000..43d2c22619 --- /dev/null +++ b/packages/client/.eslintrc.cjs @@ -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', + }, + }, + ], +} diff --git a/packages/client/package.json b/packages/client/package.json index 29766b2aab..ad36800c79 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -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", diff --git a/packages/client/tsconfig.lint.json b/packages/client/tsconfig.lint.json new file mode 100644 index 0000000000..3698f4f0be --- /dev/null +++ b/packages/client/tsconfig.lint.json @@ -0,0 +1,3 @@ +{ + "extends": "../../config/tsconfig.lint.json" +} diff --git a/packages/common/.eslintrc.cjs b/packages/common/.eslintrc.cjs new file mode 100644 index 0000000000..19094c2277 --- /dev/null +++ b/packages/common/.eslintrc.cjs @@ -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', + }, + }, + ], +} diff --git a/packages/common/package.json b/packages/common/package.json index 26ce40d7be..768e0a878e 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -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", diff --git a/packages/common/tsconfig.lint.json b/packages/common/tsconfig.lint.json new file mode 100644 index 0000000000..3698f4f0be --- /dev/null +++ b/packages/common/tsconfig.lint.json @@ -0,0 +1,3 @@ +{ + "extends": "../../config/tsconfig.lint.json" +} diff --git a/packages/devp2p/.eslintrc.cjs b/packages/devp2p/.eslintrc.cjs new file mode 100644 index 0000000000..53eda3c9a0 --- /dev/null +++ b/packages/devp2p/.eslintrc.cjs @@ -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', + }, + }, + ], +} diff --git a/packages/devp2p/package.json b/packages/devp2p/package.json index 2e742d927f..a27c425963 100644 --- a/packages/devp2p/package.json +++ b/packages/devp2p/package.json @@ -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", diff --git a/packages/devp2p/tsconfig.lint.json b/packages/devp2p/tsconfig.lint.json new file mode 100644 index 0000000000..3698f4f0be --- /dev/null +++ b/packages/devp2p/tsconfig.lint.json @@ -0,0 +1,3 @@ +{ + "extends": "../../config/tsconfig.lint.json" +} diff --git a/packages/ethash/.eslintrc.cjs b/packages/ethash/.eslintrc.cjs new file mode 100644 index 0000000000..19094c2277 --- /dev/null +++ b/packages/ethash/.eslintrc.cjs @@ -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', + }, + }, + ], +} diff --git a/packages/ethash/package.json b/packages/ethash/package.json index dd36d077a2..61d8ae36c8 100644 --- a/packages/ethash/package.json +++ b/packages/ethash/package.json @@ -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" diff --git a/packages/evm/.eslintrc.cjs b/packages/evm/.eslintrc.cjs new file mode 100644 index 0000000000..a248f24202 --- /dev/null +++ b/packages/evm/.eslintrc.cjs @@ -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', + }, + }, + ], +} diff --git a/packages/evm/package.json b/packages/evm/package.json index c32967b49f..e4ee11dbae 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -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", diff --git a/packages/evm/tsconfig.lint.json b/packages/evm/tsconfig.lint.json new file mode 100644 index 0000000000..3698f4f0be --- /dev/null +++ b/packages/evm/tsconfig.lint.json @@ -0,0 +1,3 @@ +{ + "extends": "../../config/tsconfig.lint.json" +} diff --git a/packages/genesis/.eslintrc.cjs b/packages/genesis/.eslintrc.cjs new file mode 100644 index 0000000000..19094c2277 --- /dev/null +++ b/packages/genesis/.eslintrc.cjs @@ -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', + }, + }, + ], +} diff --git a/packages/genesis/package.json b/packages/genesis/package.json index 65d7b99f09..1709cfbeeb 100644 --- a/packages/genesis/package.json +++ b/packages/genesis/package.json @@ -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", diff --git a/packages/genesis/tsconfig.lint.json b/packages/genesis/tsconfig.lint.json new file mode 100644 index 0000000000..3698f4f0be --- /dev/null +++ b/packages/genesis/tsconfig.lint.json @@ -0,0 +1,3 @@ +{ + "extends": "../../config/tsconfig.lint.json" +} diff --git a/packages/mpt/.eslintrc.cjs b/packages/mpt/.eslintrc.cjs new file mode 100644 index 0000000000..4a13163a7d --- /dev/null +++ b/packages/mpt/.eslintrc.cjs @@ -0,0 +1,14 @@ +module.exports = { + extends: '../../config/eslint.cjs', + parserOptions: { + project: ['./tsconfig.lint.json'], + }, + overrides: [ + { + files: ['benchmarks/*.ts', 'examples/**/*'], + rules: { + 'no-console': 'off', + }, + }, + ], +} diff --git a/packages/mpt/package.json b/packages/mpt/package.json index 6b527167da..100451015e 100644 --- a/packages/mpt/package.json +++ b/packages/mpt/package.json @@ -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", diff --git a/packages/mpt/tsconfig.lint.json b/packages/mpt/tsconfig.lint.json new file mode 100644 index 0000000000..3698f4f0be --- /dev/null +++ b/packages/mpt/tsconfig.lint.json @@ -0,0 +1,3 @@ +{ + "extends": "../../config/tsconfig.lint.json" +} diff --git a/packages/rlp/.eslintrc.cjs b/packages/rlp/.eslintrc.cjs new file mode 100644 index 0000000000..092291ee94 --- /dev/null +++ b/packages/rlp/.eslintrc.cjs @@ -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', + }, + }, + ], +} diff --git a/packages/rlp/package.json b/packages/rlp/package.json index 90918755de..568effc690 100644 --- a/packages/rlp/package.json +++ b/packages/rlp/package.json @@ -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", diff --git a/packages/rlp/tsconfig.lint.json b/packages/rlp/tsconfig.lint.json new file mode 100644 index 0000000000..3698f4f0be --- /dev/null +++ b/packages/rlp/tsconfig.lint.json @@ -0,0 +1,3 @@ +{ + "extends": "../../config/tsconfig.lint.json" +} diff --git a/packages/statemanager/.eslintrc.cjs b/packages/statemanager/.eslintrc.cjs new file mode 100644 index 0000000000..714a1b8955 --- /dev/null +++ b/packages/statemanager/.eslintrc.cjs @@ -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', + }, + }, + ], +} diff --git a/packages/statemanager/package.json b/packages/statemanager/package.json index 44c77506e8..6e830b2b97 100644 --- a/packages/statemanager/package.json +++ b/packages/statemanager/package.json @@ -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", diff --git a/packages/statemanager/tsconfig.lint.json b/packages/statemanager/tsconfig.lint.json new file mode 100644 index 0000000000..3698f4f0be --- /dev/null +++ b/packages/statemanager/tsconfig.lint.json @@ -0,0 +1,3 @@ +{ + "extends": "../../config/tsconfig.lint.json" +} diff --git a/packages/tx/.eslintrc.cjs b/packages/tx/.eslintrc.cjs new file mode 100644 index 0000000000..19094c2277 --- /dev/null +++ b/packages/tx/.eslintrc.cjs @@ -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', + }, + }, + ], +} diff --git a/packages/tx/package.json b/packages/tx/package.json index 6b8aeac09d..37f2dc89f6 100644 --- a/packages/tx/package.json +++ b/packages/tx/package.json @@ -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", diff --git a/packages/tx/tsconfig.lint.json b/packages/tx/tsconfig.lint.json new file mode 100644 index 0000000000..3698f4f0be --- /dev/null +++ b/packages/tx/tsconfig.lint.json @@ -0,0 +1,3 @@ +{ + "extends": "../../config/tsconfig.lint.json" +} diff --git a/packages/util/.eslintrc.cjs b/packages/util/.eslintrc.cjs new file mode 100644 index 0000000000..19094c2277 --- /dev/null +++ b/packages/util/.eslintrc.cjs @@ -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', + }, + }, + ], +} diff --git a/packages/util/package.json b/packages/util/package.json index 8f02935a23..83a3099d39 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -75,6 +75,8 @@ "docs:build": "npx typedoc --options typedoc.cjs", "examples": "tsx ../../scripts/examples-runner.ts -- util", "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", diff --git a/packages/util/tsconfig.lint.json b/packages/util/tsconfig.lint.json new file mode 100644 index 0000000000..3698f4f0be --- /dev/null +++ b/packages/util/tsconfig.lint.json @@ -0,0 +1,3 @@ +{ + "extends": "../../config/tsconfig.lint.json" +} diff --git a/packages/verkle/.eslintrc.cjs b/packages/verkle/.eslintrc.cjs new file mode 100644 index 0000000000..887e31b0e6 --- /dev/null +++ b/packages/verkle/.eslintrc.cjs @@ -0,0 +1,15 @@ +module.exports = { + extends: '../../config/eslint.cjs', + parserOptions: { + project: ['./tsconfig.lint.json'], + }, + ignorePatterns: ['src/rust-verkle-wasm/rust_verkle_wasm.js', '**/vendor/*.js'], + overrides: [ + { + files: ['benchmarks/*.ts', 'examples/*.ts'], + rules: { + 'no-console': 'off', + }, + }, + ], +} diff --git a/packages/verkle/package.json b/packages/verkle/package.json index 9248d9de6b..1eb8885410 100644 --- a/packages/verkle/package.json +++ b/packages/verkle/package.json @@ -37,6 +37,8 @@ "docs:build": "typedoc --options typedoc.cjs", "examples": "tsx ../../scripts/examples-runner.ts -- verkle", "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", "test:node": "npx vitest run", diff --git a/packages/verkle/tsconfig.lint.json b/packages/verkle/tsconfig.lint.json new file mode 100644 index 0000000000..3698f4f0be --- /dev/null +++ b/packages/verkle/tsconfig.lint.json @@ -0,0 +1,3 @@ +{ + "extends": "../../config/tsconfig.lint.json" +} diff --git a/packages/vm/.eslintrc.cjs b/packages/vm/.eslintrc.cjs new file mode 100644 index 0000000000..811a41ecc2 --- /dev/null +++ b/packages/vm/.eslintrc.cjs @@ -0,0 +1,19 @@ +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', + }, + }, + ], +} diff --git a/packages/vm/package.json b/packages/vm/package.json index aaeda7d502..44482b319e 100644 --- a/packages/vm/package.json +++ b/packages/vm/package.json @@ -36,6 +36,8 @@ "examples": "tsx ../../scripts/examples-runner.ts -- vm", "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 && npm run test:buildIntegrity", "profiling": "0x ./benchmarks/run.js profiling", "test": "echo \"[INFO] Generic test cmd not used. See package.json for more specific test run cmds.\"", diff --git a/packages/vm/tsconfig.lint.json b/packages/vm/tsconfig.lint.json new file mode 100644 index 0000000000..3698f4f0be --- /dev/null +++ b/packages/vm/tsconfig.lint.json @@ -0,0 +1,3 @@ +{ + "extends": "../../config/tsconfig.lint.json" +} diff --git a/packages/wallet/.eslintrc.cjs b/packages/wallet/.eslintrc.cjs new file mode 100644 index 0000000000..e71bb1e9fe --- /dev/null +++ b/packages/wallet/.eslintrc.cjs @@ -0,0 +1,16 @@ +module.exports = { + extends: '../../config/eslint.cjs', + parserOptions: { + project: ['./tsconfig.lint.json'], + }, + overrides: [ + { + files: ['test/index.spec.ts', 'examples/**/*'], + rules: { + 'github/array-foreach': 'warn', + 'no-prototype-builtins': 'warn', + 'no-console': 'off', + }, + }, + ], +} diff --git a/packages/wallet/.prettierignore b/packages/wallet/.prettierignore deleted file mode 100644 index ff9ab017da..0000000000 --- a/packages/wallet/.prettierignore +++ /dev/null @@ -1,7 +0,0 @@ -node_modules -.vscode -package.json -dist -.nyc_output -test/testdata -docs \ No newline at end of file diff --git a/packages/wallet/package.json b/packages/wallet/package.json index a33770b701..5b668603a3 100644 --- a/packages/wallet/package.json +++ b/packages/wallet/package.json @@ -31,6 +31,8 @@ "docs:build": "npx typedoc --options typedoc.cjs", "examples": "tsx ../../scripts/examples-runner.ts -- wallet", "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", diff --git a/packages/wallet/tsconfig.lint.json b/packages/wallet/tsconfig.lint.json new file mode 100644 index 0000000000..3698f4f0be --- /dev/null +++ b/packages/wallet/tsconfig.lint.json @@ -0,0 +1,3 @@ +{ + "extends": "../../config/tsconfig.lint.json" +}