Comments (5)
Hi! I'm so happy to hear this has been useful to you!
Regarding, external
and internal
, yes I dropped that because supporting it required attempting to resolve the imports and do things beyond looking at the actual import path string. It was a lot of work for minimal gain.
Regarding builtin
, it seems unnecessary since you can replicate the exact functionality with regular expression groups. I think it's more of a special case than a "standard" group. See the migration guide on the regular expression.
I'm absolutely open to adding it back in the future if enough people want it. However, being able to still support it with a RegEx makes me lean towards keeping it out. Plus this way you can keep the list up to date and manage it yourself (I don't have to update this rule to support the next version of node, etc).
from eslint-plugin-import-helpers.
I see...
Thanks for the reply. :)
from eslint-plugin-import-helpers.
@Tibfib hey, just want to add my words to this. I think keeping builtin
is important, otherwise we have to write absolutely the same regexp all the time.
from eslint-plugin-import-helpers.
@ezhlobo Apologies for the very late response on this.
All the time is pretty exaggerated I think. This ESLint rule isn't something you have to set up/edit every day... maybe every couple of months. In that case, copy and pasting that regexp doesn't seem to be a huge deal.
And, as I said earlier, this way requires less maintenance and updates to this rule.
Plus this way you can keep the list up to date and manage it yourself (I don't have to update this rule to support the next version of node, etc).
from eslint-plugin-import-helpers.
I ended up doing something like this:
const builtInModules = require('builtin-modules');
module.exports = {
rules: {
'import-helpers/order-imports': [
WARN,
{
groups: [
[`/^(${builtInModules.join('|')})$/`],
// Other groups... :)
],
alphabetize: { order: 'asc', ignoreCase: true },
newlinesBetween: 'never'
}
]
}
};
The module builtin-modules returns an array containing all Node.js built in modules.
from eslint-plugin-import-helpers.
Related Issues (20)
- Importing from parent behaving unexpectedly HOT 5
- Line count dependent `newlinesBetween` HOT 1
- It doesn't respect the order under group HOT 4
- Thank you!
- It's doens't works with Prettier HOT 5
- It doesnt work with (import '../styles/mystyle.scss'); HOT 3
- Support for ESLint v7? HOT 4
- Support for 'type' imports HOT 8
- Failing test (see link to code)
- Different groups for node_modules and internal modules HOT 2
- Relative import mistaken as modules HOT 1
- [QUESTION] - Why make this order 👇 ? HOT 3
- does it support "^7.12.1" ? HOT 2
- How can I set order for import './index.styl' HOT 4
- Support the latest version of ESLint (v8) HOT 1
- How to separate modules that are only `import` HOT 2
- Allow Functions Before Imports
- bug: node@14 requirement added as a minor HOT 2
- Type sorting does not work correctly
- Sort import with styles does not work
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslint-plugin-import-helpers.