Skip to content

Commit

Permalink
Move lint:diff to root package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
acolytec3 committed Nov 13, 2024
1 parent 5f04719 commit f434ac3
Show file tree
Hide file tree
Showing 23 changed files with 14 additions and 139 deletions.
2 changes: 1 addition & 1 deletion .githooks/pre-push
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env sh

npm run lint:diff --workspaces
npm run lint:diff
10 changes: 5 additions & 5 deletions config/cli/lint-diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
REMOTE=$(git rev-parse --symbolic-full-name --abbrev-ref @{u})

if [ -z "$REMOTE" ]; then
FILESCHANGED=". --ext .js,.jsx,.ts,.tsx"
FILESCHANGED=". --ext .js,.ts"
else
FILESCHANGED=$(git diff --diff-filter=d --name-only --relative $REMOTE | grep -E '\.(js|jsx|ts|tsx)')
FILESCHANGED=$(git diff --diff-filter=d --name-only --relative $REMOTE | grep -E '\.(js|ts)')
fi

echo $FILESCHANGED
Expand All @@ -25,8 +25,8 @@ dim() {
echo "${DIM}$1${NOCOLOR}"
}

dim "> eslint --format codeframe --config ./.eslintrc.cjs . \\ "
dim "\t --ext .js,.jsx,.ts,.tsx \\ "
dim "> eslint --format codeframe --config ./config/eslint.cjs . \\ "
dim "\t --ext .js,.ts \\ "

blue "[Lint]${NOCOLOR} checking..."

Expand All @@ -35,7 +35,7 @@ if [ -z "$FILESCHANGED" ]; then
exit
fi

eslint --format codeframe --config ./.eslintrc.cjs $FILESCHANGED
eslint --format codeframe --config ./config/eslint.cjs $FILESCHANGED

RETURN_CODE=$?

Expand Down
33 changes: 0 additions & 33 deletions config/cli/lint-fix.sh

This file was deleted.

33 changes: 0 additions & 33 deletions config/cli/lint.sh

This file was deleted.

