mirror of
https://github.com/langgenius/dify.git
synced 2026-04-05 10:25:48 +08:00
chore: update deps (#33862)
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
// @ts-check
|
||||
|
||||
import antfu, { GLOB_MARKDOWN, GLOB_TESTS, GLOB_TS, GLOB_TSX, isInEditorEnv, isInGitHooksOrLintStaged } from '@antfu/eslint-config'
|
||||
import antfu, { GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_TESTS, GLOB_TS, GLOB_TSX, isInEditorEnv, isInGitHooksOrLintStaged } from '@antfu/eslint-config'
|
||||
import pluginReact from '@eslint-react/eslint-plugin'
|
||||
import pluginQuery from '@tanstack/eslint-plugin-query'
|
||||
import md from 'eslint-markdown'
|
||||
import tailwindcss from 'eslint-plugin-better-tailwindcss'
|
||||
import hyoban from 'eslint-plugin-hyoban'
|
||||
import markdownPreferences from 'eslint-plugin-markdown-preferences'
|
||||
import { reactRefresh } from 'eslint-plugin-react-refresh'
|
||||
import sonar from 'eslint-plugin-sonarjs'
|
||||
import storybook from 'eslint-plugin-storybook'
|
||||
import {
|
||||
@@ -23,22 +25,11 @@ process.env.TAILWIND_MODE ??= 'ESLINT'
|
||||
|
||||
const disableRuleAutoFix = !(isInEditorEnv() || isInGitHooksOrLintStaged())
|
||||
|
||||
const plugins = pluginReact.configs.all.plugins
|
||||
|
||||
export default antfu(
|
||||
{
|
||||
react: {
|
||||
// This react compiler rules are pretty slow
|
||||
// We can wait for https://github.com/Rel1cx/eslint-react/issues/1237
|
||||
reactCompiler: false,
|
||||
overrides: {
|
||||
'react/no-context-provider': 'off',
|
||||
'react/no-forward-ref': 'off',
|
||||
'react/no-use-context': 'off',
|
||||
|
||||
// prefer react-hooks-extra/no-direct-set-state-in-use-effect
|
||||
'react-hooks/set-state-in-effect': 'off',
|
||||
'react-hooks-extra/no-direct-set-state-in-use-effect': 'error',
|
||||
},
|
||||
},
|
||||
react: false,
|
||||
nextjs: true,
|
||||
ignores: ['public', 'types/doc-paths.ts', 'eslint-suppressions.json'],
|
||||
typescript: {
|
||||
@@ -60,6 +51,30 @@ export default antfu(
|
||||
},
|
||||
e18e: false,
|
||||
},
|
||||
{
|
||||
plugins: {
|
||||
'react': plugins?.['@eslint-react'],
|
||||
'react-dom': plugins?.['@eslint-react/dom'],
|
||||
'react-naming-convention': plugins?.['@eslint-react/naming-convention'],
|
||||
'react-rsc': plugins?.['@eslint-react/rsc'],
|
||||
'react-web-api': plugins?.['@eslint-react/web-api'],
|
||||
},
|
||||
},
|
||||
{
|
||||
files: [GLOB_TS, GLOB_TSX],
|
||||
rules: {
|
||||
...pluginReact.configs['recommended-typescript'].rules,
|
||||
'react/prefer-namespace-import': 'error',
|
||||
'react/set-state-in-effect': 'error',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: [...GLOB_TESTS, GLOB_MARKDOWN_CODE, 'vitest.setup.ts', 'test/i18n-mock.ts'],
|
||||
rules: {
|
||||
'react/component-hook-factories': 'off',
|
||||
},
|
||||
},
|
||||
reactRefresh.configs.next(),
|
||||
markdownPreferences.configs.standard,
|
||||
{
|
||||
files: [GLOB_MARKDOWN],
|
||||
@@ -194,3 +209,10 @@ export default antfu(
|
||||
'tailwindcss/no-unnecessary-whitespace',
|
||||
]
|
||||
: [])
|
||||
.renamePlugins({
|
||||
'@eslint-react': 'react',
|
||||
'@eslint-react/dom': 'react-dom',
|
||||
'@eslint-react/naming-convention': 'react-naming-convention',
|
||||
'@eslint-react/rsc': 'react-rsc',
|
||||
'@eslint-react/web-api': 'react-web-api',
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user