I've recently switched to using the new ESLint flat style with @stylistic/eslint-plugin
, but I'm encountering an issue where it fails to detect TypeScript files. When I attempt to run ESLint directly against a ts file, I receive the following error:
warning File ignored because no matching configuration was supplied
Below are the contents of my config files:
eslint.config.mjs
import stylistic from "@stylistic/eslint-plugin";
export default [
{
plugins : {
"@stylistic" : stylistic,
},
rules : {
"@stylistic/comma-dangle" : ["error", "always-multiline"],
"@stylistic/eol-last" : ["error", "always"],
"@stylistic/indent" : [
"error",
"tab",
{
"SwitchCase" : 1,
},
],
"@stylistic/key-spacing" : ["error", { "beforeColon" : true }],
"@stylistic/linebreak-style" : [
"error",
"unix",
],
"@stylistic/quotes" : [
"error",
"double",
{
"allowTemplateLiterals" : true,
"avoidEscape" : true,
},
],
"@stylistic/semi" : [
"error",
"always",
],
"@stylistic/type-annotation-spacing" : [
"error",
{
"before" : true,
},
],
},
},
];
tsconfig.json
{
"compilerOptions": {
"target": "es2016",
"module": "commonjs",
"noEmit": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
},
"exclude": [
"node_modules"
]
}
dependencies
"devDependencies": {
"@eslint/js": "^9.8.0",
"@stylistic/eslint-plugin": "^2.6.0",
"appium": "^2.11.2",
"eslint": "^9.8.0",
"ts-node": "^10.9.2",
"typescript": "^5.5.4",
"typescript-eslint": "^8.0.0",
"webdriverio": "^8.39.1"
}