generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 285
Expand file tree
/
Copy patheslint.config.mjs
More file actions
73 lines (72 loc) · 1.91 KB
/
eslint.config.mjs
File metadata and controls
73 lines (72 loc) · 1.91 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
import github from 'eslint-plugin-github'
import jest from 'eslint-plugin-jest'
export default [
github.getFlatConfigs().recommended,
...github.getFlatConfigs().typescript,
{
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx']
},
'import/resolver': {
typescript: {
project: './tsconfig.json',
alwaysTryTypes: true
},
node: {
extensions: ['.js', '.mjs', '.ts', '.tsx']
}
}
}
},
{
files: ['src/**/*.ts'],
rules: {
'i18n-text/no-en': 'off',
'eslint-comments/no-use': 'off',
'import/no-namespace': 'off',
'import/no-named-as-default': 'off',
'no-shadow': 'off',
'no-unused-vars': 'off',
'prefer-template': 'off',
camelcase: 'off',
semi: 'off',
'@typescript-eslint/array-type': ['error', {default: 'array'}],
'@typescript-eslint/no-unused-vars': ['error', {varsIgnorePattern: '^_'}],
'@typescript-eslint/no-shadow': ['error'],
// Modern replacements for deprecated rules from the legacy config.
'@typescript-eslint/no-empty-object-type': 'error',
'@typescript-eslint/no-require-imports': 'error'
}
},
{
files: ['__tests__/**/*.test.ts'],
...jest.configs['flat/recommended'],
plugins: {
jest
},
languageOptions: {
globals: jest.environments.globals.globals
},
rules: {
'i18n-text/no-en': 'off',
'import/no-namespace': 'off',
'@typescript-eslint/array-type': ['error', {default: 'array'}],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-function-return-type': 'off'
}
},
{
ignores: [
'dist/**',
'lib/**',
'node_modules/**',
'__tests__/__snapshots__/**',
'__tests__/__results__/**',
'assets/**',
'reports/**',
'eslint.config.mjs',
'jest.config.cjs'
]
}
]