mirror of
https://github.com/langgenius/dify.git
synced 2026-06-07 16:32:01 +08:00
chore(cli): move eslint config into cli package (#36878)
This commit is contained in:
parent
de47d43b65
commit
a8a2ca7b98
74
cli/eslint.config.mjs
Normal file
74
cli/eslint.config.mjs
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
// @ts-check
|
||||||
|
|
||||||
|
import antfu, { GLOB_MARKDOWN } from '@antfu/eslint-config'
|
||||||
|
import md from 'eslint-markdown'
|
||||||
|
import markdownPreferences from 'eslint-plugin-markdown-preferences'
|
||||||
|
|
||||||
|
export default antfu(
|
||||||
|
{
|
||||||
|
ignores: original => [
|
||||||
|
'context/**',
|
||||||
|
'docs/**',
|
||||||
|
'dist/**',
|
||||||
|
'coverage/**',
|
||||||
|
...original,
|
||||||
|
],
|
||||||
|
typescript: {
|
||||||
|
overrides: {
|
||||||
|
'ts/consistent-type-definitions': ['error', 'type'],
|
||||||
|
'ts/no-explicit-any': 'error',
|
||||||
|
'ts/no-redeclare': 'off',
|
||||||
|
},
|
||||||
|
erasableOnly: true,
|
||||||
|
},
|
||||||
|
test: {
|
||||||
|
overrides: {
|
||||||
|
'test/prefer-lowercase-title': 'off',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
stylistic: {
|
||||||
|
overrides: {
|
||||||
|
'antfu/top-level-function': 'off',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
e18e: false,
|
||||||
|
},
|
||||||
|
markdownPreferences.configs.standard,
|
||||||
|
{
|
||||||
|
files: [GLOB_MARKDOWN],
|
||||||
|
plugins: { md },
|
||||||
|
rules: {
|
||||||
|
'md/no-url-trailing-slash': 'error',
|
||||||
|
'markdown-preferences/prefer-link-reference-definitions': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
minLinks: 1,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'markdown-preferences/ordered-list-marker-sequence': [
|
||||||
|
'error',
|
||||||
|
{ increment: 'never' },
|
||||||
|
],
|
||||||
|
'markdown-preferences/definitions-last': 'error',
|
||||||
|
'markdown-preferences/sort-definitions': 'error',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
rules: {
|
||||||
|
'node/prefer-global/process': 'off',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['src/**/*.ts'],
|
||||||
|
rules: {
|
||||||
|
'no-restricted-imports': ['error', {
|
||||||
|
patterns: [
|
||||||
|
{
|
||||||
|
group: ['../**', './*/**', '..'],
|
||||||
|
message: 'Use the @/ (or @test/) alias for parent-directory or nested relative imports; keep ./ only for same-folder siblings.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
)
|
||||||
@ -22,10 +22,6 @@ export default antfu(
|
|||||||
'!packages/**',
|
'!packages/**',
|
||||||
'!web/**',
|
'!web/**',
|
||||||
'!e2e/**',
|
'!e2e/**',
|
||||||
'!cli/**',
|
|
||||||
'cli/context/**',
|
|
||||||
'cli/docs/**',
|
|
||||||
'cli/oclif.manifest.json',
|
|
||||||
'!eslint.config.mjs',
|
'!eslint.config.mjs',
|
||||||
'!package.json',
|
'!package.json',
|
||||||
'!pnpm-workspace.yaml',
|
'!pnpm-workspace.yaml',
|
||||||
@ -78,17 +74,4 @@ export default antfu(
|
|||||||
'node/prefer-global/process': 'off',
|
'node/prefer-global/process': 'off',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
files: ['cli/src/**/*.ts'],
|
|
||||||
rules: {
|
|
||||||
'no-restricted-imports': ['error', {
|
|
||||||
patterns: [
|
|
||||||
{
|
|
||||||
group: ['../**', './*/**', '..'],
|
|
||||||
message: 'Use the @/ (or @test/) alias for parent-directory or nested relative imports; keep ./ only for same-folder siblings.',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user