Skip to content
This repository was archived by the owner on Jun 8, 2019. It is now read-only.

Commit c83352a

Browse files
committed
Add ESLint and opt-in to object spread syntax
1 parent 56254b3 commit c83352a

File tree

4 files changed

+46
-6
lines changed

4 files changed

+46
-6
lines changed

.babelrc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
{
2-
"optional": ["runtime"]
2+
"stage": 4,
3+
"optional": [
4+
"runtime",
5+
"es7.objectRestSpread"
6+
]
37
}

.eslintrc

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"parser": "babel-eslint",
3+
"extends": "eslint:recommended",
4+
"env": {
5+
"es6": true,
6+
"node": true
7+
},
8+
"ecmaFeatures": {
9+
"modules": true
10+
},
11+
"rules": {
12+
"no-console": 0,
13+
14+
"arrow-parens": [2, "always"],
15+
"comma-dangle": [2, "always-multiline"],
16+
"eqeqeq": 2,
17+
"indent": [2, 4],
18+
"linebreak-style": [2, "unix"],
19+
"prefer-arrow-callback": 2,
20+
"quotes": [2, "single"],
21+
"semi": [2, "always"],
22+
"strict": [2, "never"],
23+
"yoda": [2, "never"],
24+
25+
"no-alert": 2,
26+
"no-const-assign": 2,
27+
"no-else-return": 2,
28+
"no-this-before-super": 2,
29+
"no-unexpected-multiline": 2,
30+
"no-var": 2,
31+
"no-warning-comments": 1
32+
}
33+
}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@
1414
"mkdirp": "^0.5.1"
1515
},
1616
"devDependencies": {
17-
"babel": "^5.8.21"
17+
"babel": "^5.8.21",
18+
"babel-eslint": "^4.1.2",
19+
"eslint": "^1.4.3"
1820
},
1921
"scripts": {
22+
"lint": "eslint src/",
2023
"build": "babel-plugin build",
2124
"push": "babel-plugin publish",
2225
"test": "babel-plugin test",

src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const FUNCTION_NAMES = [
2020
const IMPORTED_NAMES = new Set([...COMPONENT_NAMES, ...FUNCTION_NAMES]);
2121
const DESCRIPTOR_PROPS = new Set(['id', 'description', 'defaultMessage']);
2222

23-
export default function ({Plugin, types: t}) {
23+
export default function ({Plugin}) {
2424
function getModuleSourceName(options) {
2525
const reactIntlOptions = options.extra['react-intl'] || {};
2626
return reactIntlOptions.moduleSourceName || 'react-intl';
@@ -165,7 +165,7 @@ export default function ({Plugin, types: t}) {
165165
mkdirpSync(p.dirname(messagesFilename));
166166
writeFileSync(messagesFilename, messagesFile);
167167
}
168-
}
168+
},
169169
},
170170

171171
JSXOpeningElement(node, parent, scope, file) {
@@ -211,7 +211,7 @@ export default function ({Plugin, types: t}) {
211211
let descriptor = getMessageDescriptor(new Map(properties));
212212
storeMessage(descriptor, node, file);
213213
}
214-
}
215-
}
214+
},
215+
},
216216
});
217217
}

0 commit comments

Comments
 (0)