Skip to content

fix(linter): log transpilation errors of workspace rules - #21503

Merged
JamesHenry merged 1 commit into
nrwl:masterfrom
Den-dp:fix/log-transpilaton-errors
May 11, 2024
Merged

JamesHenry merged 1 commit into
nrwl:masterfrom
Den-dp:fix/log-transpilaton-errors

Conversation

@Den-dp

@Den-dp Den-dp commented Feb 1, 2024 •

Copy link
Copy Markdown
Contributor

Current Behavior

Currently, transpilation-related errors of workspace rules are swallowed, so if you run npx eslint you will get not-so-informative:

> npx eslint

C:\project\src\main.js
  1:1  error  Definition for rule '@nx/workspace-example was not found  @nx/workspace-example

✖ 1 problem (1 error, 0 warnings)

Expected Behavior

I'd expected to see the error and a stacktrace like this:

> npx eslint

TypeError: Cannot read properties of undefined (reading '_events')
    at _addListener (node:events:549:19)
    at addListener (node:events:606:10)
    at Object.<anonymous> (C:\project\tools\eslint-rules\rules\examplets:18:3)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._compile (C:\project\node_modules\pirates\lib\index.js:117:24)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Object.newLoader [as .ts] (C:\project\node_modules\pirates\lib\index.js:121:7)      
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Function.Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19)

C:\project\src\main.js
  1:1  error  Definition for rule '@nx/workspace-example was not found  @nx/workspace-example

✖ 1 problem (1 error, 0 warnings)

Related Issue(s)

@Den-dp
Den-dp requested a review from a team as a code owner February 1, 2024 21:06
@Den-dp
Den-dp requested a review from meeroslav February 1, 2024 21:06
@vercel

vercel Bot commented Feb 1, 2024 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview May 1, 2024 2:01pm

@Den-dp
Den-dp force-pushed the fix/log-transpilaton-errors branch from 931f30b to 429225b Compare May 1, 2024 13:59
@JamesHenry
JamesHenry merged commit 1ef6f27 into nrwl:master May 11, 2024
@JamesHenry

Copy link
Copy Markdown
Contributor

Thanks a lot for this @Den-dp, I'm very sorry for how long it took to get merged

@Den-dp
Den-dp deleted the fix/log-transpilaton-errors branch May 11, 2024 15:29
FrozenPandaz pushed a commit that referenced this pull request May 13, 2024
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants