diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..4a7ea3036a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000000..a376be0619 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,26 @@ +{ + "env": { + "es6": true, + "node": true, + "browser": true + }, + "extends": "eslint:recommended", + "installedESLint": true, + "parserOptions": { + "ecmaFeatures": { + "experimentalObjectRestSpread": true, + "jsx": true + }, + "sourceType": "module" + }, + "plugins": [ + "react" + ], + "rules": { + "react/jsx-uses-vars": 1, + "react/jsx-uses-react": 1, + "react/react-in-jsx-scope": 1, + "no-console": 0, + "no-case-declarations": 0 + } +} diff --git a/package.json b/package.json index 8de782f4e9..9261c51f3b 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,8 @@ "babel-polyfill": "^6.7.2", "babel-runtime": "~5.8.25", "css-loader": "~0.18.0", + "eslint": "^3.8.1", + "eslint-plugin-react": "^6.4.1", "file-loader": "^0.8.5", "history": "^2.1.2", "http-server": "~0.8.5", @@ -77,6 +79,7 @@ "pig": "http-server ./PIG -p 4041 -s & webpack --config webpack/PIG.config.js --progress --watch", "build": "NODE_ENV=production webpack --config webpack/production.config.js && webpack --config webpack/PIG.config.js", "test": "NODE_PATH=./node_modules jest", + "lint": "eslint . --ignore-path .gitignore --ignore-pattern *.test.js", "generate": "node scripts/generate.js", "prepublish": "webpack --config webpack/publish.config.js", "start": "node ./Parse-Dashboard/index.js"