|
| 1 | +module.exports = { |
| 2 | + rules: { |
| 3 | + "no-useless-constructor": "off", |
| 4 | + "no-useless-concat":"off", |
| 5 | + "max-params": "off", |
| 6 | + "@typescript-eslint/no-useless-constructor": "off", |
| 7 | + "@typescript-eslint/no-parameter-properties": "off", |
| 8 | + "@typescript-eslint/no-require-imports": "off", |
| 9 | + "@typescript-eslint/no-var-requires": "off", |
| 10 | + "@angular-eslint/component-class-suffix": ["error", { suffixes: ["Component", "Directive"] }], |
| 11 | + "@angular-eslint/component-selector": [ |
| 12 | + "error", |
| 13 | + { |
| 14 | + "type": "element", |
| 15 | + "prefix": "d", |
| 16 | + "style": "kebab-case" |
| 17 | + } |
| 18 | + ], |
| 19 | + "@angular-eslint/directive-class-suffix":["error", { suffixes: ["Component", "Directive"] }], |
| 20 | + "@angular-eslint/directive-selector": [ |
| 21 | + "error", |
| 22 | + { |
| 23 | + "type": ["attribute","element"], |
| 24 | + "prefix": "d", |
| 25 | + "style": "camelCase" |
| 26 | + } |
| 27 | + ], |
| 28 | + "@angular-eslint/no-host-metadata-property": "error", |
| 29 | + "@angular-eslint/no-input-rename": "off", |
| 30 | + "@angular-eslint/no-inputs-metadata-property": "error", |
| 31 | + "@angular-eslint/no-output-on-prefix": "error", |
| 32 | + "@angular-eslint/no-output-rename": "error", |
| 33 | + "@angular-eslint/no-outputs-metadata-property": "error", |
| 34 | + "@angular-eslint/use-lifecycle-interface": "error", |
| 35 | + "@angular-eslint/use-pipe-transform-interface": "error", |
| 36 | + "complexity": [ |
| 37 | + 'error', |
| 38 | + { |
| 39 | + max: 40, |
| 40 | + }, |
| 41 | + ], |
| 42 | + |
| 43 | + "curly": "error", |
| 44 | + "eol-last": "error", |
| 45 | + "eqeqeq": [ |
| 46 | + "error", |
| 47 | + "smart" |
| 48 | + ], |
| 49 | + "max-len": [ |
| 50 | + "error", |
| 51 | + { |
| 52 | + "code": 140 |
| 53 | + } |
| 54 | + ], |
| 55 | + "no-console": [ |
| 56 | + "error", |
| 57 | + { |
| 58 | + "allow": [ |
| 59 | + "log", |
| 60 | + "warn", |
| 61 | + "dir", |
| 62 | + "timeLog", |
| 63 | + "assert", |
| 64 | + "clear", |
| 65 | + "count", |
| 66 | + "countReset", |
| 67 | + "group", |
| 68 | + "groupEnd", |
| 69 | + "table", |
| 70 | + "dirxml", |
| 71 | + "error", |
| 72 | + "groupCollapsed", |
| 73 | + "Console", |
| 74 | + "profile", |
| 75 | + "profileEnd", |
| 76 | + "timeStamp", |
| 77 | + "context" |
| 78 | + ] |
| 79 | + } |
| 80 | + ], |
| 81 | + |
| 82 | + "no-multiple-empty-lines": "error", |
| 83 | + "no-shadow": "off", // 使用@typescript-eslint/no-shadow,规避使用enum类型报错 |
| 84 | + "no-trailing-spaces": "error", |
| 85 | + "no-unused-labels": "error", |
| 86 | + "no-use-before-define": "error", |
| 87 | + "no-var": "error", |
| 88 | + "prefer-const": "error", |
| 89 | + "semi": "error", |
| 90 | + "space-in-parens": [ |
| 91 | + "error", |
| 92 | + "never" |
| 93 | + ], |
| 94 | + "spaced-comment": [ |
| 95 | + "error", |
| 96 | + "always" |
| 97 | + ], |
| 98 | + "@typescript-eslint/dot-notation": "off", |
| 99 | + "@typescript-eslint/indent": [ |
| 100 | + "error", |
| 101 | + 2, |
| 102 | + { |
| 103 | + "FunctionDeclaration": { |
| 104 | + "parameters": "first" |
| 105 | + }, |
| 106 | + "FunctionExpression": { |
| 107 | + "parameters": "first" |
| 108 | + } |
| 109 | + } |
| 110 | + ], |
| 111 | + "@typescript-eslint/member-delimiter-style": [ |
| 112 | + "error", |
| 113 | + { |
| 114 | + "multiline": { |
| 115 | + "delimiter": "semi", |
| 116 | + "requireLast": true |
| 117 | + }, |
| 118 | + "singleline": { |
| 119 | + "delimiter": "semi", |
| 120 | + "requireLast": false |
| 121 | + } |
| 122 | + } |
| 123 | + ], |
| 124 | + "@typescript-eslint/no-misused-new": "error", |
| 125 | + "@typescript-eslint/no-non-null-assertion": "error", |
| 126 | + "@typescript-eslint/prefer-function-type": "error", |
| 127 | + "@typescript-eslint/semi": [ |
| 128 | + "error", |
| 129 | + "always" |
| 130 | + ], |
| 131 | + "@typescript-eslint/type-annotation-spacing": "error", |
| 132 | + "@typescript-eslint/unified-signatures": "error", |
| 133 | + "@typescript-eslint/no-shadow":"error", |
| 134 | + "@angular-eslint/no-output-on-prefix":"off", |
| 135 | + "@angular-eslint/use-pipe-transform-interface":"off", |
| 136 | + |
| 137 | + "prefer-promise-reject-errors": "off", |
| 138 | + 'max-nested-callbacks': ['error', 6], |
| 139 | + "@typescript-eslint/no-this-alias":"off", |
| 140 | + "accessor-pairs": "off", |
| 141 | + "max-depth": "off", |
| 142 | + "@typescript-eslint/member-ordering": "off", |
| 143 | + "array-callback-return":"off" |
| 144 | + } |
| 145 | +}; |
0 commit comments