We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hey,
I use aliases provided by webpack: https://webpack.js.org/configuration/resolve/#resolvealias
there is such a structure:
folder1/folder2/../folder6/a.js folder1/utils/ajax.js
In a.js there is such a code:
a.js
import { notifyDevelopers } from '../../../../../utils/ajax'
using alias this code can be simplified to:
import { notifyDevelopers } from 'utils/ajax'
Can I create a rule that forbids making a path that is larger than ../../ ?
../../
I found similar issues: #776 #471
But #471 doesn't solve my problem
The text was updated successfully, but these errors were encountered:
This already exists; see https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-useless-path-segments.md.
This won't (and shouldn't) take aliases into account, however, you'll have to build a custom rule for that.
Sorry, something went wrong.
Thx, found a way to create a rule:
{ "rules": { "no-restricted-imports": [ "error", { "patterns": ["../../../*"] } ] } }
That will only catch 3+ levels, but that does work.
No branches or pull requests
Hey,
I use aliases provided by webpack:
https://webpack.js.org/configuration/resolve/#resolvealias
there is such a structure:
In
a.js
there is such a code:using alias this code can be simplified to:
Can I create a rule that forbids making a path that is larger than
../../
?I found similar issues:
#776
#471
But #471 doesn't solve my problem
The text was updated successfully, but these errors were encountered: