Implementation:Langgenius Dify ESLint Suppressions
| Knowledge Sources | |
|---|---|
| Domains | Frontend, Linting, BuildConfig |
| Last Updated | 2026-02-12 07:00 GMT |
Overview
JSON configuration file that records existing ESLint rule violations per file, allowing the project to adopt stricter linting rules incrementally without blocking the build on legacy code.
Description
web/eslint-suppressions.json is a suppression baseline file used with ESLint's suppression system. It maps relative file paths to the specific ESLint rules that have known violations in those files, along with the count of suppressed occurrences.
The file structure is:
{
"path/to/file.ts": {
"rule-name": {
"count": N
}
}
}
This approach allows the Dify team to:
- Adopt new linting rules without requiring immediate fixes across the entire codebase
- Track technical debt by recording exactly which files have how many violations
- Prevent regression by ensuring no new violations are introduced (only suppressed counts are allowed)
- Gradually reduce suppressions by fixing violations file-by-file
Common suppressed rules observed in the file include:
ts/no-explicit-any- TypeScript files usinganytypeno-console- Files with console.log statementsregexp/no-unused-capturing-group- Regex patterns with unused captures
The file covers test files (__tests__/), application components, and utility modules throughout the frontend codebase.
Usage
This file is automatically managed by ESLint's suppression tooling. It should not be manually edited. When fixing linted code, the suppression counts decrease automatically. New violations in unsuppressed files will fail the lint check.
Code Reference
Source Location
- Repository: Langgenius_Dify
- File: web/eslint-suppressions.json
Data Structure
{
"__tests__/check-i18n.test.ts": {
"regexp/no-unused-capturing-group": { "count": 1 },
"ts/no-explicit-any": { "count": 2 }
},
"__tests__/document-detail-navigation-fix.test.tsx": {
"no-console": { "count": 10 }
},
"__tests__/document-list-sorting.test.tsx": {
"ts/no-explicit-any": { "count": 3 }
}
}
Import
Referenced by ESLint configuration; not imported in application code.
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| N/A | N/A | N/A | Generated/managed by ESLint tooling; not programmatically consumed. |
Outputs
| Name | Type | Description |
|---|---|---|
| suppressions | Record<string, Record<string, { count: number }>> | Per-file, per-rule suppression counts |