mirror of https://github.com/langgenius/dify.git
chore: enable ts/no-explicit-any, remove no-unused-vars (#30042)
This commit is contained in:
parent
efac8766a1
commit
a3d4f4f3bd
|
|
@ -19,6 +19,7 @@ export default antfu(
|
||||||
typescript: {
|
typescript: {
|
||||||
overrides: {
|
overrides: {
|
||||||
'ts/consistent-type-definitions': ['error', 'type'],
|
'ts/consistent-type-definitions': ['error', 'type'],
|
||||||
|
'ts/no-explicit-any': 'warn',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
test: {
|
test: {
|
||||||
|
|
@ -40,7 +41,6 @@ export default antfu(
|
||||||
'next/inline-script-id': 'warn',
|
'next/inline-script-id': 'warn',
|
||||||
'no-console': 'warn',
|
'no-console': 'warn',
|
||||||
'no-irregular-whitespace': 'warn',
|
'no-irregular-whitespace': 'warn',
|
||||||
'no-unused-vars': 'warn',
|
|
||||||
'node/prefer-global/buffer': 'warn',
|
'node/prefer-global/buffer': 'warn',
|
||||||
'node/prefer-global/process': 'warn',
|
'node/prefer-global/process': 'warn',
|
||||||
'react/no-create-ref': 'warn',
|
'react/no-create-ref': 'warn',
|
||||||
|
|
|
||||||
|
|
@ -184,24 +184,6 @@ async function getKeysFromLanguage(language) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeKeysFromObject(obj, keysToRemove, prefix = '') {
|
|
||||||
let modified = false
|
|
||||||
for (const key in obj) {
|
|
||||||
const fullKey = prefix ? `${prefix}.${key}` : key
|
|
||||||
|
|
||||||
if (keysToRemove.includes(fullKey)) {
|
|
||||||
delete obj[key]
|
|
||||||
modified = true
|
|
||||||
console.log(`🗑️ Removed key: ${fullKey}`)
|
|
||||||
}
|
|
||||||
else if (typeof obj[key] === 'object' && obj[key] !== null) {
|
|
||||||
const subModified = removeKeysFromObject(obj[key], keysToRemove, fullKey)
|
|
||||||
modified = modified || subModified
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return modified
|
|
||||||
}
|
|
||||||
|
|
||||||
async function removeExtraKeysFromFile(language, fileName, extraKeys) {
|
async function removeExtraKeysFromFile(language, fileName, extraKeys) {
|
||||||
const filePath = path.resolve(__dirname, '../i18n', language, `${fileName}.ts`)
|
const filePath = path.resolve(__dirname, '../i18n', language, `${fileName}.ts`)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue