Skip to content

Commit

Permalink
Replace sorting plugin with sort-keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuno Sousa committed Mar 3, 2017
1 parent ff56a24 commit 0ba2794
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 17 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"eslint-plugin-mocha": "^4.0.0",
"eslint-plugin-sort-class-members": "^1.0.1",
"eslint-plugin-sort-imports-es6": "^0.0.3",
"eslint-plugin-sorting": "^0.3.0",
"eslint-plugin-sql-template": "^2.0.0"
},
"devDependencies": {
Expand Down
8 changes: 5 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ module.exports = {
mocha: true,
node: true
},
extends: ['eslint:recommended', 'plugin:sort-class-members/recommended'],
extends: ['eslint:recommended'],
parser: 'babel-eslint',
plugins: ['mocha', 'sort-class-members', 'sort-imports-es6', 'sorting', 'sql-template'],
plugins: ['mocha', 'sort-class-members', 'sort-imports-es6', 'sql-template'],
root: true,
rules: {
'accessor-pairs': 'error',
Expand Down Expand Up @@ -156,7 +156,9 @@ module.exports = {
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single']
}],
'sorting/sort-object-props': 'error',
'sort-keys': ['error', 'asc', {
natural: true
}],
'space-before-blocks': 'error',
'space-before-function-paren': ['error', 'never'],
'space-in-parens': 'error',
Expand Down
9 changes: 3 additions & 6 deletions test/fixtures/correct.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,10 @@ noop(import1);
noop(import3);
noop(import4);

// `sorting/sort-object-props`.
const sortObjectProps1 = 'foo';
const sortObjectProps2 = 'bar';

// `sort-keys`.
const sortObjectProps = {
[`${sortObjectProps1}`]: 'foo',
[`${sortObjectProps2}`]: 'bar'
var9: 'bar',
var10: 'foo'
};

noop(sortObjectProps);
Expand Down
9 changes: 3 additions & 6 deletions test/fixtures/incorrect.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,10 @@ import { import2 } from 'import-2';
noop(import1);
noop(import2);

// `sorting/sort-object-props`.
const sortObjectProps1 = 'foo';
const sortObjectProps2 = 'bar';

// `sort-keys`.
const sortObjectProps = {
[`${sortObjectProps2}`]: 'bar',
[`${sortObjectProps1}`]: 'foo'
var10: 'foo',
var9: 'bar'
};

noop(sortObjectProps);
Expand Down
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ describe('eslint-config-seegno', () => {
'semi',
'semi-spacing',
'sort-imports-es6/sort-imports-es6',
'sorting/sort-object-props',
'sort-keys',
'space-before-blocks',
'space-before-function-paren',
'space-in-parens',
Expand Down

0 comments on commit 0ba2794

Please sign in to comment.