第4项:对页面、表单及两版共享规则启用严格类型检查
This commit is contained in:
1 parent
389952f31c
commit
f570929cfe
77 files changed
+7629
-2981
No files matched your search
@@ -14,18 +14,19 @@ export default tseslint.config(
|
||||
plugins: { 'react-hooks': reactHooks, 'react-refresh': reactRefresh },
|
||||
rules: {
|
||||
...reactHooks.configs.recommended.rules,
|
||||
'react-hooks/exhaustive-deps': 'error',
|
||||
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
|
||||
},
|
||||
},
|
||||
{ files: ['src/**/*.{js,jsx}'], languageOptions: { globals: { ...globals.browser } } },
|
||||
// TypeScript requires var for declarations installed as properties of globalThis by classic scripts.
|
||||
{ files: ['src/shared/browserGlobals.d.ts'], rules: { 'no-var': 'off' } },
|
||||
{
|
||||
files: ['**/*.jsx'],
|
||||
languageOptions: {
|
||||
parserOptions: { ecmaFeatures: { jsx: true } },
|
||||
},
|
||||
plugins: { 'react-hooks': reactHooks },
|
||||
files: ['src/**/*.{ts,tsx}'],
|
||||
rules: {
|
||||
'react-hooks/rules-of-hooks': 'error',
|
||||
'@typescript-eslint/ban-ts-comment': [
|
||||
'error',
|
||||
{ 'ts-check': false, 'ts-expect-error': true, 'ts-ignore': true, 'ts-nocheck': true },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user