-
-
Notifications
You must be signed in to change notification settings - Fork 131
/
Copy patheslint.config.mjs
76 lines (73 loc) · 2.04 KB
/
eslint.config.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import eslint from '@eslint/js'
import eslintPluginUnicorn from 'eslint-plugin-unicorn'
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
import eslintPluginVue from 'eslint-plugin-vue'
import globals from 'globals'
import typescriptEslint from 'typescript-eslint'
export default typescriptEslint.config(
{ ignores: ['**/*.d.ts', '**/coverage', '**/dist', '**/docs'] },
{
extends: [
eslint.configs.recommended,
...typescriptEslint.configs.recommended,
...eslintPluginVue.configs['flat/recommended'],
eslintPluginUnicorn.configs['flat/recommended'],
],
files: ['packages/**/src/**/*.{js,ts,tsx}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: globals.browser,
parserOptions: {
parser: typescriptEslint.parser,
},
},
rules: {
'no-console': 'off',
'no-debugger': 'off',
'unicorn/filename-case': 'off',
'unicorn/no-array-for-each': 'off',
'unicorn/no-null': 'off',
'unicorn/prefer-dom-node-append': 'off',
'unicorn/prefer-export-from': 'off',
'unicorn/prefer-query-selector': 'off',
'unicorn/prevent-abbreviations': 'off',
'vue/require-default-prop': 'off',
},
},
{
files: ['**/*.mjs'],
languageOptions: {
globals: {
...Object.fromEntries(Object.entries(globals.browser).map(([key]) => [key, 'off'])),
...globals.node,
},
ecmaVersion: 'latest',
sourceType: 'module',
},
},
{
files: ['**/__tests__/*.{j,t}s?(x)', '**/tests/unit/**/*.spec.{j,t}s?(x)'],
languageOptions: {
globals: {
...globals.jest,
},
},
},
{
files: ['packages/docs/build/**'],
languageOptions: {
globals: {
...Object.fromEntries(Object.entries(globals.browser).map(([key]) => [key, 'off'])),
...globals.node,
},
ecmaVersion: 5,
sourceType: 'commonjs',
},
rules: {
'no-console': 'off',
strict: 'error',
},
},
eslintPluginPrettierRecommended,
)