From 5bd5ac2087de6b1c6de18c64ec40be3cbd0fbc3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roger=20Sch=C3=B6nb=C3=A4chler?= <42278642+schoero@users.noreply.github.com> Date: Wed, 20 Dec 2023 18:58:53 +0100 Subject: [PATCH] chore: simplify eslint typescript parser --- eslint.config.js | 66 ++++++++++------------------------------------- package-lock.json | 11 ++++---- package.json | 2 +- 3 files changed, 20 insertions(+), 59 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 20f21e38..b8a6ccf9 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -3,7 +3,6 @@ import eslintPluginSortExports from "eslint-plugin-sort-exports"; import eslintPluginVitest from "eslint-plugin-vitest"; import eslintPluginTypeScript from "@typescript-eslint/eslint-plugin"; -import eslintParserTypeScript from "@typescript-eslint/parser"; import sharedRules from "@schoero/configs/eslint"; @@ -46,19 +45,13 @@ export default [ { files: ["**/*.ts"], - languageOptions: { - parser: eslintParserTypeScript, - parserOptions: { - project: "./tsconfig.json" - } - }, plugins: { - "eslint-plugin-ts": eslintPluginTypeScript, + "eslint-plugin-typescript": eslintPluginTypeScript, "eslint-plugin-vitest": eslintPluginVitest }, rules: { - "eslint-plugin-ts/no-duplicate-type-constituents": "off", - "eslint-plugin-ts/no-restricted-imports": ["error", { + "eslint-plugin-typescript/no-duplicate-type-constituents": "off", + "eslint-plugin-typescript/no-restricted-imports": ["error", { patterns: [ ...indexImports, ...dependencyInjection @@ -69,9 +62,6 @@ export default [ }, { files: ["schemas/renderer/config.json"], - languageOptions: { - parser: eslintPluginJsonc - }, plugins: { "eslint-plugin-jsonc": eslintPluginJsonc }, @@ -96,17 +86,11 @@ export default [ files: [ "**/platform/**/browser.ts" ], - languageOptions: { - parser: eslintParserTypeScript, - parserOptions: { - project: "./tsconfig.json" - } - }, plugins: { - "eslint-plugin-ts": eslintPluginTypeScript + "eslint-plugin-typescript": eslintPluginTypeScript }, rules: { - "eslint-plugin-ts/no-restricted-imports": ["error", { + "eslint-plugin-typescript/no-restricted-imports": ["error", { patterns: [ { allowTypeImports: true, @@ -122,17 +106,11 @@ export default [ files: [ "**/platform/**/node.ts" ], - languageOptions: { - parser: eslintParserTypeScript, - parserOptions: { - project: "./tsconfig.json" - } - }, plugins: { - "eslint-plugin-ts": eslintPluginTypeScript + "eslint-plugin-typescript": eslintPluginTypeScript }, rules: { - "eslint-plugin-ts/no-restricted-imports": ["error", { + "eslint-plugin-typescript/no-restricted-imports": ["error", { patterns: [ { allowTypeImports: true, @@ -151,17 +129,11 @@ export default [ "**/*.test-d.ts", "**/tests/**/*.ts" ], - languageOptions: { - parser: eslintParserTypeScript, - parserOptions: { - project: "./tsconfig.json" - } - }, plugins: { - "eslint-plugin-ts": eslintPluginTypeScript + "eslint-plugin-typescript": eslintPluginTypeScript }, rules: { - "eslint-plugin-ts/no-restricted-imports": ["error", { + "eslint-plugin-typescript/no-restricted-imports": ["error", { patterns: [ { allowTypeImports: false, @@ -197,17 +169,11 @@ export default [ files: [ "**/renderer/markup/html/**/*.ts" ], - languageOptions: { - parser: eslintParserTypeScript, - parserOptions: { - project: "./tsconfig.json" - } - }, plugins: { - "eslint-plugin-ts": eslintPluginTypeScript + "eslint-plugin-typescript": eslintPluginTypeScript }, rules: { - "eslint-plugin-ts/no-restricted-imports": ["error", { + "eslint-plugin-typescript/no-restricted-imports": ["error", { patterns: [ ...dependencyInjection, ...indexImports, @@ -228,17 +194,11 @@ export default [ files: [ "**/renderer/markup/markdown/**/*.ts" ], - languageOptions: { - parser: eslintParserTypeScript, - parserOptions: { - project: "./tsconfig.json" - } - }, plugins: { - "eslint-plugin-ts": eslintPluginTypeScript + "eslint-plugin-typescript": eslintPluginTypeScript }, rules: { - "eslint-plugin-ts/no-restricted-imports": ["error", { + "eslint-plugin-typescript/no-restricted-imports": ["error", { patterns: [ ...dependencyInjection, ...indexImports, diff --git a/package-lock.json b/package-lock.json index a5141338..b55d6a7f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "unwritten": "lib/node/bin/index.js" }, "devDependencies": { - "@schoero/configs": "^0.0.0-beta.2", + "@schoero/configs": "^0.0.0-beta.5", "@types/minimatch": "^5.1.2", "@types/node": "^20.10.5", "changelogen": "^0.5.5", @@ -1591,9 +1591,9 @@ } }, "node_modules/@schoero/configs": { - "version": "0.0.0-beta.2", - "resolved": "https://registry.npmjs.org/@schoero/configs/-/configs-0.0.0-beta.2.tgz", - "integrity": "sha512-Hm3nOoXQO4+xr6nxyO6NGTwekhuqCdM670M2A8YdcJw1tWW5TVAY7PP3tqQObq8s/x+P28PZ9Zralr3CvhItJA==", + "version": "0.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@schoero/configs/-/configs-0.0.0-beta.5.tgz", + "integrity": "sha512-4ngbKQVdiWIoxD+C6VEKa8kxsWuToc5g2vXvt4YwW3/IjWhsZCV2jmIXJChXIB+JBfaePoGig9u0DtDPaINqPg==", "dev": true, "dependencies": { "@cspell/dict-bash": "^4.1.3", @@ -9965,7 +9965,8 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true + "dev": true, + "peer": true }, "node_modules/thenify": { "version": "3.3.1", diff --git a/package.json b/package.json index 0810921c..9fc684c0 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "typescript": "^5.3.3" }, "devDependencies": { - "@schoero/configs": "^0.0.0-beta.2", + "@schoero/configs": "^0.0.0-beta.5", "@types/minimatch": "^5.1.2", "@types/node": "^20.10.5", "changelogen": "^0.5.5",