Skip to content

Commit

Permalink
chore: Adds eslint rules in eslintrc (#3173)
Browse files Browse the repository at this point in the history
* Adds linting rules and lint script to all the packages; foundation for running pre commit hook

Signed-off-by: Konstantina Blazhukova <[email protected]>

* Removes license header rule and uninstalls unecessary plugin

Signed-off-by: Konstantina Blazhukova <[email protected]>

---------

Signed-off-by: Konstantina Blazhukova <[email protected]>
  • Loading branch information
konstantinabl authored Oct 31, 2024
1 parent 6606c38 commit d6fece1
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 51 deletions.
18 changes: 15 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* limitations under the License.
*
*/
const path = require('path');

module.exports = {
"env": {
Expand Down Expand Up @@ -49,9 +50,20 @@ module.exports = {
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/semi": "off",
"@typescript-eslint/no-var-requires": "warn",
"@typescript-eslint/ban-types": "warn",
"no-trailing-spaces": "error",
"no-prototype-builtins": "warn",
"prefer-const": "error",
"no-unsafe-optional-chaining": "warn",
"comma-dangle": [2, "only-multiline"],
"semi": [2, "always"]
}
"semi": [2, "always"],
"sort-imports": ["error", {
"ignoreCase": true,
"ignoreDeclarationSort": true,
"ignoreMemberSort": false,
"memberSyntaxSortOrder": ["none", "all", "multiple", "single"],
}],
},
};
20 changes: 0 additions & 20 deletions .eslintrc.yml

This file was deleted.

50 changes: 26 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"@types/co-body": "6.1.0",
"@types/find-config": "^1.0.4",
"@types/koa-cors": "^0.0.6",
"@types/sinon": "^10.0.20",
"@types/lodash": "^4.17.7",
"@types/sinon": "^10.0.20",
"@typescript-eslint/eslint-plugin": "^6.5.0",
"@typescript-eslint/parser": "^6.5.0",
"ajv": "^8.16.0",
Expand Down Expand Up @@ -93,8 +93,8 @@
"lerna": "^8.1.8",
"pino": "^7.11.0",
"pino-pretty": "^7.6.1",
"prom-client": "^14.0.1",
"pnpm": "^8.7.1",
"prom-client": "^14.0.1",
"redis": "^4.7.0"
},
"overrides": {
Expand Down
2 changes: 1 addition & 1 deletion packages/config-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"build": "pnpm run clean && pnpm run compile",
"clean": "rm -rf ./dist && rm -rf tsconfig.tsbuildinfo",
"compile": "tsc -b tsconfig.json",
"lint": "npx eslint --ext .js,.ts .",
"lint": "npx eslint --ext .js,.ts . --ignore-path ../../.eslintignore",
"format": "npx prettier --ignore-path ../../.gitignore --write \"**/*.+(js|ts|json)\"",
"test": "nyc ts-mocha --recursive './tests/**/*.spec.ts' './tests/**/**/*.spec.ts' --exit",
"print-env": "node src/commands/printEnvs.ts"
Expand Down
2 changes: 1 addition & 1 deletion packages/relay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"build": "pnpm run clean && pnpm run compile",
"clean": "rm -rf ./dist && rm -rf tsconfig.tsbuildinfo",
"compile": "tsc -b tsconfig.json",
"lint": "npx eslint --ext .js,.ts .",
"lint": "npx eslint --ext .js,.ts . --ignore-path ../../.eslintignore",
"format": "npx prettier --ignore-path ../../.gitignore --write \"**/*.+(js|ts|json)\"",
"test": "nyc ts-mocha --recursive './tests/**/*.spec.ts' './tests/**/**/*.spec.ts' --exit",
"test-eth": "nyc ts-mocha --recursive './tests/lib/eth/**/*.spec.ts' --exit",
Expand Down
1 change: 1 addition & 0 deletions packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"clean": "rm -rf ./dist && rm -rf tsconfig.tsbuildinfo",
"compile": "tsc -b tsconfig.json",
"acceptancetest": "nyc ts-mocha tests/acceptance/index.spec.ts",
"lint": "npx eslint --ext .js,.ts . --ignore-path ../../.eslintignore",
"start": "node dist/index.js",
"test": "nyc ts-mocha --recursive './tests/integration/*.spec.ts' './tests/integration/**/*.spec.ts' --exit"
},
Expand Down
1 change: 1 addition & 0 deletions packages/ws-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"compile": "tsc -b tsconfig.json",
"acceptancetest": "nyc ts-mocha tests/acceptance/index.spec.ts",
"start": "node dist/index.js",
"lint": "npx eslint --ext .js,.ts . --ignore-path ../../.eslintignore",
"test": "nyc ts-mocha --recursive './tests/unit/**/*.spec.ts' --exit"
},
"nyc": {
Expand Down

0 comments on commit d6fece1

Please sign in to comment.