forked from terrestris/react-geo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
94 lines (93 loc) · 2.54 KB
/
eslint.config.mjs
File metadata and controls
94 lines (93 loc) · 2.54 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
// @ts-check
import globals from 'globals';
import reactHooks from 'eslint-plugin-react-hooks';
import importPlugin from 'eslint-plugin-import';
import eslintReact from 'eslint-plugin-react';
import eslintMarkdown from 'eslint-plugin-markdown';
import eslintTerrestris from '@terrestris/eslint-config-typescript';
import eslintReactTerrestris from '@terrestris/eslint-config-typescript-react';
import eslint from '@eslint/js';
import tsEslint from 'typescript-eslint';
import stylisticEslint from '@stylistic/eslint-plugin'
export default tsEslint.config({
extends: [
eslint.configs.recommended,
...tsEslint.configs.recommended,
...tsEslint.configs.stylistic,
importPlugin.flatConfigs.recommended
],
files: [
'**/*.{ts,tsx}',
],
ignores: [
'**/*.spec.{ts,tsx}',
'**/coverage/**/*.{js,ts*}',
'**/dist/**/*.spec.{js,ts*}',
'**/dist/**/*.{js,ts*}',
'**/e2e-tests/**.ts',
'**/global-setup.ts',
'**/playwright.config.ts',
'**/test/setup.ts',
'src/Util/antdTestQueries.ts'
],
settings: {
react: {
version: 'detect'
}
},
languageOptions: {
ecmaVersion: 2022,
globals: globals.browser,
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname
}
},
plugins: {
'react-hooks': reactHooks,
'@stylistic': stylisticEslint,
react: eslintReact,
'@typescript-eslint/eslint-plugin': tsEslint
},
rules: {
...eslintTerrestris.rules,
...eslintReactTerrestris.rules,
...reactHooks.configs.recommended.rules,
...eslintMarkdown.configs.recommended.rules,
'no-debugger': 'error',
'react/jsx-closing-tag-location': ['warn'],
'react/jsx-closing-bracket-location': ['warn'],
'react-hooks/rules-of-hooks': ['warn'],
'react-hooks/exhaustive-deps': ['warn'],
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'import/no-named-as-default': 'off',
'import/no-unresolved': 'off',
'import/named': 'off',
'import/order': ['warn', {
groups: [
'builtin',
'external',
'parent',
'sibling',
'index',
'object'
],
pathGroups: [{
pattern: 'react',
group: 'external',
position: 'before'
}, {
pattern: '@terrestris/**',
group: 'external',
position: 'after'
}],
pathGroupsExcludedImportTypes: ['react'],
'newlines-between': 'always-and-inside-groups',
alphabetize: {
order: 'asc',
caseInsensitive: true
}
}]
}
});