Skip to content

Commit

Permalink
add shared eslint & prettier (#102)
Browse files Browse the repository at this point in the history
* add shared eslint & prettier

* leave sdk specific rules

* disable errors for tests files

* use generic eslint rules
  • Loading branch information
volodymyr-basiuk authored Jul 18, 2023
1 parent 4fc2f6f commit 94481f9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 27 deletions.
22 changes: 2 additions & 20 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "prettier"],
"parserOptions": {
"project": ["tsconfig.json", "tsconfig.test.json"]
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"no-console": 1, // Means warning
"prettier/prettier": 2, // Means error
"@typescript-eslint/no-floating-promises": ["error"],
"@typescript-eslint/no-non-null-assertion": "off"
},
"ignorePatterns": ["dist", "node_modules"]
}
"extends": ["@iden3/eslint-config"]
}
7 changes: 1 addition & 6 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
{
"semi": true,
"trailingComma": "none",
"singleQuote": true,
"printWidth": 100
}
"@iden3/eslint-config/prettier"
15 changes: 15 additions & 0 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"doc:watch:website": "ts-node ./scripts/doc-watch.ts",
"tsc:declaration:watch": "tsc --watch --module commonjs --emitDeclarationOnly",
"test": "env TS_NODE_COMPILER_OPTIONS='{\"strict\": false}' mocha",
"lint": "eslint --fix --ext .js,.ts src/** tests/**",
"lint": "eslint --fix --ext .ts src/** tests/**",
"format": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"",
"deps:check": "madge --circular --extensions ts ./"
},
Expand All @@ -43,6 +43,7 @@
},
"homepage": "https://github.com/0xPolygonID/js-sdk#readme",
"devDependencies": {
"@iden3/eslint-config": "https://github.com/iden3/eslint-config",
"@esbuild-plugins/node-globals-polyfill": "^0.1.1",
"@esbuild-plugins/node-modules-polyfill": "^0.1.4",
"@gr2m/fetch-mock": "^9.11.0-pull-request-644.1",
Expand Down

0 comments on commit 94481f9

Please sign in to comment.