Skip to content

Commit 221212f

Browse files
committed
Extend config to support TypeScript
1 parent 10deaa2 commit 221212f

File tree

3 files changed

+182
-54
lines changed

3 files changed

+182
-54
lines changed

index.js

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,39 @@ module.exports = {
55
es6: true,
66
node: true,
77
},
8-
parserOptions: {
9-
ecmaVersion: '2017',
10-
},
11-
extends: ['eslint:recommended'],
12-
plugins: ['jsdoc'],
8+
extends: ['plugin:vue/base'],
9+
overrides: [
10+
{
11+
files: '*.ts',
12+
extends: [
13+
'plugin:@typescript-eslint/eslint-recommended',
14+
'plugin:@typescript-eslint/recommended',
15+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
16+
],
17+
parser: '@typescript-eslint/parser',
18+
parserOptions: {
19+
project: 'tsconfig.json',
20+
tsconfigRootDir: '.',
21+
},
22+
plugins: ['@typescript-eslint'],
23+
rules: {
24+
'@typescript-eslint/no-floating-promises': 'off',
25+
},
26+
},
27+
{
28+
files: '*.js',
29+
extends: ['eslint:recommended'],
30+
parserOptions: {
31+
ecmaVersion: '2017',
32+
},
33+
rules: {
34+
strict: ['error', 'global'],
35+
36+
'jsdoc/no-undefined-types': 'warn',
37+
},
38+
},
39+
],
40+
plugins: ['jsdoc', 'vue'],
1341
rules: {
1442
/*
1543
* Possible errors
@@ -56,13 +84,6 @@ module.exports = {
5684
// Disallow redundant return statements
5785
'no-useless-return': 'error',
5886

59-
/*
60-
* Strict mode
61-
*/
62-
63-
// Require global strict mode directive
64-
strict: ['error', 'global'],
65-
6687
/*
6788
* Stylistic issues
6889
*/
@@ -207,7 +228,6 @@ module.exports = {
207228
'jsdoc/check-syntax': 'warn',
208229
'jsdoc/check-tag-names': 'warn',
209230
'jsdoc/check-types': ['warn', { noDefaults: true }],
210-
'jsdoc/no-undefined-types': 'warn',
211231
'jsdoc/require-param': 'warn',
212232
'jsdoc/require-param-description': 'warn',
213233
'jsdoc/require-param-name': 'warn',

0 commit comments

Comments
 (0)