-
Notifications
You must be signed in to change notification settings - Fork 0
Add CI workflow with ESLint linting and build verification #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: hugefiver <18693500+hugefiver@users.noreply.github.com>
Co-authored-by: hugefiver <18693500+hugefiver@users.noreply.github.com>
|
@copilot Error: Dependencies lock file is not found in /home/runner/work/request-helper/request-helper. Supported file patterns: package-lock.json,npm-shrinkwrap.json,yarn.lock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a GitHub Actions CI workflow to automate linting and build verification for the RequestHelper extension. The implementation uses ESLint 9.x with flat config format and creates separate jobs for linting and build verification.
Key changes:
- Adds GitHub Actions workflow with lint and build jobs triggered on push/PR to main/master branches
- Configures ESLint 9.x with flat config format, separate configurations for ES modules (extension code) and CommonJS (Node.js scripts)
- Adds npm scripts for linting with auto-fix capability
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
.github/workflows/ci.yml |
GitHub Actions workflow with separate lint and build jobs using Node.js 20.x and npm caching |
eslint.config.js |
ESLint flat config with browser/Node.js environment separation, custom rules for unused vars and semicolons |
package.json |
Adds eslint and globals dev dependencies, adds lint and lint:fix scripts |
.github/workflows/ci.yml
Outdated
| cache: 'npm' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci |
Copilot
AI
Dec 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow uses npm ci which requires a package-lock.json file, but this file is gitignored according to .gitignore line 6. This will cause the CI to fail because npm ci cannot run without a lock file.
Consider either:
- Removing
package-lock.jsonfrom.gitignoreand committing it (recommended for reproducible builds) - Changing
npm citonpm installin the workflow (less strict but works without lock file)
.github/workflows/ci.yml
Outdated
| cache: 'npm' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci |
Copilot
AI
Dec 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow uses npm ci which requires a package-lock.json file, but this file is gitignored according to .gitignore line 6. This will cause the CI to fail because npm ci cannot run without a lock file.
Consider either:
- Removing
package-lock.jsonfrom.gitignoreand committing it (recommended for reproducible builds) - Changing
npm citonpm installin the workflow (less strict but works without lock file)
| files: ['**/*.js'], | ||
| languageOptions: { | ||
| ecmaVersion: 2022, | ||
| sourceType: 'module', | ||
| globals: { | ||
| ...globals.browser, | ||
| ...globals.es2021, | ||
| chrome: 'readonly', | ||
| }, | ||
| }, |
Copilot
AI
Dec 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ESLint configuration treats all .js files as ES modules by default (sourceType: 'module'), but content scripts like content/interceptor.js use IIFE pattern and don't have imports/exports. This may cause linting issues.
Consider adding a separate configuration block for content scripts that sets sourceType to 'script' instead of 'module'.
| 'no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }], | ||
| 'no-undef': 'error', | ||
| 'no-console': 'off', | ||
| 'semi': ['warn', 'always'], |
Copilot
AI
Dec 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The semi rule is set to 'warn' which encourages semicolon usage, but the existing codebase consistently uses semicolons everywhere. This should be set to 'error' for consistency, or consider using a more comprehensive style guide like StandardJS or Airbnb if the project wants to establish strict style rules.
| 'semi': ['warn', 'always'], | |
| 'semi': ['error', 'always'], |
Co-authored-by: hugefiver <18693500+hugefiver@users.noreply.github.com>
Fixed in b9b8767. Changed |
|
@copilot 升级到node 24 |
Co-authored-by: icceey <33692766+icceey@users.noreply.github.com>
Adds CI pipeline for automated linting and build verification on push/PR to main branches.
Changes
GitHub Actions workflow (
.github/workflows/ci.yml)dist/manifest.jsonexistscontents: read)npm install(no lock file in repo)ESLint configuration (
eslint.config.js)chromeglobal for extension scriptsscripts/andicons/(Node.js)no-undeferror,no-unused-varswarnpackage.json
eslint@^9.17.0,globals@^15.14.0dev dependencieslintandlint:fixscriptsUsage
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.