-
Notifications
You must be signed in to change notification settings - Fork 377
Ignore rule if file is dirty #2171
Copy link
Copy link
Open
Labels
feature-requestRequest for new features or functionalityRequest for new features or functionalityhelp wantedIssues identified as good community contribution opportunitiesIssues identified as good community contribution opportunities
Milestone
Metadata
Metadata
Assignees
Labels
feature-requestRequest for new features or functionalityRequest for new features or functionalityhelp wantedIssues identified as good community contribution opportunitiesIssues identified as good community contribution opportunities
Type
Fields
Give feedbackNo fields configured for issues without a type.
I'm using
eslint-plugin-prettierfor CI (e.g. pull requests) to check if new code is formatted according to how Prettier formats.When editing code however, the plugin's accompanying
prettier/prettierrule is annoying because the point of auto-formatters is that you can just write code without formatting yourself and the code will be auto-formatted on save or similar.Luckily this extension has an option to turn off rules like this:
This works great, but what if I'm using something like codemods, codegen tools, or anything else that modifies or writes code without ESLint / Prettier integration? I'd need to remember to run
prettier . --writeor ESLint CLI - or find out the code isn't formatted when the code runs through CI.Instead, if the
.vscode/settings.jsonrule customization only applied to non-dirty files, issues of incorrect formatting (or other ESLint rules) would be visible much sooner but still won't be annoying while editing the file (when the file is dirty / unsaved).I'm proposing a new option for
eslint.rules.customizationsentries likeunsavedOnly?: boolean.