Conversation
193586a to
3ba0ca3
Compare
3ba0ca3 to
7663914
Compare
Review for PR #3484Overall, this is a great step forward in managing our JavaScript technical debt! The hybrid blocking/non-blocking approach is very pragmatic. However, I've found a critical issue with the linter configuration regarding our module system, and a notification about our GitHub Actions versions. 🛑 Critical: ERB Templates in
|
| Action | Current Version | Latest Version |
|---|---|---|
actions/checkout |
v4 | v6 |
actions/setup-node |
v4 | v6 |
tj-actions/changed-files |
v45 | v47 |
Please update .github/workflows/eslint.yml to use the latest versions:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
- uses: tj-actions/changed-files@v47Summary
- Fix: Add
modules/**to.eslintrc.jsonignore patterns to prevent ERB parsing errors. - Update: Bump
actions/checkouttov6. - Update: Bump
actions/setup-nodetov6. - Update: Bump
tj-actions/changed-filestov47.
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.jsonwith configuration tailored for BeEF's legacy codebase:env: browser, es6: false- browser globals enabled, no ES6 for IE compatibilityecmaVersion: 5- parses ES5 syntax (pre-let/const/promises) to support older browserseslint:recommended- baseline rules without strict enforcementignorePatterns- excludes vendor libraries incore/main/client/lib/**globals- defines BeEF framework globals (beef, jQuery/$/$j, MobileEsp, evercookie, etc.)Created
.github/workflows/eslint.ymlwith two parallel jobs:lint-changed-files: Detects changed.jsfiles viatj-actions/changed-files@v45, runs ESLint, blocks PR on errorslint-all-files: Lints entire codebase withcontinue-on-error: true, report-only (non-blocking)Updated
package.jsonscripts:npm run lintandnpm run lint:fixaccept file arguments for flexible local testingFile pattern:
**/*.jswith exclusions fornode_modules,core/main/client/lib,*.min.jsTest
Q: Describe your test cases, what you have covered and if there are any use cases that still need addressing.
A:
test-lint.jswith auto-fixable and non-fixable errors, verifiednpm run lint test-lint.jsandnpm run lint:fix test-lint.jswork correctly