diff --git a/.eslintrc.json b/.eslintrc.json index 03cfd7dee..898512434 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,7 +1,7 @@ { "parser": "babel-eslint", "extends": "eslint:recommended", - "plugins": ["react"], + "plugins": ["react", "prettier"], "env": { "browser": true, "node": true, @@ -22,63 +22,18 @@ "extends": [ "plugin:import/errors", "plugin:import/warnings", - "eslint:recommended" + "eslint:recommended", + "plugin:react/recommended", + "prettier" ], "globals": { "sleep": 1 }, "rules": { - "react/jsx-no-bind": [2, { "ignoreRefs": true }], - "react/jsx-no-duplicate-props": 2, - "react/jsx-closing-bracket-location": [2, "after-props"], - "react/self-closing-comp": 2, - "react/prefer-es6-class": 2, - "react/no-string-refs": 2, - "react/require-render-return": 2, - "react/no-find-dom-node": 2, - "react/no-is-mounted": 2, - "react/jsx-no-comment-textnodes": 2, - "react/jsx-curly-spacing": 2, - "react/jsx-no-undef": 2, - "react/jsx-uses-react": 2, - "react/jsx-uses-vars": 2, - "no-empty": 0, - "no-console": 0, - "no-empty-pattern": 0, - "no-cond-assign": 1, - "semi": 2, - "camelcase": 0, - "comma-style": 2, - "comma-dangle": [2, "never"], - "indent": [2, 2, { "SwitchCase": 1 }], - "no-mixed-spaces-and-tabs": [2, "smart-tabs"], - "no-trailing-spaces": [2, { "skipBlankLines": true }], - "max-nested-callbacks": [2, 3], - "no-eval": 2, - "no-implied-eval": 2, - "no-new-func": 2, - "guard-for-in": 0, - "eqeqeq": 1, - "no-else-return": 2, - "no-redeclare": 2, - "no-dupe-keys": 2, - "radix": 2, - "strict": [2, "never"], - "no-shadow": 0, - "no-delete-var": 2, - "no-undef-init": 2, - "no-shadow-restricted-names": 2, - "handle-callback-err": 0, - "no-lonely-if": 2, - "keyword-spacing": 2, - "constructor-super": 2, - "no-this-before-super": 2, - "no-dupe-class-members": 2, - "no-const-assign": 2, - "prefer-spread": 2, - "no-useless-concat": 2, - "no-var": 2, - "object-shorthand": 2, - "prefer-arrow-callback": 0 + "prettier/prettier": "error", + "react/prop-types": 0, + "react/no-unknown-property": 0, + "react/no-unescaped-entities": 0, + "no-console": ["warn", { "allow": ["warn", "error"] }] } } diff --git a/package.json b/package.json index 7bbd221cb..b6253966e 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,7 @@ "description": "Netlify Identity widget for easy integration", "releaseVersion": "v1", "scripts": { - "dev": - "cross-env NODE_ENV=development webpack-dev-server --inline --hot --progress", + "dev": "cross-env NODE_ENV=development webpack-dev-server --inline --hot --progress", "start": "serve build -s -c 1", "prestart": "npm run build", "build": "cross-env NODE_ENV=production webpack --progress", @@ -13,11 +12,15 @@ "test": "npm run -s lint", "lint": "eslint src test", "release": "node ./script/release.js", - "format": "prettier-eslint --write 'src/**/*.js'", - "format-preview": "prettier-eslint --list-different 'src/**/*.js'" + "format": "prettier --write 'src/**/*.js'", + "format-preview": "prettier --list-different 'src/**/*.js'" }, "main": "./releases/v1/netlify-identity", - "keywords": ["netlify", "identity", "authentication"], + "keywords": [ + "netlify", + "identity", + "authentication" + ], "license": "MIT", "author": "Matt Biilmann ", "devDependencies": { @@ -34,7 +37,9 @@ "cross-env": "^5.0.1", "css-loader": "^0.28.0", "eslint": "^4.1.0", + "eslint-config-prettier": "^2.4.0", "eslint-plugin-import": "^2.7.0", + "eslint-plugin-prettier": "^2.2.0", "eslint-plugin-react": "^7.0.0", "file-loader": "^0.11.1", "html-webpack-plugin": "^2.28.0", @@ -42,8 +47,6 @@ "mkdirp": "^0.5.1", "postcss-loader": "^2.0.3", "prettier": "^1.6.1", - "prettier-eslint": "^7.1.0", - "prettier-eslint-cli": "^4.3.0", "raw-loader": "^0.5.1", "source-map-loader": "^0.2.1", "url-loader": "^0.5.8",