Skip to content

Adds website linting workflow#186

Merged
NickSeagull merged 3 commits into
neohaskell:mainfrom
verogarp:ci/website-gh-actions
Jun 18, 2025
Merged

Adds website linting workflow#186
NickSeagull merged 3 commits into
neohaskell:mainfrom
verogarp:ci/website-gh-actions

Conversation

@verogarp

@verogarp verogarp commented Jun 18, 2025

Copy link
Copy Markdown
Contributor

Adds ESLint, Prettier, and a GitHub Actions workflow to lint the website
codebase.

This ensures consistent code formatting and helps to identify potential
issues early in the development process.

Summary by CodeRabbit

  • Chores
    • Introduced automated linting and formatting checks for website code via a new workflow.
    • Added ESLint and Prettier configuration files to enforce consistent code style.
    • Updated development dependencies and scripts to support linting and formatting tasks.
    • Adjusted code indentation for improved readability; no functional changes.
    • Refined test workflow triggers to run only on relevant directory changes, optimizing CI runs.

Adds ESLint, Prettier, and a GitHub Actions workflow to lint the website
codebase.

This ensures consistent code formatting and helps to identify potential
issues early in the development process.
@coderabbitai

coderabbitai Bot commented Jun 18, 2025

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Walkthrough

A comprehensive code quality system is established for the website directory. This includes new configuration files for ESLint and Prettier, updates to package scripts and dependencies, a GitHub Actions workflow for automated linting and formatting, a minor indentation adjustment in a TypeScript config file, and a refinement of the test workflow to restrict runs to relevant directory changes.

Changes

