From ed2d6a80bd101c1fb5b5353b2bf58cfe7f353470 Mon Sep 17 00:00:00 2001 From: Joseph Mearman Date: Sun, 6 Sep 2026 11:13:49 +0100 Subject: [PATCH] chore: dogfood defineConfig() now that exadevConfig() satisfies it The plain-array export in this file existed specifically to route around the cross-package type gap #4 just fixed (exadevConfig() was typed against typescript-eslint's own Config, not @eslint/core's ConfigObject). Now that exadevConfig() satisfies defineConfig() directly, use it here too -- this file is the first real, live proof that consumers get real config validation and extends support from defineConfig() rather than routing around it. --- eslint.config.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/eslint.config.ts b/eslint.config.ts index 19ff896..c5ec771 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -1,8 +1,9 @@ +import { defineConfig } from 'eslint/config'; import js from '@eslint/js'; import { exadevConfig } from './src/index'; -// A plain flat-config array, not wrapped in `tseslint.config(...)` (now `@deprecated` in favour of ESLint core's own `defineConfig()`, per typescript-eslint's own doc comment) nor in `defineConfig(...)` (whose parameter type is `@eslint/core`'s `ConfigObject`, which declares an explicit string index signature that `@typescript-eslint/utils`'s `TSESLint.FlatConfig.Config` -- the type this config's own elements carry -- does not; TypeScript refuses that assignment outright, and this codebase bans the `as` cast that would paper over it). ESLint's flat-config loader only ever required a plain array (or object, or array-of-arrays) as the default export -- both helpers exist purely for `extends`-flattening and stricter typing neither of which this already-flat array needs -- so this sidesteps the deprecated call and the cross-package type gap at once, rather than working around either. -export default [ +// defineConfig() over a plain array or the now-@deprecated tseslint.config(): exadevConfig()'s return type is PublicConfigArray (see src/config-types.ts), typed against @eslint/core's own ConfigObject specifically so it satisfies defineConfig()'s parameter type directly -- this file is the first real proof of that, dogfooding the fix on the same repo that ships it. +export default defineConfig( { ignores: ['dist', 'coverage', 'node_modules', '.turbo'], }, @@ -31,4 +32,4 @@ export default [ files: ['src/consumer-compatibility.ts'], rules: { '@typescript-eslint/no-deprecated': 'off' }, }, -]; +);