From f8d1b38d7d920a0fe7d03dd02fa8315cd435d71a Mon Sep 17 00:00:00 2001 From: Emi Date: Mon, 19 Jun 2023 13:15:52 +0200 Subject: [PATCH] Fix eslint config --- package-lock.json | 69 ++++++++------------ packages/eslint-config-custom/.prettierrc.js | 21 +----- packages/eslint-config-custom/index.js | 17 ++++- 3 files changed, 43 insertions(+), 64 deletions(-) diff --git a/package-lock.json b/package-lock.json index 43572e5cca..6851b7a74c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,8 +19,7 @@ "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-promise": "^6.1.1", "eslint-plugin-react-hooks": "^4.6.0", - "prettier": "^2.3.2", - "prettier-config-standard": "^5.0.0" + "prettier": "^2.8.8" }, "devDependencies": { "lerna": "^6.6.2" @@ -192,9 +191,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.42.0.tgz", - "integrity": "sha512-6SWlXpWU5AvId8Ac7zjzmIOqMOba/JWY8XZ4A7q7Gn1Vlfg/SFFIlrtHXt9nPn4op9ZPAkl91Jao+QQv3r/ukw==", + "version": "8.43.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.43.0.tgz", + "integrity": "sha512-s2UHCoiXfxMvmfzqoN+vrQ84ahUSYde9qNO1MdxmoEhyHWsfmwOpFlwYV+ePJEVc7gFnATGUi376WowX1N7tFg==", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } @@ -2037,9 +2036,9 @@ } }, "node_modules/acorn": { - "version": "8.8.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.9.0.tgz", + "integrity": "sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ==", "bin": { "acorn": "bin/acorn" }, @@ -3588,14 +3587,14 @@ } }, "node_modules/eslint": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.42.0.tgz", - "integrity": "sha512-ulg9Ms6E1WPf67PHaEY4/6E2tEn5/f7FXGzr3t9cBMugOmf1INYvuUwwh1aXQN4MfJ6a5K2iNwP3w4AColvI9A==", + "version": "8.43.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.43.0.tgz", + "integrity": "sha512-aaCpf2JqqKesMFGgmRPessmVKjcGXqdlAYLLC3THM8t5nBRZRQ+st5WM/hoJXkdioEXLLbXgclUpM0TXo5HX5Q==", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.4.0", "@eslint/eslintrc": "^2.0.3", - "@eslint/js": "8.42.0", + "@eslint/js": "8.43.0", "@humanwhocodes/config-array": "^0.11.10", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -3954,9 +3953,9 @@ } }, "node_modules/eslint-plugin-n/node_modules/semver": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", - "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", + "version": "7.5.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.2.tgz", + "integrity": "sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==", "peer": true, "dependencies": { "lru-cache": "^6.0.0" @@ -8646,14 +8645,6 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "node_modules/prettier-config-standard": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/prettier-config-standard/-/prettier-config-standard-5.0.0.tgz", - "integrity": "sha512-QK252QwCxlsak8Zx+rPKZU31UdbRcu9iUk9X1ONYtLSO221OgvV9TlKoTf6iPDZtvF3vE2mkgzFIEgSUcGELSQ==", - "peerDependencies": { - "prettier": "^2.4.0" - } - }, "node_modules/prettier-linter-helpers": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", @@ -10669,9 +10660,9 @@ } }, "@eslint/js": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.42.0.tgz", - "integrity": "sha512-6SWlXpWU5AvId8Ac7zjzmIOqMOba/JWY8XZ4A7q7Gn1Vlfg/SFFIlrtHXt9nPn4op9ZPAkl91Jao+QQv3r/ukw==" + "version": "8.43.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.43.0.tgz", + "integrity": "sha512-s2UHCoiXfxMvmfzqoN+vrQ84ahUSYde9qNO1MdxmoEhyHWsfmwOpFlwYV+ePJEVc7gFnATGUi376WowX1N7tFg==" }, "@gar/promisify": { "version": "1.1.3", @@ -12015,9 +12006,9 @@ } }, "acorn": { - "version": "8.8.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==" + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.9.0.tgz", + "integrity": "sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ==" }, "acorn-jsx": { "version": "5.3.2", @@ -13179,14 +13170,14 @@ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" }, "eslint": { - "version": "8.42.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.42.0.tgz", - "integrity": "sha512-ulg9Ms6E1WPf67PHaEY4/6E2tEn5/f7FXGzr3t9cBMugOmf1INYvuUwwh1aXQN4MfJ6a5K2iNwP3w4AColvI9A==", + "version": "8.43.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.43.0.tgz", + "integrity": "sha512-aaCpf2JqqKesMFGgmRPessmVKjcGXqdlAYLLC3THM8t5nBRZRQ+st5WM/hoJXkdioEXLLbXgclUpM0TXo5HX5Q==", "requires": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.4.0", "@eslint/eslintrc": "^2.0.3", - "@eslint/js": "8.42.0", + "@eslint/js": "8.43.0", "@humanwhocodes/config-array": "^0.11.10", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -13447,9 +13438,9 @@ }, "dependencies": { "semver": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", - "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", + "version": "7.5.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.2.tgz", + "integrity": "sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==", "peer": true, "requires": { "lru-cache": "^6.0.0" @@ -16909,12 +16900,6 @@ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==" }, - "prettier-config-standard": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/prettier-config-standard/-/prettier-config-standard-5.0.0.tgz", - "integrity": "sha512-QK252QwCxlsak8Zx+rPKZU31UdbRcu9iUk9X1ONYtLSO221OgvV9TlKoTf6iPDZtvF3vE2mkgzFIEgSUcGELSQ==", - "requires": {} - }, "prettier-linter-helpers": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", diff --git a/packages/eslint-config-custom/.prettierrc.js b/packages/eslint-config-custom/.prettierrc.js index f743b0e913..414a7059c8 100644 --- a/packages/eslint-config-custom/.prettierrc.js +++ b/packages/eslint-config-custom/.prettierrc.js @@ -1,27 +1,10 @@ -// const prettierConfigStandard = require('prettier-config-standard') - -// { -// "arrowParens": "always", -// "bracketSpacing": true, -// "jsxBracketSameLine": false, -// "jsxSingleQuote": false, -// "quoteProps": "as-needed", -// "singleQuote": true, -// "semi": false, -// "printWidth": 140, -// "useTabs": false, -// "tabWidth": 2, -// "trailingComma": "es5" -// } - const modifiedConfig = { - // ...prettierConfigStandard, singleQuote: true, jsxSingleQuote: true, spaceBeforeFunctionParen: true, printWidth: 100, - parser: 'typescript' - // ... other modified settings here + parser: 'typescript', + semi: false } module.exports = modifiedConfig diff --git a/packages/eslint-config-custom/index.js b/packages/eslint-config-custom/index.js index cf9c898d81..ecf9bf26da 100644 --- a/packages/eslint-config-custom/index.js +++ b/packages/eslint-config-custom/index.js @@ -2,12 +2,16 @@ module.exports = { env: { "jest/globals": true }, - extends: ['standard-with-typescript', 'plugin:prettier/recommended',], + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:prettier/recommended' + ], parserOptions: { project: './tsconfig.json' }, parser: '@typescript-eslint/parser', - plugins: ['react-hooks', 'jest', 'prettier'], + plugins: ['@typescript-eslint', 'react-hooks', 'jest'], rules: { 'node/no-path-concat': 'off', 'multiline-ternary': 'off', @@ -58,7 +62,14 @@ module.exports = { } } ], - // "prettier/prettier": "error" + // 'prettier/prettier': [ + // "error", { + // semi: false, + // singleQuote: true + // }, + // { + // "usePrettierrc": false + // }], }, overrides: [ {