-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy patheslint.config.js
More file actions
78 lines (77 loc) · 1.95 KB
/
Copy patheslint.config.js
File metadata and controls
78 lines (77 loc) · 1.95 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
import js from '@eslint/js';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import cypress from 'eslint-plugin-cypress';
import vitest from '@vitest/eslint-plugin';
import globals from 'globals';
export default [
js.configs.recommended,
{
files: ['**/*.{js,jsx}'],
languageOptions: {
ecmaVersion: 2021,
sourceType: 'module',
globals: {
...globals.browser,
...globals.node,
},
parserOptions: {
ecmaFeatures: {
jsx: true
}
}
},
plugins: {
react,
'react-hooks': reactHooks,
vitest
},
rules: {
...react.configs.recommended.rules,
...reactHooks.configs.recommended.rules,
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
'max-len': ['error', { code: 300 }],
'react/prop-types': 0,
'react/jsx-no-target-blank': 0,
'object-curly-newline': 0,
'import/prefer-default-export': 0,
'indent': ['error', 2],
'no-unused-vars': 'warn',
'no-console': 'warn',
'camelcase': ['warn', { properties: 'always' }],
...vitest.configs.recommended.rules,
},
settings: {
react: {
version: 'detect'
}
}
},
{
files: ['cypress/**/*.{js,jsx}', '**/*.cy.{js,jsx}', '**/*.test.js'],
plugins: {
cypress
},
languageOptions: {
globals: {
...globals.browser,
...globals.node,
cy: 'readonly',
Cypress: 'readonly',
describe: 'readonly',
it: 'readonly',
beforeEach: 'readonly',
afterEach: 'readonly',
expect: 'readonly',
}
},
rules: {
...cypress.configs.recommended.rules,
'vitest/expect-expect': 'off',
'vitest/valid-expect-in-promise': 'off',
'vitest/valid-expect': 'off',
'vitest/no-focused-tests': ['error', { fixable: false }],
'vitest/no-standalone-expect': 'off',
}
}
];