eslint: Bug: FlatArrayConfig options cannot be overriden
Environment
Node version: v16.20.0 npm version: v8.19.4 Local ESLint version: Not found Global ESLint version: Not found Operating System: linux 6.5.7-arch1-1
What parser are you using?
Default (Espree)
What did you do?
Configuration
import * as tsParseForESLint from "@typescript-eslint/parser";
const config = [
{
languageOptions: {
parser: tsParseForESLint,
},
files: ["**/*.ts", "**/*.js", "**/*.tsx", "**/*.jsx"],
},
]
const linter = new Linter({
configType: "flat",
});
const report = linter.verifyAndFix(code, config, filename);
What did you expect to happen?
I want to be able to override FlatConfigArray options
What actually happened?
There is no option to forward options to FlatConfigArray
Link to Minimal Reproducible Example
Participation
- I am willing to submit a pull request for this issue.
Additional comments
No response
About this issue
- Original URL
- State: closed
- Created 8 months ago
- Comments: 18 (13 by maintainers)
Commits related to this issue
- fix: Empty basePath should not be treated as cwd In Node.js, `path.relative("")` always resolves to `process.cwd()`, which causes problems when people use the `Linter` API in ESLint where the `basePa... — committed to humanwhocodes/config-array by nzakas 8 months ago
- fix: Ensure cwd doesn't leak into config resolution Fixes #17669 — committed to eslint/eslint by nzakas 8 months ago
Yes, I also think we can close this now.
Starting from ESLint v8.54.0,
cwd
passed to theLinter
constructor is used as config’sbasePath
. So, for example, this works: