1- import config from '@antfu/eslint-config'
1+ import config from '@antfu/eslint-config' ;
22
33export default await config ( {
44 react : true ,
55 rules : {
6+ 'antfu/if-newline' : 'off' ,
7+ 'antfu/top-level-function' : 'off' ,
8+ 'antfu/consistent-list-newline' : 'off' ,
9+ 'unicorn/number-literal-case' : 'off' ,
10+ // 'style/quote-props': ['error', 'consistent-as-needed'],
11+ // 'style/member-delimiter-style': ['error', {
12+ // multiline: {
13+ // delimiter: 'none',
14+ // requireLast: false,
15+ // },
16+ // }],
17+
18+ 'style/quote-props' : 'off' ,
19+ 'style/member-delimiter-style' : 'off' , // TODO
20+
21+ 'indent' : [ 'error' , 2 , { SwitchCase : 1 } ] ,
22+ 'max-len' : [ 'error' , {
23+ code : 120 ,
24+ ignoreComments : true ,
25+ ignorePattern : '\\sd=\".+\"' ,
26+ } ] ,
27+ 'array-bracket-newline' : [ 2 , 'consistent' ] ,
28+ // 'no-null/no-null': 2,
29+ 'no-console' : 'error' ,
30+ 'semi' : [ 'error' , 'always' ] ,
631 'style/semi' : [ 'error' , 'always' ] ,
32+ 'no-implicit-coercion' : 'error' ,
33+ // 'react-hooks/exhaustive-deps': 'off',
34+ // 'react-hooks-static-deps/exhaustive-deps': ['error', {
35+ // 'additionalHooks': '(useSyncEffect|useAsync|useDebouncedCallback|useThrottledCallback|useEffectWithPrevDeps|useLayoutEffectWithPrevDeps|useDerivedState|useDerivedSignal|useThrottledResolver|useDebouncedResolver|useThrottleForHeavyAnimation)$',
36+ // 'staticHooks': {
37+ // 'getActions': true,
38+ // 'useFlag': [false, true, true],
39+ // 'useForceUpdate': true,
40+ // 'useReducer': [false, true],
41+ // 'useLastCallback': true
42+ // }
43+ // }],
44+ 'arrow-body-style' : 'off' ,
45+ 'no-else-return' : 'off' ,
46+ 'no-plusplus' : 'off' ,
47+ 'no-void' : 'off' ,
48+ 'no-continue' : 'off' ,
49+ 'default-case' : 'off' ,
50+ 'no-param-reassign' : 'off' ,
51+ 'no-prototype-builtins' : 'off' ,
52+ 'no-await-in-loop' : 'off' ,
53+ 'no-nested-ternary' : 'off' ,
54+ 'function-paren-newline' : [ 'error' , 'consistent' ] ,
55+ 'prefer-destructuring' : 'off' ,
56+ 'no-restricted-syntax' : [
57+ 'error' ,
58+ {
59+ selector : 'ForInStatement' ,
60+ message : 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.' ,
61+ } ,
62+ {
63+ selector : 'LabeledStatement' ,
64+ message : 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.' ,
65+ } ,
66+ {
67+ selector : 'WithStatement' ,
68+ message : '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.' ,
69+ } ,
70+ ] ,
71+ 'import/no-extraneous-dependencies' : 'off' ,
72+ 'import/prefer-default-export' : 'off' ,
73+ 'import/named' : 'off' ,
74+ 'import/no-webpack-loader-syntax' : 'off' ,
75+ // 'import/no-cycle': ['error', {
76+ // 'allowUnsafeDynamicCyclicDependency': true
77+ // }],
78+ 'react/prop-types' : 'off' ,
79+ 'react/jsx-one-expression-per-line' : 'off' ,
80+ 'react/button-has-type' : 'off' ,
81+ 'react/require-default-props' : 'off' ,
82+ 'react/function-component-definition' : 'off' ,
83+ 'react/style-prop-object' : 'off' ,
84+ 'react/no-unknown-property' : 'off' ,
85+ // 'react/jsx-no-bind': ['error', {
86+ // 'ignoreRefs': true,
87+ // 'allowArrowFunctions': false,
88+ // 'allowFunctions': false,
89+ // 'allowBind': false,
90+ // 'ignoreDOMComponents': true
91+ // }],
92+ 'jsx-a11y/click-events-have-key-events' : 'off' ,
93+ 'jsx-a11y/mouse-events-have-key-events' : 'off' ,
94+ 'jsx-a11y/no-static-element-interactions' : 'off' ,
95+ 'jsx-a11y/label-has-associated-control' : 'off' ,
96+ 'jsx-a11y/anchor-is-valid' : 'off' ,
97+ 'jsx-a11y/no-noninteractive-element-to-interactive-role' : 'off' ,
98+ 'jsx-a11y/media-has-caption' : 'off' ,
99+ // 'no-async-without-await/no-async-without-await': 1,
100+ '@typescript-eslint/no-use-before-define' : [ 'error' , {
101+ functions : false ,
102+ } ] ,
103+ '@typescript-eslint/camelcase' : 'off' ,
104+ // '@typescript-eslint/member-delimiter-style': 'error',
105+ '@typescript-eslint/default-param-last' : 'off' ,
106+ // '@typescript-eslint/return-await': ['error', 'in-try-catch'],
107+ // '@typescript-eslint/consistent-type-imports': ['error', {
108+ // 'prefer': 'type-imports',
109+ // 'disallowTypeAnnotations': false
110+ // }],
111+ // 'simple-import-sort/imports': ['error', {
112+ // 'groups': [
113+ // ["^\\u0000"],
114+ // [
115+ // "^react",
116+ // "^@?\\w",
117+ // "dist(/.*|$)",
118+ // "^(\\.+/)+(lib/(teact|gramjs))(/.*|$)",
119+ // "^(\\.+/)+global$"
120+ // ],
121+ // [
122+ // "^(\\.+/)+.+\\u0000$",
123+ // "^(\\.+/|\\w+/)+(types)(/.*|$)",
124+ // "^(\\.+/|\\w+/)+(types)\\u0000"
125+ // ],
126+ // [
127+ // "^(\\.+/)+config",
128+ // "^(\\.+/)+(lib)(?!/(gramjs|teact))(/.*|$)",
129+ // "^(\\.+/)+global/.+",
130+ // "^(\\.+/)+(util)(/.*|$)",
131+ // "^\\.\\.(?!/?$)",
132+ // "^\\.\\./?$",
133+ // "^\\./(?=.*/)(?!/?$)",
134+ // "^\\.(?!/?$)",
135+ // "^\\./?$"
136+ // ],
137+ // [".+(/hooks/)(.*|$)"],
138+ // ["\/[A-Z](([a-z]+[A-Z]?)*)" ],
139+ // ["^.+\\.s?css$"],
140+ // ["^(\\.+/)+(assets)(/.*|$)"]
141+ // ]
142+ // }]
7143 } ,
8144 ignores : [
9145 '**/*.tsx' ,
@@ -23,5 +159,5 @@ export default await config({
23159 'dist-electron' ,
24160 'public' ,
25161 'deploy/update_version.js' ,
26- ]
27- } )
162+ ] ,
163+ } ) ;
0 commit comments