Skip to content

Conversation

@kaitozaw
Copy link
Collaborator

Pull Request

Category

Tests

Feature/Issue Description

Q: Please give a brief summary of your feature/fix
A:
Implements GitHub Actions workflow for JavaScript linting (Issue #2306) with hybrid approach: blocking job lints changed files only, non-blocking job reports on entire codebase. Prevents new technical debt while enabling gradual improvement of existing 6,500+ lint errors.

Q: Give a technical rundown of what you have changed (if applicable)
A:

  • Created .eslintrc.json with configuration tailored for BeEF's legacy codebase:

    • env: browser, es6: false - browser globals enabled, no ES6 for IE compatibility
    • ecmaVersion: 5 - parses ES5 syntax (pre-let/const/promises) to support older browsers
    • eslint:recommended - baseline rules without strict enforcement
    • ignorePatterns - excludes vendor libraries in core/main/client/lib/**
    • globals - defines BeEF framework globals (beef, jQuery/$/$j, MobileEsp, evercookie, etc.)
  • Created .github/workflows/eslint.yml with two parallel jobs:

    • lint-changed-files: Detects changed .js files via tj-actions/changed-files@v45, runs ESLint, blocks PR on errors
    • lint-all-files: Lints entire codebase with continue-on-error: true, report-only (non-blocking)
  • Updated package.json scripts: npm run lint and npm run lint:fix accept file arguments for flexible local testing

  • File pattern: **/*.js with exclusions for node_modules, core/main/client/lib, *.min.js

Test

Q: Describe your test cases, what you have covered and if there are any use cases that still need addressing.
A:

  • Local testing: Created test-lint.js with auto-fixable and non-fixable errors, verified npm run lint test-lint.js and npm run lint:fix test-lint.js work correctly
  • Workflow testing plan:
    1. Merge this PR to enable workflow
    2. Create test PR with clean JS changes → verify blocking job pass, while non-blocking fails (due to existing js fiiles)
    3. Create test PR with lint errors → verify blocking job fails, while non-blocking fails (due to existing js fiiles)
    4. Create test PR with no JS changes → verify lint steps skip gracefully

@kaitozaw kaitozaw temporarily deployed to Integrate Pull Request December 31, 2025 05:08 — with GitHub Actions Inactive
@kaitozaw kaitozaw linked an issue Jan 2, 2026 that may be closed by this pull request
@kaitozaw kaitozaw force-pushed the issue/2306-js-lint branch from 193586a to 3ba0ca3 Compare January 2, 2026 23:33
@kaitozaw kaitozaw temporarily deployed to Integrate Pull Request January 2, 2026 23:33 — with GitHub Actions Inactive
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.

CI: Implement JS lint tests

1 participant