-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: Add --gitignore flag to read in .gitignore files #55
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this with a simple .eslintrc.json
example:
{
"rules": {
"no-unused-vars": 2
}
}
eslint.config.cjs
result:
const {
includeIgnoreFile,
} = require("@eslint/compat");
const gitignorePath = path.resolve(__dirname, ".gitignore");
module.exports = [includeIgnoreFile(gitignorePath), {
rules: {
"no-unused-vars": 2,
},
}];
eslint.config.mjs
result:
import { includeIgnoreFile } from "@eslint/compat";
const gitignorePath = path.resolve(__dirname, ".gitignore");
export default [includeIgnoreFile(gitignorePath), {
rules: {
"no-unused-vars": 2,
},
}];
In the cjs config, importing path
is missing. In the mjs config, importing path
and calculating __dirname
are missing.
Ah good catch! I'll fix that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Prerequisites checklist
What is the purpose of this pull request?
Updates
@eslint/migrate-config
to use the newgitignore
API added in #47What changes did you make? (Give an overview)
--gitignore
is passed as an argument, a code block is added to useincludeIgnoreFile()
.Related Issues
refs #44
Is there anything you'd like reviewers to focus on?