Update
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import type { ReactRulesObject } from '@aet/eslint-define-config/src/rules/react';
|
||||
import type { ReactRefreshRulesObject } from '@aet/eslint-define-config/src/rules/react-refresh';
|
||||
import type { Linter, ESLint } from 'eslint';
|
||||
|
||||
import { error, off, warn } from '../constants';
|
||||
import { def } from '../middleware';
|
||||
@ -17,10 +18,11 @@ export async function react() {
|
||||
const hooks = await import('../../packages/eslint-plugin-react-hooks');
|
||||
|
||||
return defineConfig([
|
||||
reactPlugin.configs['recommended-type-checked'] as any,
|
||||
reactPlugin.configs['recommended-type-checked'] as unknown as Linter.Config,
|
||||
hooks.flatConfigs.recommended,
|
||||
a11y.flatConfigs.recommended,
|
||||
{
|
||||
name: 'eslint-rules/react',
|
||||
files: ['*.tsx'],
|
||||
rules: reactRules,
|
||||
},
|
||||
@ -34,9 +36,9 @@ const refreshRules: Partial<ReactRefreshRulesObject> = {
|
||||
export async function reactRefresh() {
|
||||
const refreshPlugin = def(await import('eslint-plugin-react-refresh'));
|
||||
return defineConfig({
|
||||
name: 'eslint-rules/react-refresh',
|
||||
plugins: {
|
||||
// @ts-expect-error no types
|
||||
'react-refresh': refreshPlugin,
|
||||
'react-refresh': refreshPlugin as unknown as ESLint.Plugin,
|
||||
},
|
||||
rules: refreshRules,
|
||||
});
|
||||
|
Reference in New Issue
Block a user