From a44d27547ff38e15959d31293552b6dbf53a1d3c Mon Sep 17 00:00:00 2001 From: Sefinek Date: Sat, 2 Mar 2024 03:19:43 +0100 Subject: [PATCH] Update eslint config --- .eslintrc.js | 38 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 4bd25f7..3c485b4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,19 +1,15 @@ module.exports = { - 'extends': [ - 'eslint:recommended', - ], 'env': { + 'es6': true, 'node': true, - 'es2023': true, 'browser': true, }, + 'extends': ['eslint:recommended'], 'parserOptions': { - 'ecmaVersion': 2023, + 'ecmaVersion': 'latest', }, - 'ignorePatterns': [], 'rules': { - 'arrow-spacing': ['warn', { 'before': true, 'after': true }], - // 'brace-style': ['warn', 'stroustrup', { 'allowSingleLine': true }], + 'arrow-spacing': ['warn', { before: true, after: true }], 'comma-dangle': ['error', 'always-multiline'], 'comma-spacing': 'error', 'comma-style': 'error', @@ -22,37 +18,33 @@ module.exports = { 'handle-callback-err': 'off', 'indent': ['warn', 'tab'], 'keyword-spacing': 'warn', - 'max-nested-callbacks': ['error', { 'max': 4 }], - 'max-statements-per-line': ['error', { 'max': 2 }], + 'max-nested-callbacks': ['error', { max: 4 }], + 'max-statements-per-line': ['error', { max: 2 }], 'no-console': 'off', + 'no-empty': 'warn', 'no-empty-function': 'error', 'no-floating-decimal': 'error', - // 'no-inline-comments': 'error', 'no-lonely-if': 'error', 'no-multi-spaces': 'warn', - 'no-multiple-empty-lines': ['warn', { 'max': 4, 'maxEOF': 1, 'maxBOF': 0 }], - 'no-shadow': ['error', { 'allow': ['err', 'resolve', 'reject'] }], + 'no-multiple-empty-lines': ['warn', { max: 4, maxEOF: 1, maxBOF: 0 }], + 'no-shadow': ['error', { allow: ['err', 'resolve', 'reject'] }], 'no-trailing-spaces': ['warn'], + 'no-unreachable': 'warn', + 'no-unused-vars': 'warn', + 'no-use-before-define': ['error', { functions: false, classes: true }], 'no-var': 'error', 'object-curly-spacing': ['error', 'always'], 'prefer-const': 'error', 'quotes': ['warn', 'single'], 'semi': ['warn', 'always'], + 'sort-vars': 'warn', 'space-before-blocks': 'error', - 'space-before-function-paren': ['error', { - 'anonymous': 'never', - 'named': 'never', - 'asyncArrow': 'always', - }], + 'space-before-function-paren': ['error', { anonymous: 'never', named: 'never', asyncArrow: 'always' }], 'space-in-parens': 'error', 'space-infix-ops': 'error', 'space-unary-ops': 'error', 'spaced-comment': 'warn', - 'yoda': 'error', - 'no-use-before-define': ['error', { 'functions': false, 'classes': true }], - 'no-unused-vars': 'warn', 'wrap-regex': 'error', - 'sort-vars': 'warn', - 'no-unreachable': 'warn', + 'yoda': 'error', }, }; \ No newline at end of file