-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eslint error 'NodeJS' is not defined no-undef #45
Comments
Monitor this problem to see when the upstream will fix it. (or other solutions) |
Hi, still no solution for that bug? |
Unfortunately, I'm still working with v3 for all my projects... Please let me know if you have any solutions, thanks and good luck! |
I also upgraded to Work around for me was just to add it as a global in
|
Thanks @abarke, I will try this. |
I confirm your trick is working for too @abarke, thanks! |
Workaround is working. But since I suppose my project will have that workaround years after the issue has been fixed, because I will not be remembering each and every workaround, and their corresponding issue number, by heart... So I guess it's really important to get this problem fixed sooner rather than later, especially seeing how old it already is. Or release a fix that allows comments. But I prefer the former over the latter, tbh. |
@thany Strangely enough, if you name files under |
A proper solution will be to turn off no-undef rule for typescript files. We need this rule for js not ts. This makes sense as typescript handles undefined variables. The project will not build if there are undefined variables. Add the following to your config: overrides: [
{
files: ['*.ts'],
rules: {
'no-undef': 'off'
}
}
] This is the recommended method by TypeScript ESLint. See here: https://typescript-eslint.io/docs/linting/troubleshooting/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors |
This commit adds envs and globals to configurations to remove wrong errors. NOTE "node" in "env" <-- Removes 'process' is undefined error "mocha" in "env" <-- Removes 'test'/'suites' is undefined error "Thenable" in "globals" <-- Removes 'Thenables' is undefined error. Thenable is defined in node_modules/@types/vscode "NodeJS" in "gloabls" <-- Removes 'NodeJS' is undefined error. Ref Chatie/eslint-config#45 ONE-vscode-DCO-1.0-Signed-off-by: dayo09 <[email protected]>
This commit adds envs and globals to configurations to remove wrong errors. NOTE "node" in "env" <-- Removes 'process' is undefined error "mocha" in "env" <-- Removes 'test'/'suites' is undefined error "Thenable" in "globals" <-- Removes 'Thenables' is undefined error. Thenable is defined in node_modules/@types/vscode "NodeJS" in "gloabls" <-- Removes 'NodeJS' is undefined error. Ref Chatie/eslint-config#45 ONE-vscode-DCO-1.0-Signed-off-by: dayo09 <[email protected]>
export const cryptoApi=createApi({ Error: |
This is the answer: https://typescript-eslint.io/troubleshooting/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
|
@typescript-eslint/parser@4
cause this problem. (related commit: 4d7265a)Downgrade it to v3
@typescript-eslint/parser@3
to solve the problem.See: https://stackoverflow.com/q/64089216/1123955
The text was updated successfully, but these errors were encountered: