|
| 1 | +{ |
| 2 | + "env": { |
| 3 | + "es6": true, |
| 4 | + "node": true |
| 5 | + }, |
| 6 | + "extends": [ |
| 7 | + "eslint:recommended", |
| 8 | + // "google", |
| 9 | + "plugin:@typescript-eslint/eslint-recommended", |
| 10 | + "plugin:@typescript-eslint/recommended", |
| 11 | + "plugin:@typescript-eslint/recommended-requiring-type-checking", |
| 12 | + "plugin:jest/recommended", |
| 13 | + "plugin:jest/style", |
| 14 | + "plugin:import/recommended", |
| 15 | + "plugin:import/typescript", |
| 16 | + "plugin:node/recommended-module", |
| 17 | + "plugin:security/recommended", |
| 18 | + "plugin:prettier/recommended" |
| 19 | + ], |
| 20 | + "overrides": [ |
| 21 | + { |
| 22 | + "files": ["**/__tests__/**/*.spec.ts", "**/__tests__/**/*.mock.ts"], |
| 23 | + "env": { |
| 24 | + "jest": true |
| 25 | + }, |
| 26 | + "rules": { |
| 27 | + "node/no-unpublished-require": ["off"], |
| 28 | + "node/no-unpublished-import": ["off"], |
| 29 | + // extends plugin:jest/recommended |
| 30 | + "jest/expect-expect": "error", |
| 31 | + "jest/no-commented-out-tests": "error", |
| 32 | + "jest/no-disabled-tests": "off", |
| 33 | + |
| 34 | + // extends plugin:jest/style |
| 35 | + "jest/no-alias-methods": "error", |
| 36 | + "import/no-extraneous-dependencies": ["error", { "devDependencies": true }], |
| 37 | + "no-new-wrappers": "off" |
| 38 | + } |
| 39 | + } |
| 40 | + ], |
| 41 | + "parser": "@typescript-eslint/parser", |
| 42 | + "parserOptions": { |
| 43 | + "project": ["tsconfig.json"] |
| 44 | + }, |
| 45 | + "plugins": ["prettier", "@typescript-eslint"], |
| 46 | + "rules": { |
| 47 | + "@typescript-eslint/consistent-type-imports": "error", |
| 48 | + "@typescript-eslint/require-await": "off", |
| 49 | + "@typescript-eslint/return-await": "error", |
| 50 | + "@typescript-eslint/await-thenable": "error", |
| 51 | + "@typescript-eslint/no-floating-promises": "error", |
| 52 | + "@typescript-eslint/explicit-function-return-type": ["error", { "allowExpressions": true }], |
| 53 | + |
| 54 | + // extends plugin:@typescript-eslint/recommended |
| 55 | + "@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }], // it is warn by default |
| 56 | + "@typescript-eslint/no-explicit-any": "error", // it is warn by default |
| 57 | + "@typescript-eslint/no-non-null-assertion": "off", |
| 58 | + "@typescript-eslint/ban-types": [ |
| 59 | + "error", |
| 60 | + { |
| 61 | + "extendDefaults": true, |
| 62 | + "types": { |
| 63 | + "Array": "Use [] instead of Array." |
| 64 | + } |
| 65 | + } |
| 66 | + ], |
| 67 | + "@typescript-eslint/explicit-module-boundary-types": "off", |
| 68 | + "@typescript-eslint/no-non-null-asserted-optional-chain": "off", |
| 69 | + "@typescript-eslint/no-namespace": "off", |
| 70 | + "@typescript-eslint/no-empty-interface": "off", |
| 71 | + |
| 72 | + "prettier/prettier": "error", |
| 73 | + "node/no-unpublished-import": "off", |
| 74 | + "node/no-unpublished-require": "off", |
| 75 | + |
| 76 | + // extends plugin:security/recommended |
| 77 | + "security/detect-object-injection": "off", |
| 78 | + "security/detect-possible-timing-attacks": "off", |
| 79 | + "security/detect-non-literal-fs-filename": "off", |
| 80 | + |
| 81 | + // extends plugin:import/recommended |
| 82 | + "import/no-duplicates": "error", |
| 83 | + "import/no-named-as-default": "error", |
| 84 | + "import/no-named-as-default-member": "error", |
| 85 | + "import/export": "off", |
| 86 | + "new-cap": "off", |
| 87 | + // extends plugin:node/recommended-module |
| 88 | + "node/no-missing-import": "off", |
| 89 | + "no-invalid-this": "off" |
| 90 | + }, |
| 91 | + "settings": { |
| 92 | + "import/resolver": { |
| 93 | + "typescript": {} |
| 94 | + }, |
| 95 | + "jest": { "version": 29 } |
| 96 | + } |
| 97 | +} |
0 commit comments