Skip to content

Commit

Permalink
Adds linting rules and lint script to all the packages; foundation fo…
Browse files Browse the repository at this point in the history
…r running pre commit hook

Signed-off-by: Konstantina Blazhukova <[email protected]>
  • Loading branch information
konstantinabl committed Oct 29, 2024
1 parent ef9d696 commit 5a8f8dd
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 51 deletions.
22 changes: 19 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 All @@ -28,6 +29,9 @@ module.exports = {
"plugin:@typescript-eslint/recommended",
"prettier"
],
"plugins": [
"license-header"
],
"overrides": [
{
"env": {
Expand All @@ -49,9 +53,21 @@ 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",
'license-header/header': ['error', path.resolve(__dirname, 'resources/license-header.js')],
"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.

82 changes: 58 additions & 24 deletions package-lock.json

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

5 changes: 3 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 All @@ -21,6 +21,7 @@
"eslint-config-prettier": "^8.3.0",
"eslint-config-standard-with-typescript": "^43.0.1",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-license-header": "^0.6.1",
"eslint-plugin-n": "^15.7.0",
"ethereum-waffle": "^4.0.7",
"husky": "^8.0.3",
Expand Down Expand Up @@ -92,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
Loading

0 comments on commit 5a8f8dd

Please sign in to comment.