Skip to content

Commit

Permalink
tools: enable ESLint recommended configuration
Browse files Browse the repository at this point in the history
PR-URL: #41463
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
  • Loading branch information
Trott authored and targos committed Jan 14, 2022
1 parent 090a674 commit 258ee4b
Showing 1 changed file with 8 additions and 51 deletions.
59 changes: 8 additions & 51 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Module._findPath = (request, paths, isMain) => {

module.exports = {
root: true,
extends: ['plugin:jsdoc/recommended'],
extends: ['eslint:recommended', 'plugin:jsdoc/recommended'],
plugins: ['jsdoc', 'markdown', 'node-core'],
parser: '@babel/eslint-parser',
parserOptions: {
Expand Down Expand Up @@ -142,17 +142,14 @@ module.exports = {
'comma-spacing': 'error',
'comma-style': 'error',
'computed-property-spacing': 'error',
'constructor-super': 'error',
'default-case-last': 'error',
'dot-location': ['error', 'property'],
'dot-notation': 'error',
'eol-last': 'error',
'eqeqeq': ['error', 'smart'],
'for-direction': 'error',
'func-call-spacing': 'error',
'func-name-matching': 'error',
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
'getter-return': 'error',
'indent': ['error', 2, {
ArrayExpression: 'first',
CallExpression: { arguments: 'first' },
Expand All @@ -174,49 +171,20 @@ module.exports = {
tabWidth: 2,
}],
'new-parens': 'error',
'no-async-promise-executor': 'error',
'no-case-declarations': 'error',
'no-class-assign': 'error',
'no-confusing-arrow': 'error',
'no-const-assign': 'error',
'no-constant-condition': ['error', { checkLoops: false }],
'no-constructor-return': 'error',
'no-control-regex': 'error',
'no-debugger': 'error',
'no-delete-var': 'error',
'no-dupe-args': 'error',
'no-dupe-class-members': 'error',
'no-dupe-keys': 'error',
'no-dupe-else-if': 'error',
'no-duplicate-case': 'error',
'no-duplicate-imports': 'error',
'no-else-return': ['error', { allowElseIf: true }],
'no-empty-character-class': 'error',
'no-ex-assign': 'error',
'no-extra-boolean-cast': 'error',
'no-extra-parens': ['error', 'functions'],
'no-extra-semi': 'error',
'no-fallthrough': 'error',
'no-func-assign': 'error',
'no-global-assign': 'error',
'no-invalid-regexp': 'error',
'no-irregular-whitespace': 'error',
'no-lonely-if': 'error',
'no-loss-of-precision': 'error',
'no-misleading-character-class': 'error',
'no-mixed-requires': 'error',
'no-mixed-spaces-and-tabs': 'error',
'no-multi-spaces': ['error', { ignoreEOLComments: true }],
'no-multiple-empty-lines': ['error', { max: 2, maxEOF: 0, maxBOF: 0 }],
'no-new-require': 'error',
'no-new-symbol': 'error',
'no-nonoctal-decimal-escape': 'error',
'no-obj-calls': 'error',
'no-octal': 'error',
'no-path-concat': 'error',
'no-proto': 'error',
'no-redeclare': ['error', { 'builtinGlobals': false }],
'no-regex-spaces': 'error',
'no-restricted-modules': ['error', 'sys'],
/* eslint-disable max-len */
'no-restricted-properties': [
Expand Down Expand Up @@ -273,41 +241,26 @@ module.exports = {
],
/* eslint-enable max-len */
'no-return-await': 'error',
'no-self-assign': 'error',
'no-self-compare': 'error',
'no-setter-return': 'error',
'no-shadow-restricted-names': 'error',
'no-sparse-arrays': 'error',
'no-tabs': 'error',
'no-template-curly-in-string': 'error',
'no-this-before-super': 'error',
'no-throw-literal': 'error',
'no-trailing-spaces': 'error',
'no-undef': ['error', { typeof: true }],
'no-undef-init': 'error',
'no-unexpected-multiline': 'error',
'no-unreachable': 'error',
'no-unsafe-finally': 'error',
'no-unsafe-negation': 'error',
'no-unsafe-optional-chaining': 'error',
'no-unused-expressions': ['error', { allowShortCircuit: true }],
'no-unused-labels': 'error',
'no-unused-vars': ['error', { args: 'none', caughtErrors: 'all' }],
'no-use-before-define': ['error', {
classes: true,
functions: false,
variables: false,
}],
'no-useless-backreference': 'error',
'no-useless-call': 'error',
'no-useless-catch': 'error',
'no-useless-concat': 'error',
'no-useless-constructor': 'error',
'no-useless-escape': 'error',
'no-useless-return': 'error',
'no-void': 'error',
'no-whitespace-before-property': 'error',
'no-with': 'error',
'object-curly-newline': 'error',
'object-curly-spacing': ['error', 'always'],
'one-var': ['error', { initialized: 'never' }],
Expand All @@ -322,7 +275,6 @@ module.exports = {
'quotes': ['error', 'single', { avoidEscape: true }],
'quote-props': ['error', 'consistent'],
'rest-spread-spacing': 'error',
'require-yield': 'error',
'semi': 'error',
'semi-spacing': 'error',
'space-before-blocks': ['error', 'always'],
Expand All @@ -342,10 +294,15 @@ module.exports = {
'symbol-description': 'error',
'template-curly-spacing': 'error',
'unicode-bom': 'error',
'use-isnan': 'error',
'valid-typeof': ['error', { requireStringLiterals: true }],

// JSDoc rules
// ESLint recommended rules that we disable
'no-cond-assign': 'off',
'no-empty': 'off',
'no-inner-declarations': 'off',
'no-prototype-builtins': 'off',

// JSDoc recommended rules that we disable
'jsdoc/require-jsdoc': 'off',
'jsdoc/require-param-description': 'off',
'jsdoc/newline-after-description': 'off',
Expand Down

0 comments on commit 258ee4b

Please sign in to comment.