Skip to content

Commit 1a3a128

Browse files
TheCrueltySageljharb
authored andcommitted
[Fix] first: Add a way to disable absolute-first explicitly
1 parent efd6be1 commit 1a3a128

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

Diff for: CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
1010
- [`order`]: recognize ".." as a "parent" path ([#1658], thanks [@golopot])
1111
- [`no-duplicates`]: fix fixer on cases with default import ([#1666], thanks [@golopot])
1212
- [`no-unused-modules`]: Handle `export { default } from` syntax ([#1631], thanks [@richardxia])
13+
- [`first`]: Add a way to disable `absolute-first` explicitly ([#1664], thanks [@TheCrueltySage])
1314

1415
## [2.20.1] - 2020-02-01
1516
### Fixed
@@ -658,6 +659,7 @@ for info on changes for earlier releases.
658659
[`memo-parser`]: ./memo-parser/README.md
659660

660661
[#1666]: https://github.com/benmosher/eslint-plugin-import/pull/1666
662+
[#1664]: https://github.com/benmosher/eslint-plugin-import/pull/1664
661663
[#1658]: https://github.com/benmosher/eslint-plugin-import/pull/1658
662664
[#1651]: https://github.com/benmosher/eslint-plugin-import/pull/1651
663665
[#1635]: https://github.com/benmosher/eslint-plugin-import/issues/1635
@@ -1116,3 +1118,4 @@ for info on changes for earlier releases.
11161118
[@wschurman]: https://github.com/wschurman
11171119
[@fisker]: https://github.com/fisker
11181120
[@richardxia]: https://github.com/richardxia
1121+
[@TheCrueltySage]: https://github.com/TheCrueltySage

Diff for: src/rules/first.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = {
1010
schema: [
1111
{
1212
type: 'string',
13-
enum: ['absolute-first'],
13+
enum: ['absolute-first', 'disable-absolute-first'],
1414
},
1515
],
1616
},

Diff for: tests/src/rules/first.js

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ ruleTester.run('first', rule, {
1111
export { x, y }" })
1212
, test({ code: "import { x } from 'foo'; import { y } from './bar'" })
1313
, test({ code: "import { x } from './foo'; import { y } from 'bar'" })
14+
, test({ code: "import { x } from './foo'; import { y } from 'bar'"
15+
, options: ['disable-absolute-first'],
16+
})
1417
, test({ code: "'use directive';\
1518
import { x } from 'foo';" })
1619
,

0 commit comments

Comments
 (0)