2 changes: 2 additions & 0 deletions config/eslint.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ module.exports = {
'devnets',
'eslint',
'lint-staged.config.js',
'tsconfig.lint.json',
'package.json',
],
extends: [
'typestrict',
Expand Down
24 changes: 5 additions & 19 deletions config/tsconfig.lint.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,12 @@
{
"extends": "./tsconfig.json",
"include": [
"../packages/block/**/*.ts",
"../packages/blockchain/**/*.ts",
"../packages/client/**/*.ts",
"../packages/common/**/*.ts",
"../packages/devp2p/**/*.ts",
"../packages/ethash/**/*.ts",
"../packages/evm/**/*.ts",
"../packages/genesis/**/*.ts",
"../packages/mpt/**/*.ts",
"../packages/mpt/examples/**/*",
"../packages/rlp/**/*.ts",
"../packages/statemanager/**/*.ts",
"../packages/tx/**/*.ts",
"../packages/util/**/*.ts",
"../packages/verkle/**/*.ts",
"../packages/vm/**/*.ts",
"../packages/wallet/**/*.ts",
"../packages/ethereum-tests/**/*.js"
"../packages/**/*.ts",
"../packages/**/*.js",
"../packages/ethereum-tests/**/*.js",
"package.json"
],
"exclude": ["../packages/client/devnets", "../packages/client/archive", "**/ethereum-tests/**/*"],
"exclude": ["../packages/client/devnets", "../packages/client/archive", "**/ethereum-tests/**/*", "package.json"],
"compilerOptions": {
"noEmit": true
}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"examples:build": "npm run examples:build --workspaces --if-present",
"lint": "eslint --format codeframe --config ./config/eslint.cjs . --ext .js,.ts",
"lint:fix": "eslint --fix --config ./config/eslint.cjs . --ext .js,.ts",
"lint:diff": "./config/cli/lint-diff.sh",
"test": "npm run test --workspaces --if-present",
"test:node": "npm run test:node --workspaces --if-present",
"test:browser": "npm run test:browser --workspaces --if-present",
Expand Down
3 changes: 0 additions & 3 deletions packages/block/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@
"docs:build": "typedoc --options typedoc.cjs",
"examples": "tsx ../../scripts/examples-runner.ts -- block",
"examples:build": "npx embedme README.md",
"lint": "../../config/cli/lint.sh",
"lint:diff": "../../config/cli/lint-diff.sh",
"lint:fix": "../../config/cli/lint-fix.sh",
"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: 0 additions & 3 deletions packages/blockchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@
"docs:build": "typedoc --options typedoc.cjs",
"examples": "tsx ../../scripts/examples-runner.ts -- blockchain",
"examples:build": "npx embedme README.md",
"lint": "../../config/cli/lint.sh",
"lint:diff": "../../config/cli/lint-diff.sh",
"lint:fix": "../../config/cli/lint-fix.sh",
"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: 0 additions & 3 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
"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": "../../config/cli/lint.sh",
"lint:diff": "../../config/cli/lint-diff.sh",
"lint:fix": "../../config/cli/lint-fix.sh",
"preinstall": "npm run binWorkaround",
"prepublishOnly": "../../config/cli/prepublish.sh",
"test": "npm run test:unit && npm run test:integration",
Expand Down
3 changes: 0 additions & 3 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@
"docs:build": "typedoc --options typedoc.cjs",
"examples": "tsx ../../scripts/examples-runner.ts -- common",
"examples:build": "npx embedme README.md",
"lint": "../../config/cli/lint.sh",
"lint:diff": "../../config/cli/lint-diff.sh",
"lint:fix": "../../config/cli/lint-fix.sh",
"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: 0 additions & 3 deletions packages/devp2p/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@
"docs:build": "typedoc --options typedoc.cjs",
"examples": "tsx ../../scripts/examples-runner.ts -- devp2p",
"examples:build": "npx embedme README.md",
"lint": "../../config/cli/lint.sh",
"lint:diff": "../../config/cli/lint-diff.sh",
"lint:fix": "../../config/cli/lint-fix.sh",
"prepublishOnly": "../../config/cli/prepublish.sh",
"test": "vitest run",
"test:node": "npm run test",
Expand Down
3 changes: 0 additions & 3 deletions packages/ethash/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@
"docs:build": "typedoc --options typedoc.cjs",
"examples": "tsx ../../scripts/examples-runner.ts -- ethash",
"examples:build": "npx embedme README.md",
"lint": "../../config/cli/lint.sh",
"lint:diff": "../../config/cli/lint-diff.sh",
"lint:fix": "../../config/cli/lint-fix.sh",
"prepublishOnly": "../../config/cli/prepublish.sh",
"test": "npx vitest run",
"tsc": "../../config/cli/ts-compile.sh"
Expand Down
3 changes: 0 additions & 3 deletions packages/evm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
"examples": "tsx ../../scripts/examples-runner.ts -- evm",
"examples:build": "npx embedme README.md",
"formatTest": "node ./scripts/formatTest",
"lint": "../../config/cli/lint.sh",
"lint:diff": "../../config/cli/lint-diff.sh",
"lint:fix": "../../config/cli/lint-fix.sh",
"prepublishOnly": "../../config/cli/prepublish.sh",
"profiling": "0x ./benchmarks/run.js profiling",
"test": "npm run test:node && npm run test:browser",
Expand Down
3 changes: 0 additions & 3 deletions packages/genesis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@
"examples": "tsx ../../scripts/examples-runner.ts -- genesis",
"examples:build": "npx embedme README.md",
"docs:build": "typedoc --options typedoc.cjs",
"lint": "../../config/cli/lint.sh",
"lint:diff": "../../config/cli/lint-diff.sh",
"lint:fix": "../../config/cli/lint-fix.sh",
"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: 0 additions & 3 deletions packages/mpt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
"docs:build": "typedoc --options typedoc.cjs",
"examples": "tsx ../../scripts/examples-runner.ts -- mpt",
"examples:build": "npx embedme README.md",
"lint": "../../config/cli/lint.sh",
"lint:diff": "../../config/cli/lint-diff.sh",
"lint:fix": "../../config/cli/lint-fix.sh",
"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: 0 additions & 3 deletions packages/rlp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@
"coverage": "npx vitest --coverage --coverage.include=src run",
"examples": "tsx ../../scripts/examples-runner.ts -- rlp",
"examples:build": "npx embedme README.md",
"lint": "../../config/cli/lint.sh",
"lint:diff": "../../config/cli/lint-diff.sh",
"lint:fix": "../../config/cli/lint-fix.sh",
"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: 0 additions & 3 deletions packages/statemanager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
"docs:build": "typedoc --options typedoc.cjs",
"examples": "tsx ../../scripts/examples-runner.ts -- statemanager",
"examples:build": "npx embedme README.md",
"lint": "../../config/cli/lint.sh",
"lint:diff": "../../config/cli/lint-diff.sh",
"lint:fix": "../../config/cli/lint-fix.sh",
"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: 0 additions & 3 deletions packages/tx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@
"docs:build": "typedoc --options typedoc.cjs",
"examples": "tsx ../../scripts/examples-runner.ts -- tx",
"examples:build": "npx embedme README.md",
"lint": "../../config/cli/lint.sh",
"lint:diff": "../../config/cli/lint-diff.sh",
"lint:fix": "../../config/cli/lint-fix.sh",
"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: 0 additions & 3 deletions packages/util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@
"docs:build": "npx typedoc --options typedoc.cjs",
"examples": "tsx ../../scripts/examples-runner.ts -- util",
"examples:build": "npx embedme README.md",
"lint": "../../config/cli/lint.sh",
"lint:diff": "../../config/cli/lint-diff.sh",
"lint:fix": "../../config/cli/lint-fix.sh",
"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: 0 additions & 3 deletions packages/verkle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@
"docs:build": "typedoc --options typedoc.cjs",
"examples": "tsx ../../scripts/examples-runner.ts -- verkle",
"examples:build": "npx embedme README.md",
"lint": "../../config/cli/lint.sh",
"lint:diff": "../../config/cli/lint-diff.sh",
"lint:fix": "../../config/cli/lint-fix.sh",
"prepublishOnly": "../../config/cli/prepublish.sh",
"test": "npm run test:node",
"test:node": "npx vitest run",
Expand Down
3 changes: 0 additions & 3 deletions packages/vm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
"examples": "tsx ../../scripts/examples-runner.ts -- vm",
"examples:build": "npx embedme README.md",
"formatTest": "node ./scripts/formatTest",
"lint": "../../config/cli/lint.sh",
"lint:diff": "../../config/cli/lint-diff.sh",
"lint:fix": "../../config/cli/lint-fix.sh",
"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.\"",
Expand Down
3 changes: 0 additions & 3 deletions packages/wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@
"docs:build": "npx typedoc --options typedoc.cjs",
"examples": "tsx ../../scripts/examples-runner.ts -- wallet",
"examples:build": "npx embedme README.md",
"lint": "../../config/cli/lint.sh",
"lint:diff": "../../config/cli/lint-diff.sh",
"lint:fix": "../../config/cli/lint-fix.sh",
"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

0 comments on commit f434ac3

Please sign in to comment.