[Chore/Refactor] Simplify web package.json lint scripts #18246

Closed
opened 2026-02-21 19:45:22 -05:00 by yindo · 0 comments
Owner

Originally created by @lyzno1 on GitHub (Sep 25, 2025).

Description

The web/package.json file contains redundant lint scripts that create maintenance overhead and confusion for developers. Specifically:

  • lint and eslint scripts are identical duplicates
  • Mixed naming conventions (lint-* vs eslint-*)
  • Inconsistent configuration across similar scripts
  • 7 total lint scripts when 4 would suffice

Motivation

This refactor is necessary to:

  1. Reduce maintenance burden: Fewer scripts mean less configuration to maintain
  2. Improve developer experience: Clear, consistent naming makes scripts easier to understand
  3. Standardize configuration: Consistent caching and concurrency settings across all lint scripts
  4. Follow best practices: Align with common npm script naming conventions

Proposed Changes

Consolidate the current 7 lint scripts into 4 standardized scripts:

{
  "lint": "eslint --concurrency=auto --cache --cache-location node_modules/.cache/eslint/.eslint-cache",
  "lint:fix": "eslint --concurrency=auto --cache --cache-location node_modules/.cache/eslint/.eslint-cache --fix",
  "lint:quiet": "eslint --concurrency=auto --cache --cache-location node_modules/.cache/eslint/.eslint-cache --quiet",
  "lint:complexity": "eslint --concurrency=auto --rule 'complexity: [error, {max: 15}]' --quiet"
}

Additional Context

This refactor maintains all existing functionality while improving maintainability. The standardized naming convention (lint:*) follows npm best practices and makes the scripts more intuitive for new contributors.

Originally created by @lyzno1 on GitHub (Sep 25, 2025). ## Description The web/package.json file contains redundant lint scripts that create maintenance overhead and confusion for developers. Specifically: - `lint` and `eslint` scripts are identical duplicates - Mixed naming conventions (`lint-*` vs `eslint-*`) - Inconsistent configuration across similar scripts - 7 total lint scripts when 4 would suffice ## Motivation This refactor is necessary to: 1. **Reduce maintenance burden**: Fewer scripts mean less configuration to maintain 2. **Improve developer experience**: Clear, consistent naming makes scripts easier to understand 3. **Standardize configuration**: Consistent caching and concurrency settings across all lint scripts 4. **Follow best practices**: Align with common npm script naming conventions ## Proposed Changes Consolidate the current 7 lint scripts into 4 standardized scripts: ```json { "lint": "eslint --concurrency=auto --cache --cache-location node_modules/.cache/eslint/.eslint-cache", "lint:fix": "eslint --concurrency=auto --cache --cache-location node_modules/.cache/eslint/.eslint-cache --fix", "lint:quiet": "eslint --concurrency=auto --cache --cache-location node_modules/.cache/eslint/.eslint-cache --quiet", "lint:complexity": "eslint --concurrency=auto --rule 'complexity: [error, {max: 15}]' --quiet" } ``` ## Additional Context This refactor maintains all existing functionality while improving maintainability. The standardized naming convention (`lint:*`) follows npm best practices and makes the scripts more intuitive for new contributors.
yindo closed this issue 2026-02-21 19:45:22 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#18246