Skip to content

Commit

Permalink
[Fix] first: Add a way to disable absolute-first explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCrueltySage authored and ljharb committed Feb 19, 2020
1 parent efd6be1 commit 1a3a128
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
- [`order`]: recognize ".." as a "parent" path ([#1658], thanks [@golopot])
- [`no-duplicates`]: fix fixer on cases with default import ([#1666], thanks [@golopot])
- [`no-unused-modules`]: Handle `export { default } from` syntax ([#1631], thanks [@richardxia])
- [`first`]: Add a way to disable `absolute-first` explicitly ([#1664], thanks [@TheCrueltySage])

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

[#1666]: https://github.com/benmosher/eslint-plugin-import/pull/1666
[#1664]: https://github.com/benmosher/eslint-plugin-import/pull/1664
[#1658]: https://github.com/benmosher/eslint-plugin-import/pull/1658
[#1651]: https://github.com/benmosher/eslint-plugin-import/pull/1651
[#1635]: https://github.com/benmosher/eslint-plugin-import/issues/1635
Expand Down Expand Up @@ -1116,3 +1118,4 @@ for info on changes for earlier releases.
[@wschurman]: https://github.com/wschurman
[@fisker]: https://github.com/fisker
[@richardxia]: https://github.com/richardxia
[@TheCrueltySage]: https://github.com/TheCrueltySage
2 changes: 1 addition & 1 deletion src/rules/first.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
schema: [
{
type: 'string',
enum: ['absolute-first'],
enum: ['absolute-first', 'disable-absolute-first'],
},
],
},
Expand Down
3 changes: 3 additions & 0 deletions tests/src/rules/first.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ ruleTester.run('first', rule, {
export { x, y }" })
, test({ code: "import { x } from 'foo'; import { y } from './bar'" })
, test({ code: "import { x } from './foo'; import { y } from 'bar'" })
, test({ code: "import { x } from './foo'; import { y } from 'bar'"
, options: ['disable-absolute-first'],
})
, test({ code: "'use directive';\
import { x } from 'foo';" })
,
Expand Down

0 comments on commit 1a3a128

Please sign in to comment.