Refactor/Tests - #543
Merged
Merged
Conversation
…heck workflow with setup node action
…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.
…arousel.module.css
…s in lbe.module.css
…w-wrap in N4CFeatures.module.css
Contributor
There was a problem hiding this comment.
🟡 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 Checkworkflow 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 undertests/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.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
.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 previouslint.ymlandpr-validation.ymlworkflows. This makes validation more modular, parallel, and maintainable. [1] [2] [3] [4]NPM Scripts and Linting Command Restructuring:
package.jsonto usetestandlintcommand groups, aligning them with the new CI workflow. Added scripts for JS (eslint) and CSS (stylelint) checks, and moved content validation totests/content/validate-content.js. [1] [2]Linting and Style 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:
readme/testing.mdandreadme/tests/lint.mdto 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:
scripts/totests/content/, ensuring consistency and clarity in documentation and developer guidance. [1] [2] [3]