From 151dd411a404b0113c68c4d3f6d8a614fe10fcea Mon Sep 17 00:00:00 2001 From: Konstantinos Paparas Date: Wed, 24 Jan 2024 12:49:36 +0100 Subject: [PATCH 1/3] fix: update vue-eslint-parser to 9.4.2 --- package.json | 14 ++-- pnpm-lock.yaml | 198 +++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 181 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index 27d06a9..48c8cea 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@rotki/eslint-plugin", "version": "0.2.0", - "packageManager": "pnpm@8.14.1", + "packageManager": "pnpm@8.14.3", "type": "module", "license": "AGPL-3.0", "bugs": { @@ -47,24 +47,24 @@ "eslint": "^8.0.0 || ^9.0.0" }, "dependencies": { - "@typescript-eslint/utils": "6.19.0", + "@typescript-eslint/utils": "6.19.1", "debug": "4.3.4", "eslint-compat-utils": "0.4.1", "jsonc-eslint-parser": "2.4.0", "scule": "1.2.0", - "vue-eslint-parser": "9.4.1", + "vue-eslint-parser": "9.4.2", "yaml-eslint-parser": "1.2.2" }, "devDependencies": { "@commitlint/cli": "18.5.0", "@commitlint/config-conventional": "18.5.0", - "@rotki/eslint-config": "2.3.0", + "@rotki/eslint-config": "2.4.1", "@types/debug": "4.1.12", "@types/eslint": "8.56.2", "@types/node": "20", - "@typescript-eslint/eslint-plugin": "6.19.0", - "@typescript-eslint/parser": "6.19.0", - "@typescript-eslint/rule-tester": "6.19.0", + "@typescript-eslint/eslint-plugin": "6.19.1", + "@typescript-eslint/parser": "6.19.1", + "@typescript-eslint/rule-tester": "6.19.1", "bumpp": "9.3.0", "debug": "4.3.4", "eslint": "8.56.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fa9977f..a8345d7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,8 +6,8 @@ settings: dependencies: '@typescript-eslint/utils': - specifier: 6.19.0 - version: 6.19.0(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.19.1 + version: 6.19.1(eslint@8.56.0)(typescript@5.3.3) debug: specifier: 4.3.4 version: 4.3.4 @@ -21,8 +21,8 @@ dependencies: specifier: 1.2.0 version: 1.2.0 vue-eslint-parser: - specifier: 9.4.1 - version: 9.4.1(eslint@8.56.0) + specifier: 9.4.2 + version: 9.4.2(eslint@8.56.0) yaml-eslint-parser: specifier: 1.2.2 version: 1.2.2 @@ -35,8 +35,8 @@ devDependencies: specifier: 18.5.0 version: 18.5.0 '@rotki/eslint-config': - specifier: 2.3.0 - version: 2.3.0(@types/eslint@8.56.2)(@vue/compiler-sfc@3.4.15)(eslint@8.56.0)(typescript@5.3.3)(vitest@1.2.1) + specifier: 2.4.1 + version: 2.4.1(@types/eslint@8.56.2)(@vue/compiler-sfc@3.4.15)(eslint@8.56.0)(typescript@5.3.3)(vitest@1.2.1) '@types/debug': specifier: 4.1.12 version: 4.1.12 @@ -47,14 +47,14 @@ devDependencies: specifier: '20' version: 20.11.4 '@typescript-eslint/eslint-plugin': - specifier: 6.19.0 - version: 6.19.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.19.1 + version: 6.19.1(@typescript-eslint/parser@6.19.1)(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/parser': - specifier: 6.19.0 - version: 6.19.0(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.19.1 + version: 6.19.1(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/rule-tester': - specifier: 6.19.0 - version: 6.19.0(@eslint/eslintrc@2.1.4)(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.19.1 + version: 6.19.1(@eslint/eslintrc@2.1.4)(eslint@8.56.0)(typescript@5.3.3) bumpp: specifier: 9.3.0 version: 9.3.0 @@ -1237,12 +1237,12 @@ packages: dev: true optional: true - /@rotki/eslint-config@2.3.0(@types/eslint@8.56.2)(@vue/compiler-sfc@3.4.15)(eslint@8.56.0)(typescript@5.3.3)(vitest@1.2.1): - resolution: {integrity: sha512-cqGXa2ptNeO2NduEBX1tMR8ixdPNJN06iDK6u23TcvmPkKIEdZFnnkZyT+5GzcsN9ecDvADN6uIAdZ+OFGAwew==} + /@rotki/eslint-config@2.4.1(@types/eslint@8.56.2)(@vue/compiler-sfc@3.4.15)(eslint@8.56.0)(typescript@5.3.3)(vitest@1.2.1): + resolution: {integrity: sha512-Hxbnupq1Q9IEFuTMkoRvolQR7da4mXBV0EmEOksz9CyihBcuO4u+LHNYqvSTIrWaMHzWDnFvcv+4ZrUC0ZmlQw==} engines: {node: '>=16 <19', pnpm: '>=8 <9'} peerDependencies: '@intlify/eslint-plugin-vue-i18n': ^2.0.0 - '@rotki/eslint-plugin': '>=0.0.3' + '@rotki/eslint-plugin': '>=0.2.0' eslint: '>=8.56.0' eslint-plugin-cypress: '>=2.15.0' eslint-plugin-storybook: ^0.6.15 @@ -1340,7 +1340,7 @@ packages: peerDependencies: eslint: '*' dependencies: - '@typescript-eslint/utils': 6.19.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/utils': 6.19.1(eslint@8.56.0)(typescript@5.3.3) eslint: 8.56.0 transitivePeerDependencies: - supports-color @@ -1354,7 +1354,7 @@ packages: eslint: '>=8.40.0' dependencies: '@stylistic/eslint-plugin-js': 1.5.4(eslint@8.56.0) - '@typescript-eslint/utils': 6.19.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/utils': 6.19.1(eslint@8.56.0)(typescript@5.3.3) eslint: 8.56.0 transitivePeerDependencies: - supports-color @@ -1501,6 +1501,35 @@ packages: - supports-color dev: true + /@typescript-eslint/eslint-plugin@6.19.1(@typescript-eslint/parser@6.19.1)(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-roQScUGFruWod9CEyoV5KlCYrubC/fvG8/1zXuT0WTcxX87GnMMmnksMwSg99lo1xiKrBzw2icsJPMAw1OtKxg==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha + eslint: ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@eslint-community/regexpp': 4.8.0 + '@typescript-eslint/parser': 6.19.1(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/scope-manager': 6.19.1 + '@typescript-eslint/type-utils': 6.19.1(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/utils': 6.19.1(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 6.19.1 + debug: 4.3.4 + eslint: 8.56.0 + graphemer: 1.4.0 + ignore: 5.2.4 + natural-compare: 1.4.0 + semver: 7.5.4 + ts-api-utils: 1.0.3(typescript@5.3.3) + typescript: 5.3.3 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/parser@6.19.0(eslint@8.56.0)(typescript@5.3.3): resolution: {integrity: sha512-1DyBLG5SH7PYCd00QlroiW60YJ4rWMuUGa/JBV0iZuqi4l4IK3twKPq5ZkEebmGqRjXWVgsUzfd3+nZveewgow==} engines: {node: ^16.0.0 || >=18.0.0} @@ -1522,16 +1551,37 @@ packages: - supports-color dev: true - /@typescript-eslint/rule-tester@6.19.0(@eslint/eslintrc@2.1.4)(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-4/nUf0k1LYIxdEoNZBIvk3k4iXecV03mzKbHZQcB2TeyFuPUOnJGDQI8rrfbP7jbE2a6K7h5zU0ai0uG1ytO6g==} + /@typescript-eslint/parser@6.19.1(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-WEfX22ziAh6pRE9jnbkkLGp/4RhTpffr2ZK5bJ18M8mIfA8A+k97U9ZyaXCEJRlmMHh7R9MJZWXp/r73DzINVQ==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/scope-manager': 6.19.1 + '@typescript-eslint/types': 6.19.1 + '@typescript-eslint/typescript-estree': 6.19.1(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 6.19.1 + debug: 4.3.4 + eslint: 8.56.0 + typescript: 5.3.3 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/rule-tester@6.19.1(@eslint/eslintrc@2.1.4)(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-1qvOSO9kjtjP66UimQ06tnZC/XVhb2s5hVi2Cn33efnzM3m+j8rwcGJJ9xwKacUWe7U50iHrY9xrakmF7SPWbg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: '@eslint/eslintrc': '>=2' eslint: '>=8' dependencies: '@eslint/eslintrc': 2.1.4 - '@typescript-eslint/typescript-estree': 6.19.0(typescript@5.3.3) - '@typescript-eslint/utils': 6.19.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/typescript-estree': 6.19.1(typescript@5.3.3) + '@typescript-eslint/utils': 6.19.1(eslint@8.56.0)(typescript@5.3.3) ajv: 6.12.6 eslint: 8.56.0 lodash.merge: 4.6.2 @@ -1547,6 +1597,14 @@ packages: dependencies: '@typescript-eslint/types': 6.19.0 '@typescript-eslint/visitor-keys': 6.19.0 + dev: true + + /@typescript-eslint/scope-manager@6.19.1: + resolution: {integrity: sha512-4CdXYjKf6/6aKNMSly/BP4iCSOpvMmqtDzRtqFyyAae3z5kkqEjKndR5vDHL8rSuMIIWP8u4Mw4VxLyxZW6D5w==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.19.1 + '@typescript-eslint/visitor-keys': 6.19.1 /@typescript-eslint/type-utils@6.19.0(eslint@8.56.0)(typescript@5.3.3): resolution: {integrity: sha512-mcvS6WSWbjiSxKCwBcXtOM5pRkPQ6kcDds/juxcy/727IQr3xMEcwr/YLHW2A2+Fp5ql6khjbKBzOyjuPqGi/w==} @@ -1568,9 +1626,34 @@ packages: - supports-color dev: true + /@typescript-eslint/type-utils@6.19.1(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-0vdyld3ecfxJuddDjACUvlAeYNrHP/pDeQk2pWBR2ESeEzQhg52DF53AbI9QCBkYE23lgkhLCZNkHn2hEXXYIg==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/typescript-estree': 6.19.1(typescript@5.3.3) + '@typescript-eslint/utils': 6.19.1(eslint@8.56.0)(typescript@5.3.3) + debug: 4.3.4 + eslint: 8.56.0 + ts-api-utils: 1.0.3(typescript@5.3.3) + typescript: 5.3.3 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/types@6.19.0: resolution: {integrity: sha512-lFviGV/vYhOy3m8BJ/nAKoAyNhInTdXpftonhWle66XHAtT1ouBlkjL496b5H5hb8dWXHwtypTqgtb/DEa+j5A==} engines: {node: ^16.0.0 || >=18.0.0} + dev: true + + /@typescript-eslint/types@6.19.1: + resolution: {integrity: sha512-6+bk6FEtBhvfYvpHsDgAL3uo4BfvnTnoge5LrrCj2eJN8g3IJdLTD4B/jK3Q6vo4Ql/Hoip9I8aB6fF+6RfDqg==} + engines: {node: ^16.0.0 || >=18.0.0} /@typescript-eslint/typescript-estree@6.19.0(typescript@5.3.3): resolution: {integrity: sha512-o/zefXIbbLBZ8YJ51NlkSAt2BamrK6XOmuxSR3hynMIzzyMY33KuJ9vuMdFSXW+H0tVvdF9qBPTHA91HDb4BIQ==} @@ -1592,6 +1675,28 @@ packages: typescript: 5.3.3 transitivePeerDependencies: - supports-color + dev: true + + /@typescript-eslint/typescript-estree@6.19.1(typescript@5.3.3): + resolution: {integrity: sha512-aFdAxuhzBFRWhy+H20nYu19+Km+gFfwNO4TEqyszkMcgBDYQjmPJ61erHxuT2ESJXhlhrO7I5EFIlZ+qGR8oVA==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 6.19.1 + '@typescript-eslint/visitor-keys': 6.19.1 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.3 + semver: 7.5.4 + ts-api-utils: 1.0.3(typescript@5.3.3) + typescript: 5.3.3 + transitivePeerDependencies: + - supports-color /@typescript-eslint/utils@6.19.0(eslint@8.56.0)(typescript@5.3.3): resolution: {integrity: sha512-QR41YXySiuN++/dC9UArYOg4X86OAYP83OWTewpVx5ct1IZhjjgTLocj7QNxGhWoTqknsgpl7L+hGygCO+sdYw==} @@ -1610,6 +1715,25 @@ packages: transitivePeerDependencies: - supports-color - typescript + dev: true + + /@typescript-eslint/utils@6.19.1(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-JvjfEZuP5WoMqwh9SPAPDSHSg9FBHHGhjPugSRxu5jMfjvBpq5/sGTD+9M9aQ5sh6iJ8AY/Kk/oUYVEMAPwi7w==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) + '@types/json-schema': 7.0.12 + '@types/semver': 7.5.1 + '@typescript-eslint/scope-manager': 6.19.1 + '@typescript-eslint/types': 6.19.1 + '@typescript-eslint/typescript-estree': 6.19.1(typescript@5.3.3) + eslint: 8.56.0 + semver: 7.5.4 + transitivePeerDependencies: + - supports-color + - typescript /@typescript-eslint/visitor-keys@6.19.0: resolution: {integrity: sha512-hZaUCORLgubBvtGpp1JEFEazcuEdfxta9j4iUwdSAr7mEsYYAp3EAUyCZk3VEEqGj6W+AV4uWyrDGtrlawAsgQ==} @@ -1617,6 +1741,14 @@ packages: dependencies: '@typescript-eslint/types': 6.19.0 eslint-visitor-keys: 3.4.3 + dev: true + + /@typescript-eslint/visitor-keys@6.19.1: + resolution: {integrity: sha512-gkdtIO+xSO/SmI0W68DBg4u1KElmIUo3vXzgHyGPs6cxgB0sa3TlptRAAE0hUY1hM6FcDKEv7aIwiTGm76cXfQ==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.19.1 + eslint-visitor-keys: 3.4.3 /@ungap/structured-clone@1.2.0: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} @@ -2929,7 +3061,7 @@ packages: vue-eslint-parser: optional: true dependencies: - '@typescript-eslint/utils': 6.19.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/utils': 6.19.1(eslint@8.56.0)(typescript@5.3.3) eslint: 8.56.0 minimatch: 9.0.3 natural-compare-lite: 1.4.0 @@ -3017,7 +3149,7 @@ packages: optional: true dependencies: '@typescript-eslint/eslint-plugin': 6.19.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/utils': 6.19.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/utils': 6.19.1(eslint@8.56.0)(typescript@5.3.3) eslint: 8.56.0 vitest: 1.2.1(@types/node@20.11.4) transitivePeerDependencies: @@ -3037,7 +3169,7 @@ packages: nth-check: 2.1.1 postcss-selector-parser: 6.0.15 semver: 7.5.4 - vue-eslint-parser: 9.4.1(eslint@8.56.0) + vue-eslint-parser: 9.4.2(eslint@8.56.0) xml-name-validator: 4.0.0 transitivePeerDependencies: - supports-color @@ -5773,6 +5905,24 @@ packages: semver: 7.5.4 transitivePeerDependencies: - supports-color + dev: true + + /vue-eslint-parser@9.4.2(eslint@8.56.0): + resolution: {integrity: sha512-Ry9oiGmCAK91HrKMtCrKFWmSFWvYkpGglCeFAIqDdr9zdXmMMpJOmUJS7WWsW7fX81h6mwHmUZCQQ1E0PkSwYQ==} + engines: {node: ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: '>=6.0.0' + dependencies: + debug: 4.3.4 + eslint: 8.56.0 + eslint-scope: 7.2.2 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 + esquery: 1.5.0 + lodash: 4.17.21 + semver: 7.5.4 + transitivePeerDependencies: + - supports-color /vue@3.4.15(typescript@5.3.3): resolution: {integrity: sha512-jC0GH4KkWLWJOEQjOpkqU1bQsBwf4R1rsFtw5GQJbjHVKWDzO6P0nWWBTmjp1xSemAioDFj1jdaK1qa3DnMQoQ==} From 44e3731bbec79d402b9267c5afa507e0c432ef53 Mon Sep 17 00:00:00 2001 From: Konstantinos Paparas Date: Wed, 24 Jan 2024 12:54:23 +0100 Subject: [PATCH 2/3] fix: allow no-legacy-library-import to replace sub imports --- src/rules/no-legacy-library-import.ts | 6 ++++-- tests/rules/no-legacy-library-import.ts | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/rules/no-legacy-library-import.ts b/src/rules/no-legacy-library-import.ts index 91926ec..345dcc0 100644 --- a/src/rules/no-legacy-library-import.ts +++ b/src/rules/no-legacy-library-import.ts @@ -13,12 +13,14 @@ export default createEslintRule({ create(context) { return { ImportDeclaration(node) { - if (node.source.value !== legacyLibrary) + if (!node.source.value.startsWith(legacyLibrary)) return; + const replacement = node.source.value.replace(legacyLibrary, newLibrary); + context.report({ fix(fixer) { - return fixer.replaceText(node.source, `'${newLibrary}'`); + return fixer.replaceText(node.source, `'${replacement}'`); }, messageId: 'replacedWith', node: node.source, diff --git a/tests/rules/no-legacy-library-import.ts b/tests/rules/no-legacy-library-import.ts index 3fb76e4..8e37632 100644 --- a/tests/rules/no-legacy-library-import.ts +++ b/tests/rules/no-legacy-library-import.ts @@ -62,5 +62,20 @@ tester.run('no-legacy-library-import', rule as never, { `, errors: [{ messageId: 'replacedWith' }], }, + + { + filename: 'test.ts', + code: ` + import { DataTableHeader } from '@rotki/ui-library-compat/style.css'; + + const test = 1; + `, + output: ` + import { DataTableHeader } from '@rotki/ui-library/style.css'; + + const test = 1; + `, + errors: [{ messageId: 'replacedWith' }], + }, ], }); From 73df239c034e966bf36b5ab5832340add01d4103 Mon Sep 17 00:00:00 2001 From: Konstantinos Paparas Date: Wed, 24 Jan 2024 12:54:39 +0100 Subject: [PATCH 3/3] chore: release v0.2.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 48c8cea..e5c2694 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rotki/eslint-plugin", - "version": "0.2.0", + "version": "0.2.1", "packageManager": "pnpm@8.14.3", "type": "module", "license": "AGPL-3.0",