-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Fix eslint #33002
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
Fix eslint #33002
Conversation
9bc494a
to
327ea77
Compare
* giteaofficial/main: Refactor pagination (go-gitea#33037) Test webhook email (go-gitea#33033) Fix review code comment avatar alignment (go-gitea#33031) Fix templating in pull request comparison (go-gitea#33025) Refactor tests (go-gitea#33021) [skip ci] Updated translations via Crowdin always show assignees on right (go-gitea#33006) fix toggle commit body button ui when latest commit message is long (go-gitea#32997) Fix and/or comment some legacy CSS problems (go-gitea#33015) Refactor comment history and fix content edit (go-gitea#33018) Fix bug on activities (go-gitea#33008) Refactor arch route handlers (go-gitea#32993) fix scoped label ui when contains emoji (go-gitea#33007) [skip ci] Updated translations via Crowdin De-emphasize signed commits (go-gitea#31160) Fix eslint (go-gitea#33002) Fix Agit pull request permission check (go-gitea#32999) Support for email addresses containing uppercase characters when activating user account (go-gitea#32998)
@@ -674,7 +674,7 @@ module.exports = { | |||
'no-this-before-super': [2], | |||
'no-throw-literal': [2], | |||
'no-undef-init': [2], | |||
'no-undef': [0], | |||
'no-undef': [2], // it is still needed by eslint & IDE to prompt undefined names in real time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's correct to have it enabled as per https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do think it is correct to have it enabled at the moment, otherwise IDE (I am using GoLand) won't report errors, which makes difficult write correct code (for example, remove import $
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure that's a problem with your IDE. Definitely if the CLI error reporting is different from your IDE.
As for JetBrains IDEs: Isn't one supposed to use WebStorm or something for Typescript?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for JetBrains IDEs: Isn't one supposed to use WebStorm or something for Typescript?
The lint result comes from eslint
CLI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or, could you show how to correctly lint the "undefined $" errors? You could just remove the import $
from a JS file, and try to see whether there is any lint error (either from eslint or other tools)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you expect when removing import $
? The global to work, so it not raises an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you expect when removing
import $
? The global to work, so it not raises an error?
It should raise an error, there is no global $
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, it should as there is no global defined here and env.jquery
is also not set:
Lines 51 to 54 in 6410c34
globals: { | |
__webpack_public_path__: true, | |
process: false, // https://github.com/webpack/webpack/issues/15833 | |
}, |
I will check later why it does not error.
Fix #32982
Related #32869