From f1422386b5e5ec1330629fe9478c0f4ae4a87a12 Mon Sep 17 00:00:00 2001 From: hpneo Date: Thu, 3 Oct 2019 02:09:17 -0500 Subject: [PATCH 1/5] Initial version (1.0.0) --- .gitignore | 5 +++++ index.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 12 ++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 .gitignore create mode 100644 index.js create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3331ab5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +node_modules +yarn-error.log +.DS_Store +package-lock.json +yarn.lock \ No newline at end of file diff --git a/index.js b/index.js new file mode 100644 index 0000000..10c1e38 --- /dev/null +++ b/index.js @@ -0,0 +1,48 @@ +module.exports = { + env: { + browser: true, + node: true, + es6: true, + jest: true + }, + parser: "babel-eslint", + extends: "react-app", + plugins: ["import", "react-hooks", "prettier"], + rules: { + "no-dupe-keys": "error", + "no-undef": "error", + "no-unreachable": "error", + "no-unused-vars": [ + "error", + { + argsIgnorePattern: "^_", + varsIgnorePattern: "^_", + ignoreRestSiblings: true + } + ], + "no-useless-constructor": "error", + "no-var": "error", + "no-duplicate-imports": "error", + "no-duplicate-case": "error", + "import/no-unresolved": "error", + "import/default": "error", + "react/jsx-no-undef": "error", + "react/jsx-uses-vars": "error", + "react/jsx-uses-react": "error", + "react/react-in-jsx-scope": "error", + "react/no-string-refs": "error", + "react/prop-types": ["error", { skipUndeclared: true }], + "react/forbid-prop-types": "error", + "react/prefer-stateless-function": [ + "error", + { ignorePureComponents: true } + ], + "react-hooks/rules-of-hooks": "error", // Checks rules of Hooks + "react-hooks/exhaustive-deps": "warn", // Checks effect dependencies + "prettier/prettier": "error", + "no-console": ["error", { "allow": ["warn", "error"] }], + "no-debugger": "error" + } +}; + +// Globals added dynamically or add them in .eslintignore \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..a4a14ab --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "name": "@ableco/eslint-config", + "version": "1.0.0", + "description": "ESLint configuration from https://github.com/ableco/coding-standards", + "main": "index.js", + "repository": "https://github.com/ableco/eslint-config", + "author": "Able", + "license": "MIT", + "dependencies": { + "chalk": "^2.4.2" + } +} From e47a88569f048e1587a529a6bc3a207b5beef3a2 Mon Sep 17 00:00:00 2001 From: hpneo Date: Thu, 3 Oct 2019 02:15:18 -0500 Subject: [PATCH 2/5] Remove unused dependency --- package.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/package.json b/package.json index a4a14ab..2eb3fe8 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,5 @@ "main": "index.js", "repository": "https://github.com/ableco/eslint-config", "author": "Able", - "license": "MIT", - "dependencies": { - "chalk": "^2.4.2" - } + "license": "MIT" } From 4138a98c76eacc09b90e1b5a995af5be9a0b0c80 Mon Sep 17 00:00:00 2001 From: hpneo Date: Thu, 3 Oct 2019 02:28:26 -0500 Subject: [PATCH 3/5] Add README and peerDependencies --- README.md | 35 +++++++++++++++++++++++++++++++++++ package.json | 12 +++++++++++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..12bef5e --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +# @ableco/eslint-config + +This repository provides recommended ESLint configuration for use on Able JavaScript projects. + +## Installation + +### Using yarn: +`yarn add @ableco/eslint-configuration --dev` + +### Using npm: +`npm install @ableco/eslint-configuration --save-dev` + +## Usage + +In your `.eslintrc.js` file, replace it with: + +```javascript +module.exports = { + root: true, + settings: { + //... your own settings, for example "import/resolver" or "react". + }, + extends: "@ableco" +}; +``` + +> **Note:** This ESLint configuration only replaces `env`, `parser`, `extends`, `plugins` and `rules`. + +## Contributing + +Bug reports and pull requests are welcome on GitHub at https://github.com/ableco/eslint-config. + +## License + +The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). diff --git a/package.json b/package.json index 2eb3fe8..c27c673 100644 --- a/package.json +++ b/package.json @@ -5,5 +5,15 @@ "main": "index.js", "repository": "https://github.com/ableco/eslint-config", "author": "Able", - "license": "MIT" + "license": "MIT", + "peerDependencies": { + "babel-eslint": "^10.0.3", + "eslint": "^6.5.1", + "eslint-config-react-app": "^5.0.2", + "eslint-plugin-import": "^2.18.2", + "eslint-plugin-prettier": "^3.1.1", + "eslint-plugin-react-hooks": "^2.1.1", + "eslint-utils": "^1.4.2", + "prettier": "^1.18.2" + } } From f26b6568c391d8806d6e5659959448a8a90f7f61 Mon Sep 17 00:00:00 2001 From: hpneo Date: Thu, 3 Oct 2019 02:41:30 -0500 Subject: [PATCH 4/5] Standardize version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c27c673..3d60a66 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ableco/eslint-config", - "version": "1.0.0", + "version": "0.1.0", "description": "ESLint configuration from https://github.com/ableco/coding-standards", "main": "index.js", "repository": "https://github.com/ableco/eslint-config", From d157cd1ecb7be7565284fb4e7a725d4e8d0b4ff1 Mon Sep 17 00:00:00 2001 From: hpneo Date: Thu, 3 Oct 2019 08:48:19 -0500 Subject: [PATCH 5/5] move peerDependencies into dependencies --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3d60a66..3275745 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "repository": "https://github.com/ableco/eslint-config", "author": "Able", "license": "MIT", - "peerDependencies": { + "dependencies": { "babel-eslint": "^10.0.3", "eslint": "^6.5.1", "eslint-config-react-app": "^5.0.2",