-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split
eslint-plugin-import
rules into their own file
- Loading branch information
Showing
4 changed files
with
31 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module.exports = { | ||
rules: { | ||
// ensure default import coupled with default export | ||
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/default.md#when-not-to-use-it | ||
'import/default': 'error', | ||
// disallow non-import statements appearing before import statements | ||
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/imports-first.md | ||
'import/imports-first': [ 'error', '' ], | ||
// ensure named imports coupled with named exports | ||
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/named.md#when-not-to-use-it | ||
'import/named': 'error', | ||
// ensure new line after last import/require in group | ||
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/newline-after-import.md | ||
'import/newline-after-import': 'error', | ||
// disallow duplicate imports | ||
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md | ||
'import/no-duplicates': 'error', | ||
// Forbid the use of extraneous packages | ||
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md | ||
'import/no-extraneous-dependencies': [ 'error', { devDependencies: true }], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { rules } from '../../rules/import' | ||
import test from 'ava' | ||
|
||
test('only import rules', t => { | ||
Object.keys(rules).forEach(rule => { | ||
t.truthy(~rule.indexOf('import/')) | ||
}) | ||
}) |