Description
Creating a new request for a closed issue, as suggested here.
What rule do you want to change? no-restricted-imports
Does this change cause the rule to produce more or fewer warnings? Neither
How will the change be implemented? (New option, new default behavior, etc.)? Allow a new format for an existing option
Please provide some example code that this change will affect:
// I can currently customize the error message for restricted path imports like this
import * as moment from 'moment';
// But I can't customize the error message for restricted pattern imports like this
import { Button } from '../../framework/buttons';
What I'd like to do in my ESLint config:
{
"rules": {
"no-restricted-imports": ["error", {
"paths": [{"name": "moment", "message": "Don't import moment"}],
"patterns": [{"name": "**/framework/*", "message": "Only import from the root of /framework"}]
}]
}
}
What does the rule currently do for this code? I can't customize the error message for the restricted pattern import
What will the rule do after it's changed? It should allow me to customize the error message for the restricted pattern import
Are you willing to submit a pull request to implement this change? Sure, though I'd like to get some clarity on how difficult the "large option schema change" mentioned here would be.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Milestone
Relationships
Development
- Update: no-restricted-imports custom message for patterns (fixes #11843)eslint/eslint
- [Snyk] Upgrade eslint from 7.26.0 to 7.32.0ManuelDevWeb/platziVideoReactRouterYRedux
- [Snyk] Upgrade eslint from 7.26.0 to 7.32.0ManuelDevWeb/platziVideoReact
- [Snyk] Upgrade eslint from 7.16.0 to 7.32.0Tanver-Hasan/nextjs-boilerplate
- [Snyk] Upgrade eslint from 7.16.0 to 7.32.0Tanver-Hasan/nextjs-boilerplate
- [Snyk] Upgrade eslint from 7.16.0 to 7.32.0Tanver-Hasan/nextjs-boilerplate
- [Snyk] Upgrade eslint from 7.16.0 to 7.32.0Tanver-Hasan/nextjs-boilerplate
- [Snyk] Upgrade eslint from 7.16.0 to 7.32.0Tanver-Hasan/nextjs-boilerplate
- [Snyk] Upgrade eslint from 7.26.0 to 7.32.0ManuelDevWeb/platziVideoReactRouterYRedux
- [Snyk] Upgrade eslint from 7.26.0 to 7.32.0ManuelDevWeb/platziVideoReact
Activity
eslint-deprecated commentedon Jul 18, 2019
Unfortunately, it looks like there wasn't enough interest from the team
or community to implement this change. While we wish we'd be able to
accommodate everyone's requests, we do need to prioritize. We've found
that issues failing to reach accepted status after 21 days tend to
never be accepted, and as such, we close those issues.
This doesn't mean the idea isn't interesting or useful, just that it's
not something the team can commit to.
Thanks for contributing to ESLint and we appreciate your understanding.
platinumazure commentedon Jul 18, 2019
Okay, we've had two team members review this and be in favor of the change but I think more folks can look at this.
I'll champion.
@eslint/eslint-team Can we review this please?
kaicataldo commentedon Sep 29, 2019
@platinumazure Are you still championing this?
martin-cech commentedon Feb 13, 2020
+1 for this to express interest :-)
51 remaining items