Description
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.
Issue Description
I expect the following config to work for linting TS files, but, instead, eslint issues an error ("File ignored because no matching configuration was supplied") when linting a TS file. This is due to the fact that eslint requires a file to be included in at least one config object's files
field in order to be linted.
import tseslint from 'typescript-eslint';
export default tseslint.config(
tseslint.configs.base,
{
rules: {
'@typescript-eslint/no-unused-vars': 'error',
}
}
);
Right now, the description for the base config (link) says
A minimal ruleset that sets only the required parser and plugin options needed to run typescript-eslint.
Technically, that's true, but it doesn't set all the options required to run typescript-eslint on TS files. Surprisingly, this is only done in the rest of our configs by virtue of the fact that they include the eslint-recommended
config, which has files
set primarily in order to disable eslint core rules.
To see this, note that the following errors on TS files:
export default tseslint.config(
(() => {
const recommendedCopy = [...tseslint.configs.recommended];
recommendedCopy.splice(1, 1); // remove the eslint-recommended config
return recommendedCopy;
})(),
);
I propose - let's add files: ['**/*.ts', '**/*.tsx', '**/*.mts', '**/*.cts']
to the base
config so that it enables linting on TS files.
Reproduction Repository Link
https://github.com/kirkwaiblinger/tseslint-base-files-repro/
Repro Steps
- clone the repo
npm i
npm test
Versions
all version of eslint 9 and typescript-eslint 8 that I tried
Specifically, repros on latest:
"eslint": "9.28.0",
"typescript-eslint": "8.34.0"