-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patheslint.config.js
More file actions
87 lines (82 loc) · 2.46 KB
/
eslint.config.js
File metadata and controls
87 lines (82 loc) · 2.46 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
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import pluginReact from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import importPlugin from 'eslint-plugin-import';
import jsxA11y from 'eslint-plugin-jsx-a11y';
import { defineConfig } from 'eslint/config';
import prettierConfig from 'eslint-config-prettier';
import prettierPlugin from 'eslint-plugin-prettier';
export default defineConfig([
{
ignores: [
'node_modules/**',
'build/**',
'public/**',
'dist/**',
'storybook-static/**',
'dist-ssr/**',
'coverage/**',
'**/*.test.js',
'**/__snapshots__/**',
],
},
js.configs.recommended,
reactHooks.configs.flat.recommended,
...tseslint.configs.recommended,
{
files: ['**/*.{js,mjs,cjs,ts,jsx,tsx,ts}'],
plugins: {
react: pluginReact,
'react-hooks': reactHooks,
import: importPlugin,
'jsx-a11y': jsxA11y,
prettier: prettierPlugin,
},
settings: {
react: {
version: 'detect',
},
},
rules: {
// React rules
'react/self-closing-comp': ['error', { component: true, html: true }],
'react/react-in-jsx-scope': 'off',
'react/jsx-uses-react': 'off',
'react/jsx-uses-vars': 'warn',
'react/jsx-no-undef': 'error',
'react/jsx-curly-brace-presence': 'error',
'react/prop-types': 'off',
'react/require-default-props': 0,
'react/jsx-filename-extension': 0,
'react/no-array-index-key': 0,
'react/jsx-props-no-spreading': 0,
// TypeScript rules
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-explicit-any': 'warn',
// Import rules
'import/order': [
'warn',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
'newlines-between': 'always',
},
],
'import/no-unresolved': 0,
'import/no-extraneous-dependencies': ['warn', { devDependencies: true }],
'import/extensions': 0,
'import/prefer-default-export': 0,
// A11y rules
'jsx-a11y/alt-text': 'warn',
'jsx-a11y/anchor-is-valid': 'warn',
// General rules
'prefer-const': 'error',
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-debugger': 'warn',
'no-nested-ternary': 0,
'prettier/prettier': 'error',
},
},
prettierConfig,
]);