-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
56 lines (53 loc) · 1.44 KB
/
eslint.config.js
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
import { FlatCompat } from '@eslint/eslintrc';
import js from '@eslint/js';
import imports from 'eslint-plugin-import';
import importsSort from 'eslint-plugin-simple-import-sort';
import globals from 'globals';
import { ignore } from './eslint-ignore.js';
const compat = new FlatCompat();
/** @type {import('eslint').Linter.FlatConfig[]} */
export default [
{ ignores: [ignore] },
js.configs.recommended,
...compat.extends(
'plugin:@typescript-eslint/strict',
'plugin:@typescript-eslint/stylistic',
'plugin:react-hooks/recommended',
),
{
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: { ...globals.node, ...globals.browser },
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
},
linterOptions: {
reportUnusedDisableDirectives: true,
},
plugins: { 'import': imports, 'import-sort': importsSort },
rules: {
'no-undef': 'off',
'object-shorthand': ['error', 'always'],
'import-sort/imports': [
'error',
{
groups: [
['^\\u0000'],
['^node:', '^@?\\w', '^', '^\\.', '^node:.*\\u0000$', '^@?\\w.*\\u0000$', '\\u0000$', '^\\..*\\u0000$'],
],
},
],
'@typescript-eslint/no-namespace': 'off',
},
},
{
files: ['**/*.config.[jt]s'],
rules: {
'import/no-default-export': 'off',
},
},
...compat.extends('prettier'),
];