Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to disable absolute-first option explicitly #1664

Merged
merged 1 commit into from Mar 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
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
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
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'"
ljharb marked this conversation as resolved.
Show resolved Hide resolved
, options: ['disable-absolute-first'],
})
, test({ code: "'use directive';\
import { x } from 'foo';" })
,
Expand Down