Skip to content

Commit 008092b

Browse files
committed
Add eslint and editorconfig for linting and consistency
1 parent 681dc27 commit 008092b

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
@@ -47,6 +47,8 @@
4747
"babel-polyfill": "^6.7.2",
4848
"babel-runtime": "~5.8.25",
4949
"css-loader": "~0.18.0",
50+
"eslint": "^3.8.1",
51+
"eslint-plugin-react": "^6.4.1",
5052
"file-loader": "^0.8.5",
5153
"history": "^2.1.2",
5254
"http-server": "~0.8.5",
@@ -77,6 +79,7 @@
7779
"pig": "http-server ./PIG -p 4041 -s & webpack --config webpack/PIG.config.js --progress --watch",
7880
"build": "NODE_ENV=production webpack --config webpack/production.config.js && webpack --config webpack/PIG.config.js",
7981
"test": "NODE_PATH=./node_modules jest",
82+
"lint": "eslint . --ignore-path .gitignore --ignore-pattern *.test.js",
8083
"generate": "node scripts/generate.js",
8184
"prepublish": "webpack --config webpack/publish.config.js",
8285
"start": "node ./Parse-Dashboard/index.js"

0 commit comments

Comments
 (0)