From e4ae667f95f5c7112f2cd595786c49e590877fe5 Mon Sep 17 00:00:00 2001 From: Nick Alteen Date: Fri, 31 Oct 2025 11:19:46 -0400 Subject: [PATCH] Switch to ESLint projectService --- eslint.config.mjs | 20 ++++++++++++-------- jest.config.js | 2 +- package-lock.json | 17 +---------------- tsconfig.base.json | 23 ----------------------- tsconfig.eslint.json | 17 ----------------- tsconfig.json | 19 +++++++++++++++++-- 6 files changed, 31 insertions(+), 67 deletions(-) delete mode 100644 tsconfig.base.json delete mode 100644 tsconfig.eslint.json diff --git a/eslint.config.mjs b/eslint.config.mjs index 8008780..fc31967 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -9,13 +9,9 @@ import _import from 'eslint-plugin-import' import jest from 'eslint-plugin-jest' import prettier from 'eslint-plugin-prettier' import globals from 'globals' -import path from 'node:path' -import { fileURLToPath } from 'node:url' -const __filename = fileURLToPath(import.meta.url) -const __dirname = path.dirname(__filename) const compat = new FlatCompat({ - baseDirectory: __dirname, + baseDirectory: import.meta.dirname, recommendedConfig: js.configs.recommended, allConfig: js.configs.all }) @@ -52,8 +48,16 @@ export default [ sourceType: 'module', parserOptions: { - project: ['tsconfig.eslint.json'], - tsconfigRootDir: __dirname + projectService: { + allowDefaultProject: [ + '__fixtures__/*.ts', + '__tests__/*.ts', + 'eslint.config.mjs', + 'jest.config.js', + 'rollup.config.ts' + ] + }, + tsconfigRootDir: import.meta.dirname } }, @@ -61,7 +65,7 @@ export default [ 'import/resolver': { typescript: { alwaysTryTypes: true, - project: 'tsconfig.eslint.json' + project: 'tsconfig.json' } } }, diff --git a/jest.config.js b/jest.config.js index 0d9c650..625bbce 100644 --- a/jest.config.js +++ b/jest.config.js @@ -31,7 +31,7 @@ export default { '^.+\\.ts$': [ 'ts-jest', { - tsconfig: 'tsconfig.eslint.json', + tsconfig: 'tsconfig.json', useESM: true } ] diff --git a/package-lock.json b/package-lock.json index d840079..d0e8775 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,8 +9,7 @@ "version": "0.0.0", "license": "MIT", "dependencies": { - "@actions/core": "^1.11.1", - "@rollup/rollup-linux-x64-gnu": "*" + "@actions/core": "^1.11.1" }, "devDependencies": { "@eslint/compat": "^1.4.0", @@ -13146,20 +13145,6 @@ "fsevents": "~2.3.2" } }, - "node_modules/rollup/node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.52.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.52.4.tgz", - "integrity": "sha512-Wi6AXf0k0L7E2gteNsNHUs7UMwCIhsCTs6+tqQ5GPwVRWMaflqGec4Sd8n6+FNFDw9vGcReqk2KzBDhCa1DLYg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", diff --git a/tsconfig.base.json b/tsconfig.base.json deleted file mode 100644 index 588b02e..0000000 --- a/tsconfig.base.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig", - "compilerOptions": { - "allowSyntheticDefaultImports": true, - "declaration": false, - "declarationMap": false, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "lib": ["ES2022"], - "module": "NodeNext", - "moduleResolution": "NodeNext", - "newLine": "lf", - "noImplicitAny": true, - "noUnusedLocals": true, - "noUnusedParameters": false, - "pretty": true, - "resolveJsonModule": true, - "strict": true, - "strictNullChecks": true, - "target": "ES2022" - } -} diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json deleted file mode 100644 index 7a00c40..0000000 --- a/tsconfig.eslint.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig", - "extends": "./tsconfig.base.json", - "compilerOptions": { - "allowJs": true, - "noEmit": true - }, - "exclude": ["dist", "node_modules"], - "include": [ - "__fixtures__", - "__tests__", - "src", - "eslint.config.mjs", - "jest.config.js", - "rollup.config.ts" - ] -} diff --git a/tsconfig.json b/tsconfig.json index b65a760..8191311 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,10 +1,25 @@ { "$schema": "https://json.schemastore.org/tsconfig", - "extends": "./tsconfig.base.json", "compilerOptions": { + "allowSyntheticDefaultImports": true, + "declaration": false, + "declarationMap": false, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "lib": ["ES2022"], "module": "NodeNext", "moduleResolution": "NodeNext", - "outDir": "./dist" + "newLine": "lf", + "noImplicitAny": true, + "noUnusedLocals": true, + "noUnusedParameters": false, + "outDir": "./dist", + "pretty": true, + "resolveJsonModule": true, + "strict": true, + "strictNullChecks": true, + "target": "ES2022" }, "exclude": ["__fixtures__", "__tests__", "coverage", "dist", "node_modules"], "include": ["src"]