From d8371a7e4b129326556567b482c1705e5dcf2aba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20=C5=A0vagr?= Date: Mon, 2 Dec 2024 13:37:01 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Remove=20style=20related=20rules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/eslint.ts | 60 +++++++++++++++------------------------------------ 1 file changed, 17 insertions(+), 43 deletions(-) diff --git a/src/eslint.ts b/src/eslint.ts index 3b1f781..367cc00 100644 --- a/src/eslint.ts +++ b/src/eslint.ts @@ -13,7 +13,7 @@ export = { }, ignorePatterns: [], rules: { - // code formatting + 'security/detect-object-injection': 0, '@typescript-eslint/no-unused-vars': [ 'warn', { @@ -26,54 +26,28 @@ export = { ignoreRestSiblings: true, }, ], - '@typescript-eslint/comma-dangle': [ - 'error', - { - arrays: 'only-multiline', - objects: 'only-multiline', - imports: 'only-multiline', - exports: 'only-multiline', - functions: 'never', - enums: 'only-multiline', - generics: 'only-multiline', - tuples: 'only-multiline', - }, - ], - '@typescript-eslint/indent': 0, - '@typescript-eslint/space-before-function-paren': [ - 2, - { - anonymous: 'never', - named: 'never', - asyncArrow: 'always', - }, - ], - '@typescript-eslint/no-extra-semi': 0, - '@typescript-eslint/member-delimiter-style': 0, - // error prevention - 'security/detect-object-injection': 0, '@typescript-eslint/no-explicit-any': 0, '@typescript-eslint/strict-boolean-expressions': 0, '@typescript-eslint/restrict-template-expressions': [ - 2, + 'error', { allowNumber: true, allowBoolean: false, allowNullish: false, }, ], - '@typescript-eslint/no-floating-promises': [2, { ignoreVoid: true }], - 'no-void': [2, { allowAsStatement: true }], - 'no-fallthrough': 1, - 'no-constant-condition': [1, { checkLoops: false }], + '@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }], + 'no-void': ['error', { allowAsStatement: true }], + 'no-fallthrough': 'warn', + 'no-constant-condition': ['warn', { checkLoops: false }], // Less strictness over ?? - '@typescript-eslint/prefer-nullish-coalescing': 1, + '@typescript-eslint/prefer-nullish-coalescing': 'warn', // consistent code '@typescript-eslint/promise-function-async': 0, '@typescript-eslint/explicit-function-return-type': 0, '@typescript-eslint/explicit-module-boundary-types': 0, - '@typescript-eslint/return-await': [2, 'in-try-catch'], + '@typescript-eslint/return-await': ['error', 'in-try-catch'], '@typescript-eslint/no-misused-promises': [ 'error', { @@ -92,15 +66,15 @@ export = { 'new-cap': 0, // code smells - 'sonarjs/cognitive-complexity': 1, - 'sonarjs/no-duplicate-string': 1, - '@typescript-eslint/no-non-null-assertion': 1, - '@typescript-eslint/no-use-before-define': 1, - 'sonarjs/no-identical-functions': 1, - '@typescript-eslint/no-var-requires': 1, - '@typescript-eslint/require-array-sort-compare': 1, - 'no-async-promise-executor': 1, - 'sonarjs/no-unused-collection': 1, + 'sonarjs/cognitive-complexity': 'warn', + 'sonarjs/no-duplicate-string': 'warn', + 'sonarjs/no-identical-functions': 'warn', + 'sonarjs/no-unused-collection': 'warn', + '@typescript-eslint/no-non-null-assertion': 'warn', + '@typescript-eslint/no-use-before-define': 'warn', + '@typescript-eslint/no-var-requires': 'warn', + '@typescript-eslint/require-array-sort-compare': 'warn', + 'no-async-promise-executor': 'warn', }, settings: { node: {