Add "unassigned" to importType for order rule
See original GitHub issueI would like to group and order unassigned imports. This specific use case is for importing Polymer 2 html elements with polymer-webpack-loader.
import { Component } from '@angular/core';
import 'bower_components/paper-button/paper-button.html';
import { value } from '../parent';
import { other } from './sibling';
The proposed .eslintrc
to achieve the above style would be
"import/order": [
"error",
{
"groups": ["builtin", "external", "unassigned", ["parent", "sibling", "index"]],
"newlines-between": "always"
}
]
At the moment unassigned imports are completely ignored.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Add "unassigned" to importType for order rule #970 - GitHub
I would like to group and order unassigned imports. This specific use case is for importing Polymer 2 html elements with polymer-webpack-loader.
Read more >eslint-plugin-import | Yarn - Package Manager
This plugin intends to support linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import names. All...
Read more >NetSuite Applications Suite - Oracle Help Center
Any line labeled Unassigned in this report includes transactions with items that do not have an associated deferred expense account.
Read more >client/node_modules/eslint-plugin-import/CHANGELOG.md
2.10.0 - 2018-03-29. Added. Autofixer for order rule (#908, thanks @tihonove); Add no-cycle rule: reports import ...
Read more >Paycom University Employee Management Guide
Each document added will display in the Documents tab. If needed, click and drag to rearrange the order the documents will display. If...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ljharb As I described above sometimes it may be important. Preserving the necessary order for the particular project may be highly necessary. To not make breaking changes I propose to add an option to
pathGroups
so consumers may enable processing of side affect imports for certain groups. E.g.:This seems reasonable; altho I’d call them “side-effecting” or something instead of just “unassigned”.
A use case that isn’t deprecated (ie, that doesn’t involve bower) would be shimming/polyfilling.