From 88d7dacaf2efce5f1aa5cfb73086b7fed875118e Mon Sep 17 00:00:00 2001 From: Aric Camarata Date: Sun, 31 May 2026 08:47:15 -0400 Subject: [PATCH] ci: fix eslint parser devDeps and typed-linting config --- eslint.config.js | 20 +++++++++++++++++--- package.json | 3 +++ pnpm-lock.yaml | 9 +++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 6930316..be4fb48 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -2,15 +2,29 @@ import tsParser from '@typescript-eslint/parser'; import tsPlugin from '@typescript-eslint/eslint-plugin'; import eslintConfigPrettier from 'eslint-config-prettier'; import { typescript } from '@acamarata/eslint-config'; +import { fileURLToPath } from 'url'; +import { dirname } from 'path'; + +const __dirname = dirname(fileURLToPath(import.meta.url)); export default [ { + files: ['src/**/*.ts'], plugins: { '@typescript-eslint': tsPlugin }, - languageOptions: { parser: tsParser }, + languageOptions: { + parser: tsParser, + parserOptions: { + project: './tsconfig.json', + tsconfigRootDir: __dirname, + }, + }, + }, + { + files: ['src/**/*.ts'], + ...typescript.reduce((acc, cfg) => ({ ...acc, ...cfg }), {}), }, - ...typescript, eslintConfigPrettier, { - ignores: ['dist/', 'node_modules/', '*.cjs'], + ignores: ['dist/', 'node_modules/', '*.cjs', '*.mjs', 'tsup.config.ts', 'eslint.config.js'], }, ]; diff --git a/package.json b/package.json index b4ab262..6fdf638 100644 --- a/package.json +++ b/package.json @@ -75,8 +75,11 @@ "@acamarata/tsconfig": "^0.1.0", "@eslint/js": "^9.27.0", "@types/node": "^22.15.3", + "@typescript-eslint/eslint-plugin": "^8.56.1", + "@typescript-eslint/parser": "^8.56.1", "c8": "^11.0.0", "eslint": "^9.27.0", + "eslint-config-prettier": "^10.1.8", "prettier": "^3.5.3", "tsup": "^8.4.0", "typedoc": "^0.28.19", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f183ec4..ef4fb02 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,12 +23,21 @@ importers: '@types/node': specifier: ^22.15.3 version: 22.19.15 + '@typescript-eslint/eslint-plugin': + specifier: ^8.56.1 + version: 8.56.1(@typescript-eslint/parser@8.56.1(eslint@9.39.4)(typescript@5.9.3))(eslint@9.39.4)(typescript@5.9.3) + '@typescript-eslint/parser': + specifier: ^8.56.1 + version: 8.56.1(eslint@9.39.4)(typescript@5.9.3) c8: specifier: ^11.0.0 version: 11.0.0 eslint: specifier: ^9.27.0 version: 9.39.4 + eslint-config-prettier: + specifier: ^10.1.8 + version: 10.1.8(eslint@9.39.4) prettier: specifier: ^3.5.3 version: 3.8.1