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
Add filename ignore pattern for match-exports
rule
#14
Add filename ignore pattern for match-exports
rule
#14
Conversation
Does this work for you: https://github.com/mradionov/eslint-plugin-disable#file-paths? Then I will close and wait for eslint to natively support this functonality. |
@selaux I'm not sure how that plugin is supposed to help with the functionality I'm trying to get from this PR. AFAICT that plugin allows for disabling other plugins completely. This is not what I'm looking for though. |
Sorry, I thought you wanted to disable the whole plugin 🙁 . The thing is that this is basically a eslint inherent problem. You want to lint specific globbed files with specific rulesets, which eslint does not support yet as described in eslint/eslint#3611. I'm unsure on how to handle this to be honest as I don't want to introduce functionality that will be removed soon... |
No, I do not want to disable the whole plugin and I don't want to lint specific globbed files with some rules. Let's take an example from the tests in this PR, assuming the following file:
export default class Foo {
render() {
return <span>Test Class</span>;
}
} Applying this rule with the default config of However with the following config from this PR: |
Disabling this rule for specific globbed files would not help with the following case:
export default class Foo {
render() {
return <span>Test Class</span>;
}
} If I'd disable the |
@selaux Any more thoughts on merging this PR? |
@selaux ping |
Sorry for the late response, as eslint/eslint#3611 is still a ongoing discussion which does seem to take even more time, I will merge this for now and remove it again once the respective eslint feature is merged. |
@selaux awesome, thanks! |
This adds an additional option to the
match-exports
rule: a filename ignore pattern.If you prefer to use suffixes for your files (e.g.
Foo.react.js
for a React component file), you can use the following configuration: