forked from vuejs/eslint-config-typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.mjs
33 lines (31 loc) · 1.12 KB
/
index.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import tseslint from "typescript-eslint";
export default tseslint.config(tseslint.configs.eslintRecommended, {
plugins: {
'@typescript-eslint': tseslint.plugin,
},
languageOptions: {
parserOptions: {
parser: {
'ts': tseslint.parser,
'tsx': tseslint.parser,
'cts': tseslint.parser,
'mts': tseslint.parser,
},
extraFileExtensions: ['.vue'],
ecmaFeatures: {
jsx: true,
}
}
},
}, {
files: ['*.ts', '*.cts', '*.mts', '*.tsx', '*.vue'],
rules: {
// The core 'no-unused-vars' rules (in the eslint:recommeded ruleset)
// does not work with type definitions
'no-unused-vars': 'off',
// TS already checks for that, and Typescript-Eslint recommends to disable it
// https://typescript-eslint.io/linting/troubleshooting#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
'no-undef': 'off',
'@typescript-eslint/no-unused-vars': 'warn'
}
});