mirror of
https://github.com/langgenius/dify.git
synced 2026-04-05 20:09:20 +08:00
chore: update lint config (#31735)
This commit is contained in:
@@ -4,7 +4,7 @@ import pluginQuery from '@tanstack/eslint-plugin-query'
|
||||
import sonar from 'eslint-plugin-sonarjs'
|
||||
import storybook from 'eslint-plugin-storybook'
|
||||
import tailwind from 'eslint-plugin-tailwindcss'
|
||||
import difyI18n from './eslint-rules/index.js'
|
||||
import dify from './eslint-rules/index.js'
|
||||
|
||||
export default antfu(
|
||||
{
|
||||
@@ -104,44 +104,25 @@ export default antfu(
|
||||
'tailwindcss/migration-from-tailwind-2': 'warn',
|
||||
},
|
||||
},
|
||||
// dify i18n namespace migration
|
||||
// {
|
||||
// files: ['**/*.ts', '**/*.tsx'],
|
||||
// ignores: ['eslint-rules/**', 'i18n/**', 'i18n-config/**'],
|
||||
// plugins: {
|
||||
// 'dify-i18n': difyI18n,
|
||||
// },
|
||||
// rules: {
|
||||
// // 'dify-i18n/no-as-any-in-t': ['error', { mode: 'all' }],
|
||||
// 'dify-i18n/no-as-any-in-t': 'error',
|
||||
// // 'dify-i18n/no-legacy-namespace-prefix': 'error',
|
||||
// // 'dify-i18n/require-ns-option': 'error',
|
||||
// },
|
||||
// },
|
||||
// i18n JSON validation rules
|
||||
{
|
||||
plugins: { dify },
|
||||
},
|
||||
{
|
||||
files: ['i18n/**/*.json'],
|
||||
plugins: {
|
||||
'dify-i18n': difyI18n,
|
||||
},
|
||||
rules: {
|
||||
'sonarjs/max-lines': 'off',
|
||||
'max-lines': 'off',
|
||||
'jsonc/sort-keys': 'error',
|
||||
|
||||
'dify-i18n/valid-i18n-keys': 'error',
|
||||
'dify-i18n/no-extra-keys': 'error',
|
||||
'dify-i18n/consistent-placeholders': 'error',
|
||||
'dify/valid-i18n-keys': 'error',
|
||||
'dify/no-extra-keys': 'error',
|
||||
'dify/consistent-placeholders': 'error',
|
||||
},
|
||||
},
|
||||
// package.json version prefix validation
|
||||
{
|
||||
files: ['**/package.json'],
|
||||
plugins: {
|
||||
'dify-i18n': difyI18n,
|
||||
},
|
||||
rules: {
|
||||
'dify-i18n/no-version-prefix': 'error',
|
||||
'dify/no-version-prefix': 'error',
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user