Skip to content

Add a lint process: stylelint, phpBB template checks and HTML validation - #78

Merged
avandenberghe merged 1 commit into
develop-33from
issue-77-lint-process
Oct 4, 2026
Merged

avandenberghe merged 1 commit into
develop-33from
issue-77-lint-process

Conversation

@avandenberghe

Copy link
Copy Markdown
Collaborator

Closes #77.

What

  • CSS: stylelint 16 + @stylistic/stylelint-plugin on theme/*.css (print.css skipped, it's prosilver's). Clean rules are errors. The cleanup rules are warnings for now: declaration-no-important, no-duplicate-selectors, duplicate properties, shorthand overrides, indentation, trailing whitespace.
  • Templates: lint/lint-templates.mjs catches legacy <!-- IF --> / {VAR}, DEFINE, definition.X (except STYLESHEETS/SCRIPTS), legacy operators and extension-owned variables. Whitespace rules are warnings until Normalise indentation and trailing whitespace in templates and theme #76 lands.
  • Rendered HTML: npm run validate runs the W3C Nu checker (--errors-only) on 7 pages of a running board. It finds a forum and topic on its own, so no board-specific ids are hard-coded. Configure it with BOARD_URL and STYLE_ID. Local only for now.
  • .github/workflows/lint.yml: Node 24, npm ci --omit=optional (skips vnu-jar's Java download), then npm run lint.
  • .editorconfig, a README Development section, export-ignore for all tooling, and node_modules/ in .gitignore.

Current results (today's develop-33)

Count Rule
1395 @stylistic/indentation (#76)
34 declaration-no-important
18 no-duplicate-selectors
3 declaration-block-no-duplicate-properties
3 @stylistic/no-eol-whitespace (#76)
2 declaration-block-no-shorthand-property-overrides
52 template whitespace warnings (#76)

The issue listed 49 !important and 19 duplicate selectors. Those numbers came from an earlier prototype run. On today's sources the counts are 34 and 18.

All of these are warnings, so npm run lint exits 0. Checked:

  • Errors fail the run: a scratch template with DEFINE, eq and {HEADERLINKS_CODE} gives 4 errors and exit 1, and an unknown CSS property exits 2.
  • npm run validate on the local board with PBTech found 21 errors on 7 pages. The style's only error is Duplicate ID "nav-main" (Footer reuses id="nav-main", duplicating the header's ID #73). The rest are board content and extensions.
  • git archive HEAD contains only README.md, license.txt, style.cfg, contrib/, template/ and theme/.

Tooling only: no version bump or changelog entry.

🤖 Generated with Claude Code

- stylelint 16 with @Stylistic for theme/*.css (print.css skipped, it is
  prosilver's). Clean rules are errors; cleanup rules (!important,
  duplicate selectors and properties, shorthand overrides, indentation,
  trailing whitespace) start as warnings.
- lint/lint-templates.mjs: phpBB-specific checks for legacy syntax, DEFINE,
  definition.X, legacy operators and extension-owned variables; whitespace
  rules are warnings until #76 lands.
- lint/validate-pages.mjs: W3C Nu checker on seven pages of a running
  board, errors only.
- GitHub Actions runs npm run lint on pushes and pull requests.
- Tooling is export-ignored so the style package stays style-only.

Closes #77

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@avandenberghe
avandenberghe merged commit 05d3725 into develop-33 Oct 4, 2026
3 checks passed
@avandenberghe
avandenberghe deleted the issue-77-lint-process branch October 4, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a lint process: stylelint, phpBB template checks and HTML validation

1 participant