-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy patheslint.config.mjs
More file actions
89 lines (83 loc) · 3.27 KB
/
Copy patheslint.config.mjs
File metadata and controls
89 lines (83 loc) · 3.27 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
import pluginJs from '@eslint/js';
import prettierConfig from 'eslint-config-prettier';
import eslintPluginAstro from 'eslint-plugin-astro';
import jsxAlly from 'eslint-plugin-jsx-a11y';
import prettierRecommended from 'eslint-plugin-prettier/recommended';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import unicorn from 'eslint-plugin-unicorn';
import globals from 'globals';
import tseslint from 'typescript-eslint';
export default [
pluginJs.configs.recommended,
...tseslint.configs.recommended,
prettierConfig,
prettierRecommended,
unicorn.configs.recommended,
jsxAlly.flatConfigs.recommended,
...eslintPluginAstro.configs.recommended,
{
files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'],
languageOptions: {
globals: {
...globals.node,
...globals.browser,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
'simple-import-sort': simpleImportSort,
'react-hooks': reactHooksPlugin,
},
rules: {
'arrow-body-style': ['error', 'as-needed'],
'unicorn/no-array-reduce': 'off',
'unicorn/no-await-expression-member': 'off',
'unicorn/no-null': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/prefer-spread': 'off',
'unicorn/consistent-function-scoping': 'off',
'unicorn/no-abusive-eslint-disable': 'off',
'unicorn/prefer-global-this': 'off',
'unicorn/prefer-module': 'off',
'unicorn/no-anonymous-default-export': 'off',
'unicorn/prefer-add-event-listener': 'off',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/no-static-element-interactions': 'off',
'jsx-a11y/mouse-events-have-key-events': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/prefer-destructuring': 'off',
'@typescript-eslint/no-magic-numbers': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/no-unnecessary-condition': 'off',
'@typescript-eslint/method-signature-style': 'off',
'@typescript-eslint/no-unsafe-function-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/non-nullable-type-assertion-style': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/consistent-type-assertions': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/no-invalid-void-type': 'off',
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
'@typescript-eslint/prefer-promise-reject-errors': 'off',
'@typescript-eslint/triple-slash-reference': 'off',
'@typescript-eslint/init-declarations': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
},
},
{
ignores: ['dist/*', '.astro/*'],
},
];