You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can't run npx nx lint on a newly created nx Angular Monorepo workspace
$ npx nx lint testapp
nx run testapp:lint
Linting "testapp"...
NX Cannot read properties of undefined (reading 'at')
Occurred while linting C:\Users\Clau\Desktop\active-work\testworkspace\apps\testapp\src\app\app.component.html:1
Rule: "@typescript-eslint/ban-ts-comment"
Pass --verbose to see the stacktrace.
Expected Behavior
Expected to run successfully on a newly created nx Angular Monorepo workspace
Linting "testapp"...
NX Cannot read properties of undefined (reading 'at')
Occurred while linting C:\Users\Clau\Desktop\active-work\testnxissue\apps\testapp\src\app\app.component.html:1
Rule: "@typescript-eslint/ban-ts-comment"
TypeError: Cannot read properties of undefined (reading 'at')
Occurred while linting C:\Users\Clau\Desktop\active-work\testnxissue\apps\testapp\src\app\app.component.html:1
Rule: "@typescript-eslint/ban-ts-comment"
at Program (C:\Users\Clau\Desktop\active-work\testnxissue\node_modules@typescript-eslint\eslint-plugin\dist\rules\ban-ts-comment.js:118:50)
at ruleErrorHandler (C:\Users\Clau\Desktop\active-work\testnxissue\node_modules\eslint\lib\linter\linter.js:1084:48)
at C:\Users\Clau\Desktop\active-work\testnxissue\node_modules\eslint\lib\linter\safe-emitter.js:45:58
at Array.forEach ()
at Object.emit (C:\Users\Clau\Desktop\active-work\testnxissue\node_modules\eslint\lib\linter\safe-emitter.js:45:38)
at NodeEventGenerator.applySelector (C:\Users\Clau\Desktop\active-work\testnxissue\node_modules\eslint\lib\linter\node-event-generator.js:297:26)
at NodeEventGenerator.applySelectors (C:\Users\Clau\Desktop\active-work\testnxissue\node_modules\eslint\lib\linter\node-event-generator.js:326:22)
at NodeEventGenerator.enterNode (C:\Users\Clau\Desktop\active-work\testnxissue\node_modules\eslint\lib\linter\node-event-generator.js:337:14)
at runRules (C:\Users\Clau\Desktop\active-work\testnxissue\node_modules\eslint\lib\linter\linter.js:1128:40)
at #flatVerifyWithoutProcessors (C:\Users\Clau\Desktop\active-work\testnxissue\node_modules\eslint\lib\linter\linter.js:1914:31)
NX Running target lint for project testapp failed
Failed tasks:
testapp:lint
Hint: run the command with --verbose for more details.
Failure Logs
No response
Package Manager Version
npm 10.9.0
Operating System
macOS
Linux
Windows
Other (Please specify)
Additional Information
possible solution:
node_modules@typescript-eslint\eslint-plugin\dist\rules\ban-ts-comment.js
line 118: const firstStatement = node.body?.at(0);
cvandradg
changed the title
Nx lint is failing on a newly created Angular workspace
Nx lint is failing on a newly created Angular Monorepo workspace
Oct 11, 2024
Current Behavior
Can't run npx nx lint on a newly created nx Angular Monorepo workspace
$ npx nx lint testapp
Linting "testapp"...
NX Cannot read properties of undefined (reading 'at')
Occurred while linting C:\Users\Clau\Desktop\active-work\testworkspace\apps\testapp\src\app\app.component.html:1
Rule: "@typescript-eslint/ban-ts-comment"
Pass --verbose to see the stacktrace.
Expected Behavior
Expected to run successfully on a newly created nx Angular Monorepo workspace
$ npx nx lint testapp
Linting "testapp"...
✔ All files pass linting
GitHub Repo
https://github.com/cvandradg/testnxissue
Steps to Reproduce
Nx Report
npx nx lint testapp --verbose
Linting "testapp"...
NX Cannot read properties of undefined (reading 'at')
Occurred while linting C:\Users\Clau\Desktop\active-work\testnxissue\apps\testapp\src\app\app.component.html:1
Rule: "@typescript-eslint/ban-ts-comment"
TypeError: Cannot read properties of undefined (reading 'at')
Occurred while linting C:\Users\Clau\Desktop\active-work\testnxissue\apps\testapp\src\app\app.component.html:1
Rule: "@typescript-eslint/ban-ts-comment"
at Program (C:\Users\Clau\Desktop\active-work\testnxissue\node_modules@typescript-eslint\eslint-plugin\dist\rules\ban-ts-comment.js:118:50)
at ruleErrorHandler (C:\Users\Clau\Desktop\active-work\testnxissue\node_modules\eslint\lib\linter\linter.js:1084:48)
at C:\Users\Clau\Desktop\active-work\testnxissue\node_modules\eslint\lib\linter\safe-emitter.js:45:58
at Array.forEach ()
at Object.emit (C:\Users\Clau\Desktop\active-work\testnxissue\node_modules\eslint\lib\linter\safe-emitter.js:45:38)
at NodeEventGenerator.applySelector (C:\Users\Clau\Desktop\active-work\testnxissue\node_modules\eslint\lib\linter\node-event-generator.js:297:26)
at NodeEventGenerator.applySelectors (C:\Users\Clau\Desktop\active-work\testnxissue\node_modules\eslint\lib\linter\node-event-generator.js:326:22)
at NodeEventGenerator.enterNode (C:\Users\Clau\Desktop\active-work\testnxissue\node_modules\eslint\lib\linter\node-event-generator.js:337:14)
at runRules (C:\Users\Clau\Desktop\active-work\testnxissue\node_modules\eslint\lib\linter\linter.js:1128:40)
at #flatVerifyWithoutProcessors (C:\Users\Clau\Desktop\active-work\testnxissue\node_modules\eslint\lib\linter\linter.js:1914:31)
NX Running target lint for project testapp failed
Failed tasks:
Hint: run the command with --verbose for more details.
Failure Logs
No response
Package Manager Version
npm 10.9.0
Operating System
Additional Information
possible solution:
node_modules@typescript-eslint\eslint-plugin\dist\rules\ban-ts-comment.js
line 118: const firstStatement = node.body?.at(0);
that might do the trick, not sure if it's a viable solution.
Not sure if this should be reported here or in https://github.com/typescript-eslint/typescript-eslint/issues
The text was updated successfully, but these errors were encountered: