-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy patheslint.config.mjs
More file actions
96 lines (93 loc) · 2.29 KB
/
eslint.config.mjs
File metadata and controls
96 lines (93 loc) · 2.29 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import js from '@eslint/js';
import globals from 'globals';
import pluginVue from 'eslint-plugin-vue';
import pluginCypress from 'eslint-plugin-cypress';
import pluginJest from 'eslint-plugin-jest';
import { defineConfig, globalIgnores } from 'eslint/config';
export default defineConfig([
js.configs.recommended,
...pluginVue.configs['flat/recommended'],
globalIgnores([
'vendor/*',
'_build/*',
'cypress_cache/*',
'public/assets/*',
'public/vendor/*',
'resources/js/angular/*',
'**/__mocks__/**',
]),
{
files: ['**/*.{js,mjs,cjs,vue}'],
languageOptions: {
globals: {
...globals.browser,
},
},
rules: {
'indent': ['error', 2],
'vue/no-v-html': 'off',
'vue/require-v-for-key': 'off',
'eqeqeq': ['error', 'always'],
'arrow-spacing': ['error'],
'block-spacing': ['error'],
'brace-style': ['error', 'stroustrup'],
'comma-dangle': ['error', 'always-multiline'],
'curly' : ['error'],
'default-param-last': ['error'],
'eol-last': ['error'],
'keyword-spacing': ['error', {'before': true, 'after': true}],
'space-before-blocks': ['error', 'always'],
'linebreak-style': ['error', 'unix'],
'no-trailing-spaces': ['error'],
'no-var': ['error'],
'prefer-arrow-callback': ['error'],
'prefer-const': ['error'],
'prefer-template': ['error'],
'quotes': ['error', 'single', {'avoidEscape': true}],
'semi': ['error', 'always'],
'semi-style': ['error', 'last'],
'template-curly-spacing': ['error', 'never'],
},
},
{
files: ['**/cypress/**/*.js'],
...pluginCypress.configs.recommended,
},
{
files: ['**/*.spec.js'],
plugins: {
jest: pluginJest,
},
languageOptions: {
globals: {
...globals.node,
...pluginJest.environments.globals.globals,
},
},
},
{
files: [
'**/postcss.config.js',
'**/babel.config.js',
'**/jest.config.js',
],
languageOptions: {
globals: {
...globals.node,
},
},
},
{
files: [
'**/webpack.mix.js',
'**/tailwind.config.js',
'**/cypress.config.js',
],
languageOptions: {
sourceType: 'commonjs',
globals: {
...globals.node,
},
},
}
]);