Skip to content

Commit

Permalink
feat: add object-shorthand as fixable error
Browse files Browse the repository at this point in the history
this was in our rules before the airbnb purge
  • Loading branch information
dbushong committed Dec 11, 2018
1 parent f44a644 commit e7a0496
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
11 changes: 11 additions & 0 deletions examples/eslint/node4/object-shorthand.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
'use strict';

function foo() {}

const someVal = 42;
const okFor = 88;

const thisIs = { okFor: someVal };
const thisIsNot = { okFor: okFor };

foo(thisIs, thisIsNot);
11 changes: 11 additions & 0 deletions examples/eslint/node4/object-shorthand.out.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
'use strict';

function foo() {}

const someVal = 42;
const okFor = 88;

const thisIs = { okFor: someVal };
const thisIsNot = { okFor };

foo(thisIs, thisIsNot);
3 changes: 3 additions & 0 deletions lib/rules/opinions.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,7 @@ module.exports = {

// See: https://eslint.org/docs/rules/no-extra-semi
'no-extra-semi': 'error',

// See: https://eslint.org/docs/rules/object-shorthand
'object-shorthand': 'error',
};

0 comments on commit e7a0496

Please sign in to comment.