robatwilliams / es-compat

Check JavaScript code compatibility with target runtime environments
MIT License
65 stars 13 forks source link

Error detected but no issues #53

Closed susnux closed 1 year ago

susnux commented 1 year ago

When running check-es-compat it reports:

dist/registry.js
  10:50  error  ES2020 optional chaining is forbidden  ecmascript-compat/compat
  11:50  error  ES2020 optional chaining is forbidden  ecmascript-compat/compat

✖ 2 problems (2 errors, 0 warnings)

No issues found. Files are compatible with the target runtimes.

So there are 2 errors but no issues found? The return code is also 0 ("ok")

robatwilliams commented 1 year ago

Thanks.

Problem - in cli.mjs, we get returned a LintResult[] but we're interrogating it for the error count as if it were a single LintResult.

robatwilliams commented 1 year ago

Caused by #37

In the old CLIEngine, a report object with various properties including a results array and a total errorCount were returned. The replacement ESLint just returns the results.

When I did the work, I renamed the variable and changed the pass-down to the formatter, but missed the errorCount.

robatwilliams commented 1 year ago

Released in https://github.com/robatwilliams/es-compat/releases/tag/v2.2.1

Thanks for reporting.