From 4c34a9fb20c013b94f32f4f8e7c6ff900a5a6c25 Mon Sep 17 00:00:00 2001 From: Kevin Purnelle Date: Thu, 18 Apr 2019 17:44:37 +0200 Subject: [PATCH] chore(lint): add eslint --- .eslintignore | 5 +++++ .eslintrc | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 9 ++++++++ 3 files changed, 72 insertions(+) create mode 100644 .eslintignore create mode 100644 .eslintrc diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..1077000 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,5 @@ +node_modules +main.dist.js +dist +*.map +lib diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..c91b431 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,58 @@ +{ + "env": { + "browser": true, + "jest": true, + "node": true, + "es6": true + }, + + "extends": [ + "eslint-config-standard", + "plugin:react/recommended" + ], + + "parser": "babel-eslint", + + "plugins": [ + "standard", + "react", + "import" + ], + + "settings": { + "react": { + "version": "16.0" + } + }, + + "rules": { + "brace-style": [2, "stroustrup"], + "comma-dangle": 0, + "import/extensions": 1, + "import/no-unresolved": 2, + "object-curly-spacing": [2, "never"], + "react/jsx-indent-props": [1, 2], + "react/jsx-max-props-per-line": 0, + "react/jsx-no-bind": 2, + "react/jsx-no-duplicate-props": 1, + "react/jsx-no-literals": 0, + "react/jsx-sort-prop-types": 0, + "react/jsx-sort-props": 0, + "react/jsx-uses-react": 1, + "react/jsx-uses-vars": 1, + "react/jsx-wrap-multilines": 1, + "react/no-danger": 1, + "react/no-did-mount-set-state": 1, + "react/no-did-update-set-state": 1, + "react/no-direct-mutation-state": 1, + "react/no-multi-comp": 1, + "react/no-unescaped-entities": 1, + "react/no-unknown-property": 1, + "react/no-unused-prop-types": 1, + "react/prefer-es6-class": 1, + "react/prop-types": 1, + "react/react-in-jsx-scope": 1, + "react/self-closing-comp": 1, + "react/sort-comp": 1 + } +} diff --git a/package.json b/package.json index a9bb663..ac4bdef 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "index.js", "scripts": { "compile": "NODE_ENV=production babel src -d lib", + "lint": "eslint src --quiet", "prepare": "npm run compile", "tag-release": "npm test && standard-version", "test": "jest", @@ -34,10 +35,18 @@ "@babel/preset-react": "7.0.0", "@babel/runtime": "7.3.4", "babel-core": "7.0.0-bridge.0", + "babel-eslint": "10.0.1", "babel-jest": "24.1.0", "babel-plugin-module-resolver": "3.2.0", "enzyme": "3.9.0", "enzyme-adapter-react-16": "1.10.0", + "eslint": "5.7.0", + "eslint-config-standard": "12.0.0", + "eslint-plugin-import": "2.14.0", + "eslint-plugin-node": "7.0.1", + "eslint-plugin-promise": "4.0.1", + "eslint-plugin-react": "7.11.1", + "eslint-plugin-standard": "4.0.0", "jest": "24.1.0", "mobx": "5.9.0", "mobx-react": "5.4.3",