Skip to content
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

Basic eslint (npm run eslint, config file) #25

Closed
wants to merge 3 commits into from

Conversation

tony
Copy link
Contributor

@tony tony commented Dec 4, 2021

In preparation to get a basic / primitive CI going so PRs are easier to test

./node_modules/.bin/eslint --init wizard to use common js and analyzed our code to find the style we already use (so minimal changes)

Instructions:

  • cd packages/scans
  • npm install
  • npm run lint

Example run:

❯ npm run lint

> @zaproxy/[email protected] lint /home/t/work/zaproxy/actions-common/packages/scans
> eslint src/*.js

/home/t/work/zaproxy/actions-common/packages/scans/src/action-helper.js
   59:22  error  Do not access Object.prototype method 'hasOwnProperty' from target object  no-prototype-builtins
   78:22  error  Do not access Object.prototype method 'hasOwnProperty' from target object  no-prototype-builtins
   88:22  error  Do not access Object.prototype method 'hasOwnProperty' from target object  no-prototype-builtins
  127:35  error  Do not access Object.prototype method 'hasOwnProperty' from target object  no-prototype-builtins
  127:86  error  Do not access Object.prototype method 'hasOwnProperty' from target object  no-prototype-builtins
  129:40  error  Do not access Object.prototype method 'hasOwnProperty' from target object  no-prototype-builtins
  160:23  error  Do not access Object.prototype method 'hasOwnProperty' from target object  no-prototype-builtins
  167:19  error  Do not access Object.prototype method 'hasOwnProperty' from target object  no-prototype-builtins

/home/t/work/zaproxy/actions-common/packages/scans/src/index.js
   1:7  error  'core' is assigned a value but never used     no-unused-vars
   2:7  error  'exec' is assigned a value but never used     no-unused-vars
   5:7  error  '_' is assigned a value but never used        no-unused-vars
  36:9  error  'context' is assigned a value but never used  no-unused-vars

✖ 12 problems (12 errors, 0 warnings)

With fixes applied: #26

@tony
Copy link
Contributor Author

tony commented Feb 22, 2022

Closing, too much time has passed and other PRs are going in

Edit:

Back in #29 (comment) there's a potential of using xo. If that materializes I suggest a new PR.

When I originally made these eslint PRs, including #26 and #27 I had an assumption there wasn't any linting/formatting processes in other zaproxy repos whatsoever. Maybe it will ultimately go eslint + prettier, but it's difficult to upkeep a PR like this in the long run with conflicts (and it being 2 PRs deep)

@tony tony closed this Feb 22, 2022
@tony tony deleted the basic-eslint branch February 22, 2022 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant