Skip to content

Commit 5d81aff

Browse files
committed
fix #7
1 parent b50857e commit 5d81aff

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

es6.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ module.exports = {
1818
'rest-spread-spacing': 'error',
1919
'yield-star-spacing': ['error', 'after'],
2020

21+
'object-shorthand': ['error', 'always', { 'avoidQuotes': true }],
22+
2123
'quotes': ['error', 'backtick'] // https://github.com/htmlacademy/eslint-config-htmlacademy/issues/4
2224
}
2325
};

test/es6/object-shorthand.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const x = 5;
2+
const y = 5;
3+
const z = 6;
4+
5+
// properties
6+
const foo = {x, y, z};
7+
8+
// methods
9+
const bar = {
10+
a() {
11+
},
12+
b() {
13+
},
14+
[z]() {
15+
return z;
16+
},
17+
[`zxv`]() {
18+
return `vla`;
19+
}
20+
};
21+
22+
throw new Error(foo, bar);

0 commit comments

Comments
 (0)