Skip to content

fix(web-app): replace removed stylelint --syntax flag#4241

Merged
tomsun28 merged 2 commits into
apache:masterfrom
orangeCatDeveloper:fix/issue-3728-stylelint-syntax
Jul 25, 2026
Merged

fix(web-app): replace removed stylelint --syntax flag#4241
tomsun28 merged 2 commits into
apache:masterfrom
orangeCatDeveloper:fix/issue-3728-stylelint-syntax

Conversation

@orangeCatDeveloper

Copy link
Copy Markdown
Contributor

Close #3728

What's changed

npm run lint:style crashed immediately with:

Error: The "syntax" option is no longer available. You should install an
appropriate syntax, e.g. postcss-scss, and use the "customSyntax" option

stylelint 14 removed the --syntax CLI flag, but the lint:style script still
passed --syntax less, so the command errored out before linting anything.

Fix, following stylelint's own migration guidance:

  • package.json: drop the removed --syntax less flag from lint:style.
  • .stylelintrc: declare "customSyntax": "postcss-less" (applies to every
    invocation, incl. lint-staged and IDE integrations).
  • Add postcss-less@6.0.0 — the postcss 8 compatible line (stylelint 14 uses
    postcss 8; the older 3.1.4 requires postcss 7 and would mismatch).

Test plan

  • cd web-app && npm run lint:style
  • Before: crashes on The "syntax" option is no longer available.
  • After: stylelint runs and lints the .less files (exits with the existing
    style violations instead of crashing).

Note

Once the command runs, it surfaces a backlog of pre-existing .less style
violations. Those are unrelated to this change and lint:style is not currently
wired into CI or a pre-commit hook, so they block nothing. Cleaning them up (and
optionally enforcing the lint) is left as a separate follow-up.

stylelint 14 removed the --syntax option, so lint:style crashed before
linting anything. Use customSyntax with postcss-less (postcss 8
compatible) instead.
@orangeCatDeveloper
orangeCatDeveloper force-pushed the fix/issue-3728-stylelint-syntax branch from 6b8d3d7 to 4b3e72a Compare July 24, 2026 08:44

@tomsun28 tomsun28 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@tomsun28
tomsun28 merged commit c12372d into apache:master Jul 25, 2026
3 checks passed
@orangeCatDeveloper
orangeCatDeveloper deleted the fix/issue-3728-stylelint-syntax branch July 25, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] the syntax option is no longer available

2 participants