|
| 1 | +{ |
| 2 | + "root": true, |
| 3 | + "env": { |
| 4 | + "es2021": true, |
| 5 | + "node": true, |
| 6 | + "browser": false |
| 7 | + }, |
| 8 | + "extends": [ |
| 9 | + "eslint:recommended", |
| 10 | + /** @see https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#recommended-configs */ |
| 11 | + "plugin:@typescript-eslint/recommended", |
| 12 | + "plugin:import/recommended", |
| 13 | + "plugin:import/typescript", |
| 14 | + "plugin:etc/recommended", |
| 15 | + "plugin:sonarjs/recommended" |
| 16 | + ], |
| 17 | + "parser": "@typescript-eslint/parser", |
| 18 | + "parserOptions": { |
| 19 | + "ecmaVersion": 12, |
| 20 | + "sourceType": "module", |
| 21 | + "warnOnUnsupportedTypeScriptVersion": false, |
| 22 | + "project": [ |
| 23 | + "tsconfig.json" |
| 24 | + ] |
| 25 | + }, |
| 26 | + "overrides": [ |
| 27 | + { |
| 28 | + // enable the rule specifically for TypeScript files |
| 29 | + "files": ["*.ts"], |
| 30 | + "rules": { |
| 31 | + "@typescript-eslint/explicit-function-return-type": "error" |
| 32 | + } |
| 33 | + } |
| 34 | + ], |
| 35 | + "settings": { |
| 36 | + "import/resolver": { |
| 37 | + "typescript": true, |
| 38 | + "node": true, |
| 39 | + "eslint-import-resolver-custom-alias": { |
| 40 | + "alias": { |
| 41 | + "/@": "./src", |
| 42 | + "/@gen": "./src-generated" |
| 43 | + }, |
| 44 | + "extensions": [".ts"], |
| 45 | + "packages": [] |
| 46 | + } |
| 47 | + } |
| 48 | + }, |
| 49 | + "plugins": [ |
| 50 | + "@typescript-eslint", |
| 51 | + "sonarjs", |
| 52 | + "etc", |
| 53 | + "redundant-undefined", |
| 54 | + "no-null", |
| 55 | + "header", |
| 56 | + "simple-import-sort", |
| 57 | + "unicorn" |
| 58 | + ], |
| 59 | + "ignorePatterns": [ |
| 60 | + "node_modules/**", |
| 61 | + "dist/**", |
| 62 | + "builtin/**" |
| 63 | + ], |
| 64 | + "rules": { |
| 65 | + "eqeqeq": "error", |
| 66 | + "@typescript-eslint/explicit-function-return-type": "off", |
| 67 | + "@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }], |
| 68 | + "@typescript-eslint/no-var-requires": "off", |
| 69 | + "@typescript-eslint/consistent-type-imports": "error", |
| 70 | + "@typescript-eslint/no-explicit-any": "error", |
| 71 | + "prefer-promise-reject-errors": "error", |
| 72 | + "@typescript-eslint/await-thenable": "error", |
| 73 | + "@typescript-eslint/no-floating-promises": "error", |
| 74 | + "@typescript-eslint/no-misused-promises": "error", |
| 75 | + "@typescript-eslint/prefer-optional-chain": "error", |
| 76 | + "no-null/no-null": "error", |
| 77 | + |
| 78 | + /** |
| 79 | + * Having a semicolon helps the optimizer interpret your code correctly. |
| 80 | + * This avoids rare errors in optimized code. |
| 81 | + * @see https://twitter.com/alex_kozack/status/1364210394328408066 |
| 82 | + */ |
| 83 | + "semi": ["error", "always"], |
| 84 | + /** |
| 85 | + * This will make the history of changes in the hit a little cleaner |
| 86 | + */ |
| 87 | + "comma-dangle": ["warn", "always-multiline"], |
| 88 | + /** |
| 89 | + * Just for beauty |
| 90 | + */ |
| 91 | + "quotes": ["error", "single", { "allowTemplateLiterals": true }], |
| 92 | + "import/no-duplicates": "error", |
| 93 | + "import/no-unresolved": "off", |
| 94 | + "import/default": "off", |
| 95 | + "import/no-named-as-default-member": "off", |
| 96 | + "import/no-named-as-default": "off", |
| 97 | + "import/first": "error", |
| 98 | + "import/newline-after-import": "error", |
| 99 | + "sonarjs/cognitive-complexity": "off", |
| 100 | + "sonarjs/no-duplicate-string": "off", |
| 101 | + "sonarjs/no-empty-collection": "off", |
| 102 | + "sonarjs/no-small-switch": "off", |
| 103 | + "etc/no-commented-out-code": "error", |
| 104 | + "etc/no-deprecated": "off", |
| 105 | + "redundant-undefined/redundant-undefined": "error", |
| 106 | + "import/no-extraneous-dependencies": "error", |
| 107 | + "header/header": [2, "block", [{ "pattern": "SPDX-License-Identifier: Apache-2\\.0" }]], |
| 108 | + "simple-import-sort/imports": "error", |
| 109 | + "simple-import-sort/exports": "error", |
| 110 | + "unicorn/prefer-node-protocol": "error" |
| 111 | + } |
| 112 | +} |
0 commit comments