File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,23 @@ module.exports = {
99
1010 rules : {
1111 // this rule, if on, would require explicit return type on the `render` function
12- '@typescript-eslint/explicit-function-return-type' : 'off'
12+ '@typescript-eslint/explicit-function-return-type' : 'off' ,
13+
14+ // The following rules are enabled in an `overrides` field in the
15+ // `@typescript-eslint/recommended` ruleset, only turned on for TypeScript source modules
16+ // <https://github.com/typescript-eslint/typescript-eslint/blob/cb2d44650d27d8b917e8ce19423245b834db29d2/packages/eslint-plugin/src/configs/eslint-recommended.ts#L27-L30>
17+
18+ // But as ESLint cannot precisely target `<script lang="ts">` blocks and skip normal `<script>`s,
19+ // no TypeScript code in `.vue` files would be checked against these rules.
20+
21+ // So we now enable them globally.
22+ // That would also check plain JavaScript files, which diverges a little from
23+ // the original intention of the `@typescript-eslint/recommended` rulset.
24+ // But it should be mostly fine.
25+ 'no-var' : 'error' , // ts transpiles let/const to var, so no need for vars any more
26+ 'prefer-const' : 'error' , // ts provides better types with const
27+ 'prefer-rest-params' : 'error' , // ts provides better types with rest args over arguments
28+ 'prefer-spread' : 'error' , // ts transpiles spread to apply, so no need for manual apply
1329 } ,
1430
1531 overrides : [
You can’t perform that action at this time.
0 commit comments