From 4f739af259e2afe229c3ddd531b90a32a47f2da7 Mon Sep 17 00:00:00 2001 From: Hazmi Alfarizqi Date: Sun, 19 Mar 2023 14:38:07 +0700 Subject: [PATCH] fix(typescript-eslint): Fix typescript-eslint config in ESLint >=v8.35.0 This is caused by PR eslint/eslint#16844, moving eslint-recommended.js file to @eslint/js package. --- package.json | 2 + pnpm-lock.yaml | 104 ++++++++++++++++++++++---------------------- typescript/index.js | 4 +- 3 files changed, 57 insertions(+), 53 deletions(-) diff --git a/package.json b/package.json index 6fe4923a..bd1884a9 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "extends": "./index.js" }, "devDependencies": { + "@eslint/js": ">=8.36.0", "@types/node": "*", "@typescript-eslint/eslint-plugin": ">=5.55.0", "@typescript-eslint/parser": ">=5.55.0", @@ -31,6 +32,7 @@ "typescript": ">=3.3.1 <5.1.0" }, "peerDependencies": { + "@eslint/js": ">=8.36.0", "@typescript-eslint/eslint-plugin": ">=5.55.0", "@typescript-eslint/parser": ">=5.55.0", "eslint": ">=8.36.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3de5d58a..41aff6c5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,6 +1,7 @@ lockfileVersion: 5.4 specifiers: + '@eslint/js': '>=8.36.0' '@types/node': '*' '@typescript-eslint/eslint-plugin': '>=5.55.0' '@typescript-eslint/parser': '>=5.55.0' @@ -8,11 +9,12 @@ specifiers: typescript: '>=3.3.1 <5.1.0' devDependencies: - '@types/node': 18.11.11 - '@typescript-eslint/eslint-plugin': 5.55.0_fedoju2l7hidv3p4qpyg3rnx3i - '@typescript-eslint/parser': 5.55.0_ksm65cmkhueqbr4niscev4pjv4 + '@eslint/js': 8.36.0 + '@types/node': 18.15.3 + '@typescript-eslint/eslint-plugin': 5.55.0_qsnvknysi52qtaxqdyqyohkcku + '@typescript-eslint/parser': 5.55.0_j4766f7ecgqbon3u7zlxn5zszu eslint: 8.36.0 - typescript: 4.9.3 + typescript: 5.0.2 packages: @@ -39,7 +41,7 @@ packages: debug: 4.3.4 espree: 9.5.0 globals: 13.20.0 - ignore: 5.2.0 + ignore: 5.2.4 import-fresh: 3.3.0 js-yaml: 4.1.0 minimatch: 3.1.2 @@ -91,22 +93,22 @@ packages: engines: {node: '>= 8'} dependencies: '@nodelib/fs.scandir': 2.1.5 - fastq: 1.13.0 + fastq: 1.15.0 dev: true /@types/json-schema/7.0.11: resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==} dev: true - /@types/node/18.11.11: - resolution: {integrity: sha512-KJ021B1nlQUBLopzZmPBVuGU9un7WJd/W4ya7Ih02B4Uwky5Nja0yGYav2EfYIk0RR2Q9oVhf60S2XR1BCWJ2g==} + /@types/node/18.15.3: + resolution: {integrity: sha512-p6ua9zBxz5otCmbpb5D3U4B5Nanw6Pk3PPyX05xnxbB/fRv71N7CPmORg7uAD5P70T0xmx1pzAx/FUfa5X+3cw==} dev: true /@types/semver/7.3.13: resolution: {integrity: sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==} dev: true - /@typescript-eslint/eslint-plugin/5.55.0_fedoju2l7hidv3p4qpyg3rnx3i: + /@typescript-eslint/eslint-plugin/5.55.0_qsnvknysi52qtaxqdyqyohkcku: resolution: {integrity: sha512-IZGc50rtbjk+xp5YQoJvmMPmJEYoC53SiKPXyqWfv15XoD2Y5Kju6zN0DwlmaGJp1Iw33JsWJcQ7nw0lGCGjVg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -118,23 +120,23 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.4.0 - '@typescript-eslint/parser': 5.55.0_ksm65cmkhueqbr4niscev4pjv4 + '@typescript-eslint/parser': 5.55.0_j4766f7ecgqbon3u7zlxn5zszu '@typescript-eslint/scope-manager': 5.55.0 - '@typescript-eslint/type-utils': 5.55.0_ksm65cmkhueqbr4niscev4pjv4 - '@typescript-eslint/utils': 5.55.0_ksm65cmkhueqbr4niscev4pjv4 + '@typescript-eslint/type-utils': 5.55.0_j4766f7ecgqbon3u7zlxn5zszu + '@typescript-eslint/utils': 5.55.0_j4766f7ecgqbon3u7zlxn5zszu debug: 4.3.4 eslint: 8.36.0 grapheme-splitter: 1.0.4 - ignore: 5.2.0 + ignore: 5.2.4 natural-compare-lite: 1.4.0 semver: 7.3.8 - tsutils: 3.21.0_typescript@4.9.3 - typescript: 4.9.3 + tsutils: 3.21.0_typescript@5.0.2 + typescript: 5.0.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser/5.55.0_ksm65cmkhueqbr4niscev4pjv4: + /@typescript-eslint/parser/5.55.0_j4766f7ecgqbon3u7zlxn5zszu: resolution: {integrity: sha512-ppvmeF7hvdhUUZWSd2EEWfzcFkjJzgNQzVST22nzg958CR+sphy8A6K7LXQZd6V75m1VKjp+J4g/PCEfSCmzhw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -146,10 +148,10 @@ packages: dependencies: '@typescript-eslint/scope-manager': 5.55.0 '@typescript-eslint/types': 5.55.0 - '@typescript-eslint/typescript-estree': 5.55.0_typescript@4.9.3 + '@typescript-eslint/typescript-estree': 5.55.0_typescript@5.0.2 debug: 4.3.4 eslint: 8.36.0 - typescript: 4.9.3 + typescript: 5.0.2 transitivePeerDependencies: - supports-color dev: true @@ -162,7 +164,7 @@ packages: '@typescript-eslint/visitor-keys': 5.55.0 dev: true - /@typescript-eslint/type-utils/5.55.0_ksm65cmkhueqbr4niscev4pjv4: + /@typescript-eslint/type-utils/5.55.0_j4766f7ecgqbon3u7zlxn5zszu: resolution: {integrity: sha512-ObqxBgHIXj8rBNm0yh8oORFrICcJuZPZTqtAFh0oZQyr5DnAHZWfyw54RwpEEH+fD8suZaI0YxvWu5tYE/WswA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -172,12 +174,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.55.0_typescript@4.9.3 - '@typescript-eslint/utils': 5.55.0_ksm65cmkhueqbr4niscev4pjv4 + '@typescript-eslint/typescript-estree': 5.55.0_typescript@5.0.2 + '@typescript-eslint/utils': 5.55.0_j4766f7ecgqbon3u7zlxn5zszu debug: 4.3.4 eslint: 8.36.0 - tsutils: 3.21.0_typescript@4.9.3 - typescript: 4.9.3 + tsutils: 3.21.0_typescript@5.0.2 + typescript: 5.0.2 transitivePeerDependencies: - supports-color dev: true @@ -187,7 +189,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/typescript-estree/5.55.0_typescript@4.9.3: + /@typescript-eslint/typescript-estree/5.55.0_typescript@5.0.2: resolution: {integrity: sha512-I7X4A9ovA8gdpWMpr7b1BN9eEbvlEtWhQvpxp/yogt48fy9Lj3iE3ild/1H3jKBBIYj5YYJmS2+9ystVhC7eaQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -202,13 +204,13 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.3.8 - tsutils: 3.21.0_typescript@4.9.3 - typescript: 4.9.3 + tsutils: 3.21.0_typescript@5.0.2 + typescript: 5.0.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils/5.55.0_ksm65cmkhueqbr4niscev4pjv4: + /@typescript-eslint/utils/5.55.0_j4766f7ecgqbon3u7zlxn5zszu: resolution: {integrity: sha512-FkW+i2pQKcpDC3AY6DU54yl8Lfl14FVGYDgBTyGKB75cCwV3KpkpTMFi9d9j2WAJ4271LR2HeC5SEWF/CZmmfw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -219,7 +221,7 @@ packages: '@types/semver': 7.3.13 '@typescript-eslint/scope-manager': 5.55.0 '@typescript-eslint/types': 5.55.0 - '@typescript-eslint/typescript-estree': 5.55.0_typescript@4.9.3 + '@typescript-eslint/typescript-estree': 5.55.0_typescript@5.0.2 eslint: 8.36.0 eslint-scope: 5.1.1 semver: 7.3.8 @@ -236,16 +238,16 @@ packages: eslint-visitor-keys: 3.3.0 dev: true - /acorn-jsx/5.3.2_acorn@8.8.1: + /acorn-jsx/5.3.2_acorn@8.8.2: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - acorn: 8.8.1 + acorn: 8.8.2 dev: true - /acorn/8.8.1: - resolution: {integrity: sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==} + /acorn/8.8.2: + resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} engines: {node: '>=0.4.0'} hasBin: true dev: true @@ -420,12 +422,12 @@ packages: glob-parent: 6.0.2 globals: 13.20.0 grapheme-splitter: 1.0.4 - ignore: 5.2.0 + ignore: 5.2.4 import-fresh: 3.3.0 imurmurhash: 0.1.4 is-glob: 4.0.3 is-path-inside: 3.0.3 - js-sdsl: 4.1.5 + js-sdsl: 4.3.0 js-yaml: 4.1.0 json-stable-stringify-without-jsonify: 1.0.1 levn: 0.4.1 @@ -444,8 +446,8 @@ packages: resolution: {integrity: sha512-JPbJGhKc47++oo4JkEoTe2wjy4fmMwvFpgJT9cQzmfXKp22Dr6Hf1tdCteLz1h0P3t+mGvWZ+4Uankvh8+c6zw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - acorn: 8.8.1 - acorn-jsx: 5.3.2_acorn@8.8.1 + acorn: 8.8.2 + acorn-jsx: 5.3.2_acorn@8.8.2 eslint-visitor-keys: 3.3.0 dev: true @@ -501,8 +503,8 @@ packages: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} dev: true - /fastq/1.13.0: - resolution: {integrity: sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==} + /fastq/1.15.0: + resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==} dependencies: reusify: 1.0.4 dev: true @@ -584,7 +586,7 @@ packages: array-union: 2.1.0 dir-glob: 3.0.1 fast-glob: 3.2.12 - ignore: 5.2.0 + ignore: 5.2.4 merge2: 1.4.1 slash: 3.0.0 dev: true @@ -598,8 +600,8 @@ packages: engines: {node: '>=8'} dev: true - /ignore/5.2.0: - resolution: {integrity: sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==} + /ignore/5.2.4: + resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} engines: {node: '>= 4'} dev: true @@ -653,8 +655,8 @@ packages: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} dev: true - /js-sdsl/4.1.5: - resolution: {integrity: sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q==} + /js-sdsl/4.3.0: + resolution: {integrity: sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==} dev: true /js-yaml/4.1.0: @@ -798,8 +800,8 @@ packages: engines: {node: '>= 0.8.0'} dev: true - /punycode/2.1.1: - resolution: {integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==} + /punycode/2.3.0: + resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} engines: {node: '>=6'} dev: true @@ -889,14 +891,14 @@ packages: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} dev: true - /tsutils/3.21.0_typescript@4.9.3: + /tsutils/3.21.0_typescript@5.0.2: resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} peerDependencies: typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' dependencies: tslib: 1.14.1 - typescript: 4.9.3 + typescript: 5.0.2 dev: true /type-check/0.4.0: @@ -911,16 +913,16 @@ packages: engines: {node: '>=10'} dev: true - /typescript/4.9.3: - resolution: {integrity: sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA==} - engines: {node: '>=4.2.0'} + /typescript/5.0.2: + resolution: {integrity: sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==} + engines: {node: '>=12.20'} hasBin: true dev: true /uri-js/4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} dependencies: - punycode: 2.1.1 + punycode: 2.3.0 dev: true /which/2.0.2: diff --git a/typescript/index.js b/typescript/index.js index 623ea387..13aec44f 100644 --- a/typescript/index.js +++ b/typescript/index.js @@ -1,6 +1,7 @@ /* eslint-env node */ const { resolve } = require("path"); const base = resolve(__dirname, "..", "index.js"); +const eslintJS = require("@eslint/js"); // @typescript-eslint original rules let rules = { @@ -214,8 +215,7 @@ rules = { const baseRules = Object.entries(extensionRules).map(([key]) => [delPrefix(key), "off"]); // Import baseRules options -const eslintRecommended = require(resolve(require.resolve("eslint"), "..", "..", "conf", "eslint-recommended.js")); -const baseRulesOptions = { ...eslintRecommended.rules, ...require(base).rules }; +const baseRulesOptions = { ...eslintJS.configs.recommended.rules, ...require(base).rules }; // Infer options from baseRulesOptions for the extensionRules const doneInferred = Object.entries(extensionRules)