-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.js
More file actions
61 lines (53 loc) · 1.63 KB
/
eslint.config.js
File metadata and controls
61 lines (53 loc) · 1.63 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
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import reactPlugin from 'eslint-plugin-react';
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
import prettierPlugin from 'eslint-plugin-prettier';
import globals from 'globals';
/** @type {import("eslint").Linter.FlatConfig[]} */
export default [
js.configs.recommended,
{
files: ['**/*.{ts,tsx,js,jsx}'],
settings: {
react: {
version: 'detect',
},
},
languageOptions: {
ecmaVersion: 2020,
sourceType: 'module',
globals: {
...globals.browser,
...globals.node,
},
parser: tseslint.parser,
parserOptions: {
project: ['./tsconfig.app.json', './tsconfig.node.json'],
},
},
plugins: {
'@typescript-eslint': tseslint.plugin,
react: reactPlugin,
'jsx-a11y': jsxA11yPlugin,
prettier: prettierPlugin,
},
rules: {
'prettier/prettier': 'error',
quotes: ['error', 'single', { avoidEscape: true }],
'jsx-quotes': ['error', 'prefer-double'],
'max-len': ['warn', { code: 100 }],
'arrow-body-style': ['error', 'as-needed'],
'react/react-in-jsx-scope': 'off',
'react/jsx-props-no-spreading': 'off',
'react/require-default-props': 'off',
'react/function-component-definition': ['error', { namedComponents: 'arrow-function' }],
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'@typescript-eslint/explicit-function-return-type': 'off',
},
extends: ['prettier'],
},
{
ignores: ['node_modules', 'dist', '**/*.config.js', 'vite.config.ts'],
},
];