From a6b6e9ac1e16f89127cf164c7e25ddd0792c4924 Mon Sep 17 00:00:00 2001 From: Jan Amann Date: Wed, 31 Jul 2019 15:35:23 +0200 Subject: [PATCH] - Resolves https://github.com/molindo/eslint-config-molindo/issues/4 - Resolves https://github.com/molindo/eslint-config-molindo/issues/19 - Resolves https://github.com/molindo/eslint-config-molindo/issues/20 - Resolves https://github.com/molindo/eslint-config-molindo/issues/21 - Resolves https://github.com/molindo/eslint-config-molindo/issues/22 - Resolves https://github.com/molindo/eslint-config-molindo/issues/23 - Sort rules alphabetically --- index.js | 9 +++++---- package.json | 3 ++- react.js | 13 ++++++++++--- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/index.js b/index.js index 2a3f37e..9dcf1d5 100644 --- a/index.js +++ b/index.js @@ -47,10 +47,6 @@ module.exports = { } ], 'no-lonely-if': ERROR, - 'no-throw-literal': ERROR, - 'no-var': ERROR, - 'no-unneeded-ternary': ERROR, - 'no-unused-expressions': ERROR, 'no-restricted-syntax': [ ERROR, { @@ -65,6 +61,11 @@ module.exports = { } ], 'no-shadow': ERROR, + 'no-throw-literal': ERROR, + 'no-unneeded-ternary': ERROR, + 'no-unused-expressions': ERROR, + 'no-use-before-define': [ERROR, {functions: false}], + 'no-var': ERROR, 'object-shorthand': ERROR, 'prefer-arrow-callback': ERROR, 'prefer-const': ERROR, diff --git a/package.json b/package.json index 592ce21..301fe36 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-molindo", - "version": "3.0.0", + "version": "4.0.0", "description": "Molindo ESLint config that implements our styleguide and helps to catch errors.", "main": "index.js", "repository": "https://github.com/molindo/eslint-config-molindo", @@ -36,6 +36,7 @@ "eslint-plugin-jsx-a11y": "^6.1.2", "eslint-plugin-prettier": "^3.0.1", "eslint-plugin-react": "^7.12.3", + "eslint-plugin-react-hooks": "^1.6.1", "prettier": "^1.15.3" } } diff --git a/react.js b/react.js index 411c54f..44e8ba6 100644 --- a/react.js +++ b/react.js @@ -8,7 +8,11 @@ module.exports = Object.assign({}, base, { plugins: base.plugins.concat('css-modules', 'jsx-a11y', 'react'), settings: Object.assign({}, base.settings, { - 'import/resolver': 'webpack' + 'import/resolver': { + node: { + paths: ['node_modules', 'src'] + } + } }), extends: (base.extends || []).concat( @@ -39,6 +43,7 @@ module.exports = Object.assign({}, base, { } ], 'react/jsx-no-bind': [ERROR, {allowArrowFunctions: true}], + 'react/jsx-no-target-blank': ERROR, 'react/jsx-sort-props': [ ERROR, { @@ -48,9 +53,10 @@ module.exports = Object.assign({}, base, { ], 'react/no-access-state-in-setstate': ERROR, 'react/no-direct-mutation-state': ERROR, + 'react/no-this-in-sfc': ERROR, + 'react/no-typos': ERROR, 'react/no-unused-prop-types': ERROR, 'react/no-unused-state': ERROR, - 'react/no-typos': ERROR, 'react/sort-comp': [ ERROR, { @@ -66,7 +72,8 @@ module.exports = Object.assign({}, base, { 'render' ] } - ] + ], + 'react/sort-prop-types': ERROR }), overrides: (base.overrides || []).concat({