Commit 1f0feb48 authored by Andrew Hrdy's avatar Andrew Hrdy
Browse files

Added react linting. Switched to babel parser for ES experimental features.

parent 77f06e2f
Pipeline #1924 passed with stage
in 1 minute and 45 seconds
{ {
"parser": "babel-eslint",
"env": { "env": {
"browser": true, "browser": true,
"commonjs": true, "commonjs": true,
...@@ -11,18 +12,22 @@ ...@@ -11,18 +12,22 @@
}, },
"sourceType": "module" "sourceType": "module"
}, },
"extends": "eslint:recommended", "plugins": [
"react"
],
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"rules": { "rules": {
//Overridden from eslint:reccomended //Overridden from eslint:reccomended
"no-console": "off", "no-console": "off",
//Possible Errors //Possible Errors
"for-direction": "warn",
"no-template-curly-in-string": "warn", "no-template-curly-in-string": "warn",
//Best Practices //Best Practices
"block-scoped-var": "error", "block-scoped-var": "error",
"no-empty-function": "error", "no-empty-function": "error",
"no-implicit-globals": "error", "no-implicit-globals": "error",
"no-invalid-this": "error",
"no-multi-spaces": "error", "no-multi-spaces": "error",
"no-self-compare": "warn", "no-self-compare": "warn",
//Variables //Variables
...@@ -38,21 +43,20 @@ ...@@ -38,21 +43,20 @@
"comma-spacing": "warn", "comma-spacing": "warn",
"computed-property-spacing": "error", "computed-property-spacing": "error",
"func-call-spacing": "error", "func-call-spacing": "error",
"implicit-arrow-linebreak": "warn",
"indent": "error", "indent": "error",
"jsx-quotes": "error", "jsx-quotes": "error",
"key-spacing": "warn", "key-spacing": "warn",
"keyword-spacing": "warn", "keyword-spacing": "warn",
"lines-between-class-members": "warn",
"multiline-comment-style": "warn",
"no-lonely-if": "warn", "no-lonely-if": "warn",
"no-multiple-empty-lines": "warn", "no-multiple-empty-lines": "warn",
"no-tabs": "error", "no-tabs": "error",
"no-trailing-spaces": "error", "no-trailing-spaces": "error",
"no-whitespace-before-property": "error", "no-whitespace-before-property": "error",
"object-curly-newline": [ "object-curly-newline": [
"warn", "warn", {
"always" "ObjectExpression": {"minProperties": 1},
"ObjectPattern": "never"
}
], ],
"object-curly-spacing": "warn", "object-curly-spacing": "warn",
"object-property-newline": "warn", "object-property-newline": "warn",
...@@ -74,7 +78,6 @@ ...@@ -74,7 +78,6 @@
"after": true "after": true
} }
], ],
"semi-style": "error",
"space-before-blocks": "error", "space-before-blocks": "error",
"space-before-function-paren": [ "space-before-function-paren": [
"error", "error",
...@@ -89,7 +92,6 @@ ...@@ -89,7 +92,6 @@
"nonwords": false "nonwords": false
} }
], ],
"switch-colon-spacing": "error",
//ECMAScript 6 //ECMAScript 6
"arrow-parens": "warn", "arrow-parens": "warn",
"arrow-spacing": [ "arrow-spacing": [
...@@ -109,6 +111,16 @@ ...@@ -109,6 +111,16 @@
"prefer-spread": "error", "prefer-spread": "error",
"prefer-template": "warn", "prefer-template": "warn",
"rest-spread-spacing": "error", "rest-spread-spacing": "error",
"template-curly-spacing": "error" "template-curly-spacing": "error",
//Overriden from plugin:react/reccommended
"react/no-unescaped-entities": "off",
//plugin:react
"react/boolean-prop-naming": "warn",
"react/no-danger": "error",
"react/no-typos": "warn",
"react/jsx-indent": "error",
"react/jsx-pascal-case": "error",
"react/jsx-space-before-closing": "warn",
"react/jsx-wrap-multilines": "warn"
} }
} }
\ No newline at end of file
...@@ -3464,14 +3464,26 @@ ...@@ -3464,14 +3464,26 @@
} }
}, },
"eslint-plugin-react": { "eslint-plugin-react": {
"version": "7.1.0", "version": "7.5.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.1.0.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.5.1.tgz",
"integrity": "sha1-J3cKzzn1/UnNCvQIPOWBBOs5DUw=", "integrity": "sha512-YGSjB9Qu6QbVTroUZi66pYky3DfoIPLdHQ/wmrBGyBRnwxQsBXAov9j2rpXt/55i8nyMv6IRWJv2s4d4YnduzQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"doctrine": "2.0.2", "doctrine": "2.0.2",
"has": "1.0.1", "has": "1.0.1",
"jsx-ast-utils": "1.4.1" "jsx-ast-utils": "2.0.1",
"prop-types": "15.6.0"
},
"dependencies": {
"jsx-ast-utils": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz",
"integrity": "sha1-6AGxs5mF4g//yHtA43SAgOLcrH8=",
"dev": true,
"requires": {
"array-includes": "3.0.3"
}
}
} }
}, },
"espree": { "espree": {
...@@ -4408,7 +4420,8 @@ ...@@ -4408,7 +4420,8 @@
}, },
"jsbn": { "jsbn": {
"version": "0.1.1", "version": "0.1.1",
"bundled": true "bundled": true,
"optional": true
}, },
"json-schema": { "json-schema": {
"version": "0.2.3", "version": "0.2.3",
...@@ -10284,6 +10297,17 @@ ...@@ -10284,6 +10297,17 @@
"regenerator-runtime": "0.10.5" "regenerator-runtime": "0.10.5"
} }
}, },
"eslint-plugin-react": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.1.0.tgz",
"integrity": "sha1-J3cKzzn1/UnNCvQIPOWBBOs5DUw=",
"dev": true,
"requires": {
"doctrine": "2.0.2",
"has": "1.0.1",
"jsx-ast-utils": "1.4.1"
}
},
"fsevents": { "fsevents": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.2.tgz", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.2.tgz",
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
"redux-thunk": "^2.2.0" "redux-thunk": "^2.2.0"
}, },
"devDependencies": { "devDependencies": {
"eslint-plugin-react": "^7.5.1",
"react-scripts": "1.0.10" "react-scripts": "1.0.10"
}, },
"proxy": "http://localhost:3001", "proxy": "http://localhost:3001",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment