Skip to content

Commit f8bbf56

Browse files
JeremyPleaseflovilmart
authored andcommitted
Add eslint and editorconfig for linting and codestyle (#568)
* Add eslint and editorconfig for linting and consistency * Add ironically missing final newline to .editorconfig
1 parent 18db9ed commit f8bbf56

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.eslintrc.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"env": {
3+
"es6": true,
4+
"node": true,
5+
"browser": true
6+
},
7+
"extends": "eslint:recommended",
8+
"installedESLint": true,
9+
"parserOptions": {
10+
"ecmaFeatures": {
11+
"experimentalObjectRestSpread": true,
12+
"jsx": true
13+
},
14+
"sourceType": "module"
15+
},
16+
"plugins": [
17+
"react"
18+
],
19+
"rules": {
20+
"react/jsx-uses-vars": 1,
21+
"react/jsx-uses-react": 1,
22+
"react/react-in-jsx-scope": 1,
23+
"no-console": 0,
24+
"no-case-declarations": 0
25+
}
26+
}

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252
"babel-polyfill": "^6.7.2",
5353
"babel-runtime": "~5.8.25",
5454
"css-loader": "~0.18.0",
55+
"eslint": "^3.8.1",
56+
"eslint-plugin-react": "^6.4.1",
5557
"file-loader": "^0.8.5",
5658
"history": "^2.1.2",
5759
"http-server": "~0.8.5",
@@ -82,6 +84,7 @@
8284
"pig": "http-server ./PIG -p 4041 -s & webpack --config webpack/PIG.config.js --progress --watch",
8385
"build": "NODE_ENV=production webpack --config webpack/production.config.js && webpack --config webpack/PIG.config.js",
8486
"test": "NODE_PATH=./node_modules jest",
87+
"lint": "eslint . --ignore-path .gitignore --ignore-pattern *.test.js",
8588
"generate": "node scripts/generate.js",
8689
"prepublish": "webpack --config webpack/publish.config.js",
8790
"start": "node ./Parse-Dashboard/index.js"

0 commit comments

Comments
 (0)