Skip to content

Commit

Permalink
Rename import-order to order, and param order to groups
Browse files Browse the repository at this point in the history
  • Loading branch information
jfmengels committed Apr 25, 2016
1 parent 03de513 commit 6c3fe44
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
- add [`no-extraneous-dependencies`] rule ([#241], thanks [@jfmengels])
- add [`extensions`] rule ([#250], thanks [@lo1tuma])
- add [`no-nodejs-modules`] rule ([#261], thanks [@jfmengels])
- add [`import-order`] rule ([#247], thanks [@jfmengels])
- add [`order`] rule ([#247], thanks [@jfmengels])
- consider `resolve.fallback` config option in the webpack resolver ([#254])

### Changed
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ This plugin intends to support linting of ES2015+ (ES6+) import/export syntax, a
* Report repeated import of the same module in multiple places ([`no-duplicates`])
* Report namespace imports ([`no-namespace`])
* Ensure consistent use of file extension within the import path ([`extensions`])
* Enforce a convention in module import order ([`import-order`])
* Enforce a convention in module import order ([`order`])

[`imports-first`]: ./docs/rules/imports-first.md
[`no-duplicates`]: ./docs/rules/no-duplicates.md
[`no-namespace`]: ./docs/rules/no-namespace.md
[`extensions`]: ./docs/rules/extensions.md
[`import-order`]: ./docs/rules/import-order.md
[`order`]: ./docs/rules/order.md


## Installation
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/import-order.md → docs/rules/order.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ The default value is `["builtin", "external", "internal", "parent", "sibling", "
You can set the options like this:

```js
"import-order/import-order": ["error", {"groups": ["index", "sibling", "parent", "internal", "external", "builtin"]}]
"import/order": ["error", {"groups": ["index", "sibling", "parent", "internal", "external", "builtin"]}]
```
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const rules = {
'imports-first': require('./rules/imports-first'),
'no-extraneous-dependencies': require('./rules/no-extraneous-dependencies'),
'no-nodejs-modules': require('./rules/no-nodejs-modules'),
'import-order': require('./rules/import-order'),
'order': require('./rules/order'),

// metadata-based
'no-deprecated': require('./rules/no-deprecated'),
Expand Down
File renamed without changes.
40 changes: 20 additions & 20 deletions tests/src/rules/import-order.js → tests/src/rules/order.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { test } from '../utils'
import { RuleTester } from 'eslint'

const ruleTester = new RuleTester()
, rule = require('rules/import-order')
, rule = require('rules/order')

ruleTester.run('import-order', rule, {
ruleTester.run('order', rule, {
valid: [
// Default order using require
test({
Expand Down Expand Up @@ -168,7 +168,7 @@ ruleTester.run('import-order', rule, {
var fs = require('fs');
`,
errors: [{
ruleId: 'import-order',
ruleId: 'order',
message: '`fs` import should occur before import of `async`',
}],
}),
Expand All @@ -179,7 +179,7 @@ ruleTester.run('import-order', rule, {
import fs from 'fs';
`,
errors: [{
ruleId: 'import-order',
ruleId: 'order',
message: '`fs` import should occur before import of `async`',
}],
}),
Expand All @@ -190,7 +190,7 @@ ruleTester.run('import-order', rule, {
import fs from 'fs';
`,
errors: [{
ruleId: 'import-order',
ruleId: 'order',
message: '`fs` import should occur before import of `async`',
}],
}),
Expand All @@ -201,7 +201,7 @@ ruleTester.run('import-order', rule, {
var async = require('async');
`,
errors: [{
ruleId: 'import-order',
ruleId: 'order',
message: '`async` import should occur before import of `../parent`',
}],
}),
Expand All @@ -212,7 +212,7 @@ ruleTester.run('import-order', rule, {
var parent = require('../parent');
`,
errors: [{
ruleId: 'import-order',
ruleId: 'order',
message: '`../parent` import should occur before import of `./sibling`',
}],
}),
Expand All @@ -223,7 +223,7 @@ ruleTester.run('import-order', rule, {
var sibling = require('./sibling');
`,
errors: [{
ruleId: 'import-order',
ruleId: 'order',
message: '`./sibling` import should occur before import of `./`',
}],
}),
Expand All @@ -235,10 +235,10 @@ ruleTester.run('import-order', rule, {
var fs = require('fs');
`,
errors: [{
ruleId: 'import-order',
ruleId: 'order',
message: '`async` import should occur before import of `./sibling`',
}, {
ruleId: 'import-order',
ruleId: 'order',
message: '`fs` import should occur before import of `./sibling`',
}],
}),
Expand All @@ -253,7 +253,7 @@ ruleTester.run('import-order', rule, {
var bar = require('bar');
`,
errors: [{
ruleId: 'import-order',
ruleId: 'order',
message: '`./` import should occur after import of `bar`',
}],
}),
Expand All @@ -265,7 +265,7 @@ ruleTester.run('import-order', rule, {
`,
options: [{groups: ['index', 'sibling', 'parent', 'external', 'builtin']}],
errors: [{
ruleId: 'import-order',
ruleId: 'order',
message: '`./` import should occur before import of `fs`',
}],
}),
Expand All @@ -276,7 +276,7 @@ ruleTester.run('import-order', rule, {
var fs = require('fs');
`,
errors: [{
ruleId: 'import-order',
ruleId: 'order',
message: '`fs` import should occur before import of `./foo`',
}],
}),
Expand All @@ -287,7 +287,7 @@ ruleTester.run('import-order', rule, {
var fs = require('fs');
`,
errors: [{
ruleId: 'import-order',
ruleId: 'order',
message: '`fs` import should occur before import of `./foo`',
}],
}),
Expand All @@ -304,7 +304,7 @@ ruleTester.run('import-order', rule, {
['sibling', 'parent', 'external'],
]}],
errors: [{
ruleId: 'import-order',
ruleId: 'order',
message: '`path` import should occur before import of `./foo`',
}],
}),
Expand All @@ -320,7 +320,7 @@ ruleTester.run('import-order', rule, {
// missing 'builtin'
]}],
errors: [{
ruleId: 'import-order',
ruleId: 'order',
message: '`async` import should occur before import of `path`',
}],
}),
Expand All @@ -336,7 +336,7 @@ ruleTester.run('import-order', rule, {
['sibling', 'parent', 'UNKNOWN', 'internal'],
]}],
errors: [{
ruleId: 'import-order',
ruleId: 'order',
message: 'Incorrect configuration of the rule: Unknown type `"UNKNOWN"`',
}],
}),
Expand All @@ -351,7 +351,7 @@ ruleTester.run('import-order', rule, {
['sibling', 'parent', ['builtin'], 'internal'],
]}],
errors: [{
ruleId: 'import-order',
ruleId: 'order',
message: 'Incorrect configuration of the rule: Unknown type `["builtin"]`',
}],
}),
Expand All @@ -366,7 +366,7 @@ ruleTester.run('import-order', rule, {
['sibling', 'parent', 2, 'internal'],
]}],
errors: [{
ruleId: 'import-order',
ruleId: 'order',
message: 'Incorrect configuration of the rule: Unknown type `2`',
}],
}),
Expand All @@ -381,7 +381,7 @@ ruleTester.run('import-order', rule, {
['sibling', 'parent', 'parent', 'internal'],
]}],
errors: [{
ruleId: 'import-order',
ruleId: 'order',
message: 'Incorrect configuration of the rule: `parent` is duplicated',
}],
}),
Expand Down

0 comments on commit 6c3fe44

Please sign in to comment.