-
-
Notifications
You must be signed in to change notification settings - Fork 489
/
.eslintrc.js
49 lines (45 loc) · 1.25 KB
/
.eslintrc.js
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
const path = require('path')
const fs = require('fs')
function parseAutoImportsDts(contents) {
const matchResults = contents.matchAll(/^\s+const (\w+): typeof import/gm)
return Array.from(matchResults, ([, word]) => word)
}
function dts2Globals() {
const SRC = path.resolve(__dirname, './src/auto-imports.d.ts')
const contents = fs.readFileSync(SRC, { encoding: 'utf-8' })
const parsed = parseAutoImportsDts(contents)
return parsed.reduce((acc, word) => {
acc[word] = 'readonly'
return acc
}, {})
}
module.exports = {
env: {
browser: true,
es2021: true,
node: true
},
extends: ['plugin:vue/essential', 'airbnb-base', 'plugin:prettier/recommended'],
parserOptions: {
ecmaVersion: 12,
parser: '@typescript-eslint/parser',
sourceType: 'module'
},
plugins: ['vue', '@typescript-eslint'],
rules: {
'import/no-unresolved': 'off',
'import/extensions': 'off',
'import/no-absolute-path': 'off',
'import/no-extraneous-dependencies': 'off',
'vue/no-multiple-template-root': 'off',
'no-console': 'off',
'no-shadow': 'off',
'import/prefer-default-export': 'off',
camelcase: 'off',
'no-param-reassign': 'off',
'no-await-in-loop': 'off'
},
globals: {
...dts2Globals()
}
}