-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patheslint.config.js
More file actions
77 lines (75 loc) · 2.47 KB
/
eslint.config.js
File metadata and controls
77 lines (75 loc) · 2.47 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
// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
import storybook from 'eslint-plugin-storybook';
import js from '@eslint/js';
import globals from 'globals';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import tseslint from 'typescript-eslint';
import jsxA11y from 'eslint-plugin-jsx-a11y';
import eslintPluginImport from 'eslint-plugin-import';
import prettierPlugin from 'eslint-plugin-prettier';
import prettierConfig from 'eslint-config-prettier';
export default tseslint.config(
{
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: globals.browser,
},
plugins: {
react,
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
import: eslintPluginImport,
prettier: prettierPlugin,
'jsx-a11y': jsxA11y,
'@typescript-eslint': tseslint.plugin,
},
settings: {
react: {
version: 'detect',
},
},
ignores: ['node_modules', 'dist', 'dist-ssr', 'storybook-static', '*.config.js', '*.config.ts'],
extends: [js.configs.recommended, ...tseslint.configs.recommended, prettierConfig],
rules: {
...reactHooks.configs.recommended.rules,
...jsxA11y.configs.recommended.rules,
'react/react-in-jsx-scope': 'off',
'no-console': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
curly: 'error',
'import/order': [
'warn',
{
groups: [['builtin', 'external'], 'internal', ['parent', 'sibling', 'index']],
'newlines-between': 'always',
},
],
'react/self-closing-comp': 'warn',
'@typescript-eslint/no-explicit-any': 'off',
'react/jsx-pascal-case': 'error',
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
'prettier/prettier': [
'error',
{
printWidth: 100,
trailingComma: 'all',
tabWidth: 2,
semi: true,
singleQuote: true,
bracketSpacing: true,
arrowParens: 'always',
useTabs: false,
},
],
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/no-noninteractive-element-interactions': 'off',
'jsx-a11y/no-static-element-interactions': 'off',
},
},
storybook.configs['flat/recommended'],
);