Files / Group Change Summary
.github/workflows/website-lint.yml Added GitHub Actions workflow to automate linting and formatting on website codebase changes.
.github/workflows/test.yml Modified test workflow triggers to run only on changes in core/, cli/, and nix/** directories on main branch.
website/.eslintrc.cjs Introduced ESLint configuration for JavaScript, TypeScript, and Astro files, with environment and parser settings.
website/.prettierrc Added Prettier configuration specifying formatting rules (quotes, semicolons, width, etc.).
website/package.json Added lint/format scripts and devDependencies for ESLint, Prettier, TypeScript ESLint, and Astro plugin.
website/src/content.config.ts Changed indentation of the docs property from tabs to two spaces; no logic altered.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant GitHub
    participant GitHubActions
    participant Node
    participant ESLint
    participant Prettier

    Developer->>GitHub: Push or PR to website/
    GitHub->>GitHubActions: Trigger website-lint workflow
    GitHubActions->>Node: Setup Node.js environment
    GitHubActions->>Node: Install dependencies (npm ci)
    GitHubActions->>Prettier: Run format:check on codebase
    GitHubActions->>ESLint: Run lint on codebase
    Prettier-->>GitHubActions: Report formatting status
    ESLint-->>GitHubActions: Report linting status
    GitHubActions-->>GitHub: Post results to PR/checks
Loading

Poem

O mortals, behold! The code is aligned,
With lint and with format, all errors confined.
Scripts now enforce what fingers forget,
While workflows ensure the standards are met.
Indentation corrected, the styles divine—
Rejoice, for your website’s code doth shine!


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between fee55fc and b115881.

📒 Files selected for processing (1)
  • .github/workflows/test.yml (1 hunks)
✨ Finishing Touches
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in Comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 5b06f3f and 985be87.

⛔ Files ignored due to path filters (1)
  • website/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • .github/workflows/website-lint.yml (1 hunks)
  • website/.eslintrc.cjs (1 hunks)
  • website/.prettierrc (1 hunks)
  • website/package.json (1 hunks)
  • website/src/content.config.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: tests (macos-latest)
  • GitHub Check: tests (ubuntu-latest)
🔇 Additional comments (4)
website/.prettierrc (1)

1-10: Prettier configuration is correct and comprehensive. Settings enforce consistent formatting across the website codebase.

website/src/content.config.ts (1)

6-6: Indentation aligned per Prettier rules. The 2-space indent now matches the project’s style guidelines.

.github/workflows/website-lint.yml (1)

1-36: CI workflow for website linting is well-structured. It correctly triggers on changes under website/, configures Node.js with caching, and runs both Prettier and ESLint checks.

website/package.json (1)

10-14: New linting and formatting scripts are properly added. Developers can now run npm run lint, lint:fix, format, and format:check locally.

Comment thread website/.eslintrc.cjs
Comment on lines +1 to +29
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:astro/recommended'
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: './tsconfig.json'
},
env: {
browser: true,
node: true
},
overrides: [
{
files: ['*.astro'],
parser: 'astro-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
extraFileExtensions: ['.astro']
}
}
]
}; No newline at end of file

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.

🧹 Nitpick (assertive)

Integrate Prettier with ESLint to prevent rule conflicts. Consider adding plugin:prettier/recommended (or eslint-config-prettier) to the extends array so formatting rules from Prettier don’t clash with ESLint.

🤖 Prompt for AI Agents
In website/.eslintrc.cjs lines 1 to 29, the ESLint configuration lacks
integration with Prettier, which can cause conflicts between ESLint and Prettier
formatting rules. To fix this, add 'plugin:prettier/recommended' to the extends
array in the ESLint config. This will enable Prettier's recommended settings and
disable conflicting ESLint rules, ensuring smooth coexistence of both tools.

Comment thread website/package.json
Comment on lines +21 to 27
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^8.34.1",
"@typescript-eslint/parser": "^8.34.1",
"eslint": "^8.56.0",
"eslint-plugin-astro": "^1.3.1",
"prettier": "^3.5.3"
}

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.

⚠️ Potential issue

Missing Prettier plugin for Astro files. Without prettier-plugin-astro installed, Prettier will error on .astro files. Add it to devDependencies to enable formatting for Astro components.

Apply this diff:

 "devDependencies": {
-  "prettier": "^3.5.3"
+  "prettier": "^3.5.3",
+  "prettier-plugin-astro": "^1.0.0"
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^8.34.1",
"@typescript-eslint/parser": "^8.34.1",
"eslint": "^8.56.0",
"eslint-plugin-astro": "^1.3.1",
"prettier": "^3.5.3"
}
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^8.34.1",
"@typescript-eslint/parser": "^8.34.1",
"eslint": "^8.56.0",
"eslint-plugin-astro": "^1.3.1",
"prettier": "^3.5.3",
"prettier-plugin-astro": "^1.0.0"
}
🤖 Prompt for AI Agents
In website/package.json around lines 21 to 27, the devDependencies are missing
the prettier-plugin-astro package, which is required for Prettier to format
.astro files correctly. Add "prettier-plugin-astro" with an appropriate version
to the devDependencies section to enable proper formatting of Astro components.

Updates `@typescript-eslint/*`, `eslint`, `eslint-plugin-astro`, and `typescript` dev dependencies.

This brings in the latest features and bug fixes from these packages.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

♻️ Duplicate comments (1)
website/package.json (1)

21-27: Missing Prettier plugin for Astro files.
Without prettier-plugin-astro in devDependencies, Prettier will error on .astro files. Add it right after prettier:

 "devDependencies": {
-  "prettier": "^3.5.3",
+  "prettier": "^3.5.3",
+  "prettier-plugin-astro": "^1.0.0",
   "typescript": "^5.4.3"
 }
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 985be87 and fee55fc.

⛔ Files ignored due to path filters (1)
  • website/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • website/package.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: tests (macos-latest)
  • GitHub Check: tests (ubuntu-latest)
🔇 Additional comments (1)
website/package.json (1)

10-14: Impressive new lint & format scripts!
These commands will enforce ESLint across .js/.jsx/.ts/.tsx/.astro and Prettier over all key file types.

Comment thread website/package.json
Comment on lines +21 to +27
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"eslint": "^8.56.0",
"eslint-plugin-astro": "^0.31.0",
"prettier": "^3.5.3",
"typescript": "^5.4.3"

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.

🧹 Nitpick (assertive)

Consider integrating Prettier into ESLint.
Adding eslint-config-prettier (and optionally eslint-plugin-prettier) will disable conflicting ESLint rules and surface formatting issues directly in your lint step:

 "devDependencies": {
   "eslint": "^8.56.0",
+  "eslint-config-prettier": "^8.8.0",
   "@typescript-eslint/parser": "^7.0.0",
   "@typescript-eslint/eslint-plugin": "^7.0.0",
   "eslint-plugin-astro": "^0.31.0",
   "prettier": "^3.5.3",
   "prettier-plugin-astro": "^1.0.0",
   "typescript": "^5.4.3"
 }

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In website/package.json around lines 21 to 27, Prettier is listed as a
devDependency but is not integrated with ESLint. To fix this, add
eslint-config-prettier to the devDependencies to disable ESLint rules that
conflict with Prettier, and optionally add eslint-plugin-prettier to run
Prettier as an ESLint rule. Then update the ESLint configuration to extend
eslint-config-prettier and include eslint-plugin-prettier in the plugins section
to surface formatting issues during linting.

Limits CI execution to changes within the core, CLI, and Nix directories.
This improves CI efficiency by preventing unnecessary test runs for unrelated changes.
@NickSeagull NickSeagull merged commit 815e7de into neohaskell:main Jun 18, 2025
1 of 2 checks passed
@verogarp verogarp deleted the ci/website-gh-actions branch June 18, 2025 12:29
@NickSeagull

Copy link
Copy Markdown
Member

@allcontributors please add @verogarp for doc

@allcontributors

Copy link
Copy Markdown
Contributor

@NickSeagull

I've put up a pull request to add @verogarp! 🎉

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