-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can the eslint flat config compatibility support be restricted to a specific directory? #206
Comments
@ceisele-r |
Each config object of the flat config can have it's own ...
,
...compat.config({
extends: ["plugin:cypress/recommended"],
parserOptions: {
ecmaVersion: 2020,
sourceType: "module",
project: "./cypress/tsconfig.json",
},
files: ["cypress/**/*.js"],
}),
...
|
@MikeMcC399 thanks, I'm on eslint @codeflorist that's what I already tried before, but unfortunately, there is no
So that's unfortunately no solution. |
In the https://github.com/cypress-io/cypress-example-kitchensink repo there is a script defined as
so that only lints Would that be a workaround for you? |
@MikeMcC399 unfortunately not. This used to work by having multiple {
...
{
files: ["src/whatever/**/*"],
rules: {
"@typescript-eslint/promise-function-async": "error",
},
},
...
} to enforce specific rules/plugin configurations for specific directories/files. |
Would you take a look at eslint/eslintrc#148 to see if this explains it? You're welcome to take the question over to the ESLint experts in their Discord channel https://eslint.org/chat as well since it concerns how to use their @eslint/eslintrc library. I will also see in parallel if I can get this working. |
@MikeMcC399 ah, thank you! This eslint/eslintrc#148 (comment) seems to do the trick. So if anyone else encounters this, what seems to be working is the following:
Thanks again for the tip! |
It's great that solved your issue. 🎉 This should probably go into the documentation as it will be a common problem for those upgrading and used to having a specific |
I'm going to close this issue now as v3.3.0 removes the reliance on the Flat mode compatibility utility. |
How can the new flat mode compatibility support be restricted to a specific directory?
E.g. until now I have the following directory structure:
Now using the flat config compatibility support, I would add the contents of the
cypress/.eslintrc.cjs
to theeslint.config.js
in the root as follows:How can I restrict that this config should only be applied to files within the
cypress
directory?Originally posted by @ceisele-r in #146 (comment)
The text was updated successfully, but these errors were encountered: