wearerequired / lint-action

✨ GitHub Action for detecting and auto-fixing lint errors
MIT License
553 stars 130 forks source link

Breaks on NPM 10.6.0 #789

Closed broksonic21 closed 2 months ago

broksonic21 commented 2 months ago

NPM 10.6.0 changed how it logs out when running npx commands, and the eslit parser for wearerequired/lint-action isn't handling it

NPM 10.5.2:

~/git/personal/shared-configs (main ✔) npx eslint --ext .js --fix --no-color --format json .
[{"filePath":"/Users/REDACTED/REDACTED/personal/shared-configs/.eslintrc.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-mixed-operators","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"rest-spread-spacing","replacedBy":[]},{"ruleId":"padding-line-between-statements","replacedBy":[]}]},{"filePath":"/Users/REDACTED/REDACTED/personal/shared-configs/packages/eslint-config/index.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-mixed-operators","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"rest-spread-spacing","replacedBy":[]},{"ruleId":"padding-line-between-statements","replacedBy":[]}]},{"filePath":"/Users/REDACTED/REDACTED/personal/shared-configs/packages/stylelint-config/index.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-mixed-operators","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"rest-spread-spacing","replacedBy":[]},{"ruleId":"padding-line-between-statements","replacedBy":[]}]}]

NPM 10.6.0:

~/git/personal/shared-configs (renovatebot/node_npm ✔) npx eslint --ext .js --fix --no-color --format json .

> @REDACTED/shared-configs@7.10.2 npx
> eslint --ext .js --fix --no-color --format json .

[{"filePath":"/Users/REDACTED/REDACTED/personal/shared-configs/.eslintrc.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-mixed-operators","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"rest-spread-spacing","replacedBy":[]},{"ruleId":"padding-line-between-statements","replacedBy":[]}]},{"filePath":"/Users/REDACTED/REDACTED/personal/shared-configs/packages/eslint-config/index.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-mixed-operators","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"rest-spread-spacing","replacedBy":[]},{"ruleId":"padding-line-between-statements","replacedBy":[]}]},{"filePath":"/Users/REDACTED/REDACTED/personal/shared-configs/packages/stylelint-config/index.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-mixed-operators","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"rest-spread-spacing","replacedBy":[]},{"ruleId":"padding-line-between-statements","replacedBy":[]}]}]

Notice the lines at here that showed up.

> @REDACTED/shared-configs@7.10.2 npx
> eslint --ext .js --fix --no-color --format json .

This causes issues in the lint parser for this action.

Logs:

Run ESLint
  Verifying setup for ESLint…
  Verified ESLint setup
  Will use ESLint to check the files with extensions js
  Linting and auto-fixing files in /home/runner/work/shared-configs/shared-configs with ESLint …
  Error: Error parsing ESLint JSON output: Unexpected token > in JSON at position 0. Output: "> @REDACTED/shared-configs@7.10.2 npx
  > eslint --ext .js --fix --no-color --format json .

  [{"filePath":"/home/runner/work/shared-configs/shared-configs/.eslintrc.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-mixed-operators","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"rest-spread-spacing","replacedBy":[]},{"ruleId":"padding-line-between-statements","replacedBy":[]}]},{"filePath":"/home/runner/work/shared-configs/shared-configs/packages/eslint-config/index.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-mixed-operators","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"rest-spread-spacing","replacedBy":[]},{"ruleId":"padding-line-between-statements","replacedBy":[]}]},{"filePath":"/home/runner/work/shared-configs/shared-configs/packages/stylelint-config/index.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[{"ruleId":"dot-location","replacedBy":[]},{"ruleId":"new-parens","replacedBy":[]},{"ruleId":"no-mixed-operators","replacedBy":[]},{"ruleId":"no-new-object","replacedBy":["no-object-constructor"]},{"ruleId":"no-whitespace-before-property","replacedBy":[]},{"ruleId":"rest-spread-spacing","replacedBy":[]},{"ruleId":"padding-line-between-statements","replacedBy":[]}]}]"
broksonic21 commented 2 months ago

Filed vs npm 10.6.0 as well: https://github.com/npm/cli/issues/7419

broksonic21 commented 2 months ago

NPM is fixing this, so you can probably ignore it.

broksonic21 commented 2 months ago

Closing- npm fixed this in npm 10.7.0, which makes it work with this github action now.