-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
85 lines (84 loc) · 2.26 KB
/
eslint.config.mjs
File metadata and controls
85 lines (84 loc) · 2.26 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
import globals from 'globals'
import pluginJs from '@eslint/js'
import tseslint from 'typescript-eslint'
import pluginReact from 'eslint-plugin-react'
import pluginReactHook from 'eslint-plugin-react-hooks'
import PluginPrettier from 'eslint-plugin-prettier/recommended'
import pluginJest from 'eslint-plugin-jest'
import pluginTestingLibrary from 'eslint-plugin-testing-library'
export default [
{
ignores: ['**/*.debug*']
},
{
files: [
'src/**/*.{js,mjs,cjs,ts,jsx,tsx}',
'__tests__/**/*.test.{ts,js,tsx}'
],
plugins: {
'react-hooks': pluginReactHook
},
rules: pluginReactHook.configs.recommended.rules
},
{
languageOptions: {
globals: { ...globals.browser, ...globals.node }
},
rules: {
'no-console': 'error',
'max-lines-per-function': ['error', { max: 200, skipComments: true }]
}
},
pluginJs.configs.recommended,
pluginReact.configs.flat['jsx-runtime'],
...tseslint.config({
files: [
'src/**/*.{js,mjs,cjs,ts,jsx,tsx}',
'__tests__/**/*.test.{ts,js,tsx}',
'backend/**/**',
'public/**/**',
'server/**/**',
'types/**/**',
'scripts/**/**'
],
extends: [tseslint.configs.recommendedTypeChecked],
languageOptions: {
parserOptions: {
projectService: true
}
},
rules: {
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_'
}
],
'@typescript-eslint/no-this-alias': [
'error',
{
allowedNames: ['ctx']
}
]
}
}),
PluginPrettier,
{
files: ['__tests__/**/*.test.{ts,js,tsx}', 'jest-setup.js'],
plugins: { jest: pluginJest, 'testing-library': pluginTestingLibrary },
languageOptions: {
globals: pluginJest.environments.globals.globals
},
rules: {
...pluginJest.configs['flat/recommended'].rules,
'jest/no-mocks-import': 'off',
'jest/no-commented-out-tests': 'off',
...pluginTestingLibrary.configs['flat/react'].rules,
'testing-library/no-container': 'warn',
'testing-library/no-node-access': 'warn'
}
}
]