Closed zebateira closed 4 years ago
Merging #79 into master will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## master #79 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 23 23
Lines 30 30
=====================================
Hits 30 30
Impacted Files | Coverage Δ | |
---|---|---|
rules/es6.js | 100% <ø> (ø) |
:arrow_up: |
addons/jest.js | 100% <ø> (ø) |
:arrow_up: |
addons/es-modules.js | 100% <ø> (ø) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 9f5375d...7b5457b. Read the comment docs.
@acostalima forgot to add the BREAKING CHANGE
keywords to the commits to mark this for breaking change. I can just add a commit to mark it as such, or force push with a commit message updated.
What do you think?
@zebateira maybe it's better to rebase everything into a single commit and add the breaking part there.
One thing to note. I think we are configuring the rules just for es-modules
, when in fact we should do for node
as well. Perhaps it would be better to do it in the base config? Or replicate this into the node
addon?
One thing to note. I think we are configuring the rules just for es-modules, when in fact we should do for node as well. Perhaps it would be better to do it in the base config? Or replicate this into the node addon?
That's a good point. These rules should be applied in commonjs scripts as well.
Scoped require statements no longer show the warning to use the import statement (since it's not possible on a scope). Is this still something we want to flag as an issue? (see test fix here)
That's completely fine.
I tried to make newlines mandatory between each import group, but it didn't work, so we'll have to make a PR to the plugin to fix this (rule
import/order - newlines-between
) - either that or I'm doing something wrong.
@zebateira the following is not working?
'import/order': [1, { 'newlines-between': 'always' }]
@acostalima
@zebateira the following is not working?
'import/order': [1, { 'newlines-between': 'always' }]
There's a weird issue: it reports that there should be a newline after every single import statement. Possibly it might work if we use eslint-plugin-import-helpers
.
@zebateira @satazor should we create a RFC to discuss this?
yah sounds good @acostalima @satazor 👍
closing this: will create an RFC for discussion
@zebateira Thanks!
To add advanced sorting validation to the import section, I propose using
eslint-import-plugin
:import/order
: sort order will be the default group sort"builtin", "external", "parent", "sibling", "index"
, then alphabeticalExtra:
import/first
: do not allow import statements to be defined outside the import sectionimport/no-commonjs
: replaceprefer-import
withimport/no-commonjs
,import/no-amd
andimport/no-dynamic-require
.There are a couple of caveats with the proposed solution:
prop-types
being imported beforereact
, so we "lose" the "importance" sorting we had (see test fix here)Observations:
import/order - newlines-between
) - either that or I'm doing something wrong.caseInsensitive
in theimport/order
rule but it hasn't been released. When it is, would be nice to turn it on as well.