fluid-project / fluid-lint-all

Consolidated linting logic free from any particular build technology
BSD 3-Clause "New" or "Revised" License
0 stars 5 forks source link

Script should exit with an error code on ESLint processing failures. #45

Closed amb26 closed 2 years ago

amb26 commented 2 years ago

Describe the bug

A clear and concise description of what the bug is.

To reproduce

Steps to reproduce the behavior: Check out https://github.com/cindyli/preferencesServer/tree/proxy-sso-impl currently at commit 98871b705a67523f2869d511d6c75380ee72b6ad run npm install run npm lint

Expected behavior

There is a failing ESLint check in this repository. The lint run should be marked as a failure -

The output from the run is as follows:

buntu@ubuntu2004:~/preferencesServer$ npm run lint

> preferencesServer@0.1.0 lint /home/ubuntu/preferencesServer
> fluid-lint-all

Infusion at path /home/ubuntu/preferencesServer/node_modules/infusion is at top level 
04:49:45.989:  Registering module preferencesServer from path /home/ubuntu/preferencesServer/
04:49:45.991:  Registering module infusion from path /home/ubuntu/preferencesServer/node_modules/infusion/
04:49:45.991:  Registering module infusion from path /home/ubuntu/preferencesServer/node_modules/infusion
Resolved infusion from path /home/ubuntu/preferencesServer/node_modules/fluid-lint-all/node_modules/infusion/src/module to /home/ubuntu/preferencesServer/node_modules/infusion
04:49:45.999:  Registering module fluid-lint-all from path /home/ubuntu/preferencesServer/node_modules/fluid-lint-all
Resolved infusion from path /home/ubuntu/preferencesServer/node_modules/fluid-glob/node_modules/infusion/src/module to /home/ubuntu/preferencesServer/node_modules/infusion
04:49:46.378:  Registering module fluid-glob from path /home/ubuntu/preferencesServer/node_modules/fluid-glob
Resolved infusion from path /home/ubuntu/preferencesServer/node_modules/markdownlint-config-fluid/node_modules/infusion/src/module to /home/ubuntu/preferencesServer/node_modules/infusion
04:49:46.976:  Registering module markdownlint-config-fluid from path /home/ubuntu/preferencesServer/node_modules/markdownlint-config-fluid
04:49:47.113:  
04:49:47.113:  ======================================================
04:49:47.113:  fluid-lint-all: Running all checks.
04:49:47.113:  ======================================================
04:49:47.113:  
04:49:48.644:  ERROR: ESLint check failed: Object.values(...).flat is not a function
Occurred while linting /home/ubuntu/preferencesServer/src/dbOps/postgresOps.js:28
04:49:49.150:  eslint.js: 0% (0/23) files checked are valid.
04:49:49.150:  
04:49:49.150:  eslint.json: 100% (16/16) files checked are valid.
04:49:49.150:  
04:49:49.151:  eslint.md: 100% (3/3) files checked are valid.
04:49:49.151:  
04:49:49.151:  json5lint: 100% (3/3) files checked are valid.
04:49:49.151:  
04:49:49.151:  jsonlint: 100% (12/12) files checked are valid.
04:49:49.151:  
04:49:49.151:  lintspaces.jsonindentation: 100% (15/15) files checked are valid.
04:49:49.152:  
04:49:49.152:  lintspaces.newlines: 100% (51/51) files checked are valid.
04:49:49.152:  
04:49:49.152:  markdownlint: 100% (3/3) files checked are valid.
04:49:49.152:  
04:49:49.152:  mdjsonlint: 100% (3/3) files checked are valid.
04:49:49.152:  
04:49:49.152:  stylelint: 100% (1/1) files checked are valid.
04:49:49.153:  
04:49:49.153:  Summary: 82.31% (107/130) files checked are valid.
04:49:49.153:  
04:49:49.153:  ======================================
04:49:49.153:   PASS - All linting checks succeeded.
04:49:49.153:  ======================================

It seems that all eslint checks have failed, and 23 files are marked in error - but the overall run is marked as a success.

ubuntu version 20.0.4, node version 10.19.0, npm version 6.14.4 fluid-lint-all version 1.1.5

amb26 commented 2 years ago

It looks like the root failure is caused by running a version of node that is too old to actually execute current eslint correctly (the 10.x version mentioned) - but the overall run should still be flagged as a failure

the-t-in-rtf commented 2 years ago

Yes, there's a single line to change, I'll test for side effects and ask you to confirm that it behaves as expected for you.