@apdesign/code-style-react 1.2.3 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,107 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- env: {
4
- browser: true,
5
- node: true,
6
- es2021: true,
7
- },
8
- parser: '@typescript-eslint/parser',
9
- extends: [
10
- 'airbnb',
11
- 'airbnb/hooks',
12
- 'plugin:@typescript-eslint/recommended',
13
- 'plugin:import/errors',
14
- 'plugin:import/warnings',
15
- 'prettier',
16
- ],
17
- plugins: ['@typescript-eslint', 'import', 'jsx-a11y', 'react', 'react-hooks'],
18
- rules: {
19
- 'arrow-body-style': 'off',
20
-
21
- camelcase: 'off',
22
- 'class-methods-use-this': 'off',
23
-
24
- 'dot-notation': 'warn',
25
-
26
- 'import/order': 'warn',
27
- 'import/first': 'off',
28
- 'import/extensions': 'off',
29
- 'import/prefer-default-export': 'off',
30
- 'import/newline-after-import': 'warn',
31
-
32
- 'jsx-a11y/click-events-have-key-events': 'off',
33
- 'jsx-a11y/no-static-element-interactions': 'off',
34
- 'jsx-a11y/no-noninteractive-element-interactions': 'off',
35
-
36
- 'linebreak-style': 'off',
37
- 'lines-between-class-members': 'warn',
38
-
39
- 'max-classes-per-file': 'off',
40
-
41
- 'no-undef': 'off',
42
- 'no-plusplus': 'off',
43
-
44
- 'prefer-template': 'warn',
45
-
46
- 'react/function-component-definition': 'off',
47
- 'react-hooks/exhaustive-deps': 'off',
48
- 'react/prop-types': 'off',
49
- 'react/react-in-jsx-scope': 'off',
50
- 'react/require-default-props': 'off',
51
- 'react/jsx-boolean-value': 'off',
52
- 'react/jsx-filename-extension': 'off',
53
- 'react/jsx-props-no-spreading': 'off',
54
- 'react/self-closing-comp': 'off',
55
- 'react/jsx-no-useless-fragment': 'off',
56
- 'react/no-array-index-key': 'warn',
57
- 'react/jsx-curly-brace-presence': 'warn',
58
-
59
- 'spaced-comment': 'warn',
60
-
61
- '@typescript-eslint/no-explicit-any': 'warn',
62
-
63
- 'no-use-before-define': 'off',
64
- '@typescript-eslint/no-use-before-define': ['warn'],
65
-
66
- 'no-unused-vars': 'off',
67
- '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
68
-
69
- 'no-useless-constructor': 'off',
70
- '@typescript-eslint/no-useless-constructor': 'error',
71
-
72
- 'no-shadow': 'off',
73
- '@typescript-eslint/no-shadow': 'warn',
74
-
75
- 'no-empty-function': ['warn', { allow: ['constructors', 'arrowFunctions'] }],
76
- 'no-param-reassign': ['warn', { props: true, ignorePropertyModificationsFor: ['draft'] }],
77
- 'no-restricted-syntax': [
78
- 'warn',
79
- {
80
- selector: "CallExpression[callee.name='useMemo']",
81
- message: 'Avoid using useMemo unless caching a computed value improves performance.',
82
- },
83
- {
84
- selector: "CallExpression[callee.name='useCallback']",
85
- message:
86
- 'Avoid using useCallback unless you need to cache a function to prevent unnecessary re-renders.',
87
- },
88
- ],
89
- },
90
- parserOptions: {
91
- sourceType: 'module',
92
- },
93
- ignorePatterns: ['dist/', 'node_modules/', '*.d.ts', 'mock', '.eslintrc.cjs'],
94
- settings: {
95
- react: {
96
- version: 'detect',
97
- },
98
- 'import/resolver': {
99
- alias: {
100
- map: [
101
- ['@', './src'], // 将 '@' 映射到 'src' 目录
102
- ],
103
- extensions: ['.ts', '.tsx', '.js', '.jsx', '.d.ts'],
104
- },
105
- },
106
- },
107
- };