typescript-eslint: Bug: Type error when using ConfigWithExtends
Before You File a Bug Report Please Confirm You Have Done The Following…
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I have searched for related issues and found none that matched my issue.
- I have read the FAQ and my problem is not listed.
Relevant Package
typescript-eslint
Playground Link
No response
Repro Code
I get a TypeScript type error scripts-eslint/eslint.config.mjs:7:2 - error TS2353: Object literal may only specify known properties, and 'ignores' does not exist in type 'ConfigWithExtends' when using the ConfigWithExtends type in the following example.
// @ts-check
import tseslint from 'typescript-eslint';
/** @type {import('typescript-eslint').ConfigWithExtends} */
const config_base = {
ignores: [
'temp/**/*',
],
};
/** @type {import('typescript-eslint').ConfigWithExtends[]} */
const configs = [config_base];
const flat_config = tseslint.config(...configs);
export {flat_config};
ESLint Config
No response
tsconfig
No response
Expected Result
n.a.
Actual Result
n.a.
Additional Info
Versions
| package | version |
|---|---|
typescript-eslint |
7.3.1 |
TypeScript |
5.4.3 |
ESLint |
8.57.0 |
node |
20.11.0 |
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 19 (11 by maintainers)
The more I investigate the more I’m CONVINCED that npm is doing the wrong thing here. But that’s ultimately neither here nor there because that’s just how it works.
#8738 should fix this by explicitly declaring the dep so that npm at least nests
/utilswithintypescript-eslintso types will work.