From 150a1792ca045da81f9142984620e272bf4a6bf2 Mon Sep 17 00:00:00 2001 From: "Kent C. Dodds" Date: Thu, 17 Jan 2019 16:41:46 -0700 Subject: [PATCH] feat: add missing rules --- README.md | 2 -- best-practices.js | 11 ++++++----- es6/stylistic.js | 5 +++++ jest.js | 5 +++++ react.js | 1 + 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 7eed9d6..9cc727f 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,6 @@ ESLint rules for all of my personal projects. Feel free to use these conventions :-) -Sponsor - ## Usage Install the conventions by running: diff --git a/best-practices.js b/best-practices.js index b115985..7f6b619 100644 --- a/best-practices.js +++ b/best-practices.js @@ -60,6 +60,7 @@ module.exports = { 'no-unused-expressions': 'off', 'no-unused-labels': 'error', 'no-useless-call': 'error', + 'no-useless-catch': 'error', 'no-useless-concat': 'error', 'no-useless-escape': 'error', 'no-useless-return': 'error', @@ -92,11 +93,11 @@ module.exports = { 'no-unused-vars': [ 2, { - 'argsIgnorePattern': '^_', - 'varsIgnorePattern': '^ignored', - 'args': 'after-used', - 'ignoreRestSiblings': true - } + argsIgnorePattern: '^_', + varsIgnorePattern: '^ignored', + args: 'after-used', + ignoreRestSiblings: true, + }, ], // CommonJS diff --git a/es6/stylistic.js b/es6/stylistic.js index dfaec6e..53622fd 100644 --- a/es6/stylistic.js +++ b/es6/stylistic.js @@ -22,6 +22,11 @@ module.exports = { capIsNew: true, }, ], + camelcase: 'off', + 'babel/camelcase': ['error', {properties: 'always'}], + + 'valid-typeof': 'off', + 'babel/valid-typeof': 'error', // no eslint version 'babel/flow-object-type': 'off', // no opinion diff --git a/jest.js b/jest.js index 396f64a..6ae0a7a 100644 --- a/jest.js +++ b/jest.js @@ -5,9 +5,11 @@ module.exports = { 'jest/no-focused-tests': 'error', 'jest/no-identical-title': 'error', 'jest/valid-expect': 'error', + 'jest/no-alias-methods': 'off', 'jest/no-jest-import': 'error', 'jest/no-large-snapshots': ['warn', {maxSize: 300}], 'jest/no-test-prefixes': 'error', + 'jest/prefer-to-contain': 'warn', 'jest/prefer-to-have-length': 'warn', 'jest/valid-describe': 'error', 'jest/valid-expect-in-promise': 'error', @@ -15,13 +17,16 @@ module.exports = { 'jest/lowercase-name': 'off', 'jest/no-hooks': 'off', 'jest/no-jasmine-globals': 'off', + 'jest/no-test-callback': 'off', 'jest/prefer-expect-assertions': 'off', 'jest/prefer-to-be-null': 'off', 'jest/prefer-to-be-undefined': 'off', + 'jest/require-tothrow-message': 'off', 'jest/expect-expect': 'off', 'jest/no-test-return-statement': 'off', 'jest/prefer-inline-snapshots': 'off', 'jest/prefer-strict-equal': 'off', + 'jest/prefer-spy-on': 'off', }, env: { 'jest/globals': true, diff --git a/react.js b/react.js index 56f85d8..dd9de83 100644 --- a/react.js +++ b/react.js @@ -46,6 +46,7 @@ module.exports = { 'react/forbid-prop-types': 'off', 'react/jsx-boolean-value': 'off', 'react/jsx-filename-extension': ['error', {extensions: ['.js']}], + 'react/jsx-fragments': 'off', 'react/jsx-handler-names': 'off', 'react/jsx-key': 'error', 'react/jsx-no-bind': 'off',