diff --git a/.eslintrc b/.eslintrc index 4e02df9b..dac8b75f 100644 --- a/.eslintrc +++ b/.eslintrc @@ -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"] +} \ No newline at end of file diff --git a/.prettierrc b/.prettierrc index 83289e00..2603248d 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,6 +1 @@ -{ - "semi": true, - "trailingComma": "none", - "singleQuote": true, - "printWidth": 100 -} +"@iden3/eslint-config/prettier" \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index e9c8b2a7..96b594c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,6 +37,7 @@ "@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", + "@iden3/eslint-config": "https://github.com/iden3/eslint-config", "@microsoft/api-documenter": "^7.8.20", "@microsoft/api-extractor": "^7.9.0", "@types/chai": "^4.3.4", @@ -1516,6 +1517,20 @@ "ffjavascript": "^0.2.48" } }, + "node_modules/@iden3/eslint-config": { + "version": "1.0.0", + "resolved": "git+ssh://git@github.com/iden3/eslint-config.git#2848a55e4d4fabe196315b4828158856a84292aa", + "dev": true, + "license": "AGPL-3.0", + "peerDependencies": { + "@typescript-eslint/eslint-plugin": "^5.0.0", + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^8.13.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-prettier": "^4.2.1", + "prettier": "^2.7.1" + } + }, "node_modules/@iden3/js-crypto": { "version": "1.0.0-beta.1", "resolved": "https://registry.npmjs.org/@iden3/js-crypto/-/js-crypto-1.0.0-beta.1.tgz", diff --git a/package.json b/package.json index 2ed6d119..cc5a1fac 100644 --- a/package.json +++ b/package.json @@ -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 ./" }, @@ -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",