Skip to content

Refactor/Tests - #543

Merged
jliermann merged 35 commits into
mainfrom
refactor/tests
Sep 10, 2026
Merged

Refactor/Tests#543
jliermann merged 35 commits into
mainfrom
refactor/tests

Conversation

@jliermann

Copy link
Copy Markdown
Contributor

This pull request refactors and modernizes the project's validation and linting infrastructure. It introduces a new modular GitHub Actions workflow for pull request checks, replaces and extends the previous linting and validation scripts, and updates documentation and configuration accordingly. The main themes are: CI workflow improvements, npm script and command restructuring, new and updated linting configurations, and documentation updates.

CI/CD Workflow Modernization:

  • Introduced a new GitHub Actions workflow (.github/workflows/pr-check.yml) that splits validation into multiple jobs (content, format, JS, CSS, and build checks), uses a new reusable composite action for Node.js setup, and replaces the previous lint.yml and pr-validation.yml workflows. This makes validation more modular, parallel, and maintainable. [1] [2] [3] [4]

NPM Scripts and Linting Command Restructuring:

  • Refactored npm scripts in package.json to use test and lint command groups, aligning them with the new CI workflow. Added scripts for JS (eslint) and CSS (stylelint) checks, and moved content validation to tests/content/validate-content.js. [1] [2]

Linting and Style Configuration:

  • Added a modern ESLint configuration (eslint.config.js) supporting JS, React, and TypeScript, and introduced Stylelint with a standard config via .stylelintrc.json. This enables more comprehensive and up-to-date code style and quality checks. [1] [2]

Documentation Updates:

  • Updated documentation in readme/testing.md and readme/tests/lint.md to reflect new commands, workflows, and file locations. Clarified the distinction between content and format checks and provided more detailed usage instructions. [1] [2] [3]

Validation Proposal and Config File Relocation:

  • Updated the validation proposal and references to configuration files to reflect the move from scripts/ to tests/content/, ensuring consistency and clarity in documentation and developer guidance. [1] [2] [3]

…mprove test scripts

- Added "test:js" and "test:js:fix" scripts for running ESLint checks and fixing issues
- Updated "test:all" script to include JavaScript linting
- Added ESLint and related dependencies: @eslint/js, eslint, eslint-config-prettier, eslint-plugin-react, eslint-plugin-react-hooks, and globals
- Added typescript-eslint dependency for TypeScript support
- Replaced `test:js` with `lint` in `test:all` script to include CSS linting.
- Added new scripts for CSS linting and fixing using Stylelint.
- Updated dependencies to include Stylelint and its standard configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

A few introduced issues should be addressed first (undefined-variable suppression in Lbe.js, incomplete _blank rel hardening, locally brittle build-log script output, and a couple of doc typos).

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This pull request modernizes the repository’s validation/linting setup by restructuring npm scripts and documentation, introducing ESLint/Stylelint configs, and replacing legacy CI workflows with a more modular PR-check workflow (plus shared Node setup).

Changes:

  • Replaced legacy GitHub Actions workflows with a multi-job PR Check workflow and a reusable composite action for Node environment setup.
  • Refactored local/CI commands: introduced test:* script group, added ESLint/Stylelint checks, and moved content validation tooling under tests/content/.
  • Updated lint/testing documentation and applied CSS/style cleanups aligned with Stylelint/Prettier conventions.
File summaries
File Description
VALIDATION_PROPOSAL.md Updates references to the relocated content validation config/script paths.
tests/content/validation.config.js Adds centralized, implemented content-validation settings (excludes, SEO warning thresholds, output options).
tests/content/validate-content.js Updates content validator to consume config (excludes + SEO warnings) and adds JSON output mode.
tests/ci/check-build-log.sh Introduces a reusable build-log scanner for warnings and broken references in CI.
src/pages/index.module.css Modernizes media query syntax and removes invalid CSS (position: center).
src/data/commonFeatures.js Removes the dataPublishing entry from the common features data set.
src/css/video.module.css Modernizes media query syntax and tidies formatting.
src/css/N4CFeatures.module.css Improves CSS formatting and switches to overflow-wrap for better compatibility.
src/css/lbe.module.css Modernizes media query syntax and adjusts layout-related declarations.
src/css/FloatImage.module.css Simplifies margin shorthand formatting.
src/css/Eln.module.css Updates @import syntax and consolidates flex declarations (flex-flow).
src/css/DecisionTree.module.css Removes unused .svgDescBox styling.
src/css/custom.css Applies formatting cleanups, modern color notation, and updates import syntax to url().
src/css/ChemotionCarousel.module.css Updates color notation and modernizes media query syntax.
src/css/BulletBox.module.css Consolidates flex properties using flex-flow.
src/components/lbe/LbeBody.js Improves external-link safety attributes for DOI links.
src/components/lbe/Lbe.js Refactors local variable declarations and adds ESLint suppression around unreachable code.
src/components/commons/ShortenDesc.js Tweaks the split regex used for description truncation.
scripts/validation.config.js Removes the old (proposal-style) validation config from scripts/.
scripts/VALIDATION_SETUP.md Updates documentation to point to tests/content/validate-content.js.
scripts/README.md Reframes scripts/ as general tooling and updates CI workflow reference.
readme/tests/playwright.md Aligns local “usual check” docs with new test:* scripts.
readme/tests/lint.md Updates lint/test documentation to reflect content/format/JS/CSS checks and new commands.
readme/testing.md Updates local testing instructions to the new script names and expanded checks.
package.json Introduces test:* script structure, adds ESLint/Stylelint deps, and relocates validate-content entrypoint.
eslint.config.js Adds flat-config ESLint setup for React/browser code, Node scripts, and TS E2E tests.
.stylelintrc.json Adds Stylelint configuration using stylelint-config-standard.
.gitignore Stops ignoring Playwright snapshot directories under the previous pattern.
.github/workflows/pr-validation.yml Removes the legacy PR validation workflow.
.github/workflows/pr-check.yml Adds the new modular PR check workflow with separate jobs and a build-validation stage for PRs.
.github/workflows/lint.yml Removes the legacy lint workflow.
.github/actions/setup-node-env/action.yml Adds a reusable composite action for checkout + setup-node + npm ci.
Review details

Suppressed comments (1)

tests/ci/check-build-log.sh:43

  • Same as above: $GITHUB_STEP_SUMMARY is not set outside GitHub Actions, so default the summary output to /dev/null to avoid failures when the script is run locally.
  • Files reviewed: 31/98 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/components/lbe/Lbe.js
Comment thread src/components/lbe/LbeBody.js Outdated
Comment thread tests/ci/check-build-log.sh Outdated
Comment thread readme/testing.md Outdated
jliermann and others added 5 commits September 10, 2026 19:19
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@jliermann
jliermann merged commit 4d1ddd4 into main Sep 10, 2026
5 checks passed
@jliermann
jliermann deleted the refactor/tests branch September 10, 2026 17:29
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.

2 participants