-
-
Notifications
You must be signed in to change notification settings - Fork 183
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
Allow ignoring specific warnings. #260
Comments
I have this implemented in my config like this: (defvar-local jordon-js2-ignored-warnings nil)
(defadvice js2-report-warning (around ignore-some-warnings activate)
(unless (member (ad-get-arg 0) jordon-js2-ignored-warnings)
ad-do-it)) Then in a hook I add certain warnings to the list depending on the type of file. |
Another option is to add a function to |
bump |
Some details about possible solutions would be welcome on emacswiki or elsewhere with a pointer here ... |
From what I see there isn't a way to ignore specific warnings from js2-mode. There are certain times (usually in a test file) where I would like to ignore false warnings brought up by js2-mode.
For instance in a test file using chai's expect. I may have a line like this:
These lines are always highlighted because js2-mode thinks the line has no side effects even though they actually do.
My suggestion would be to have a buffer-local variable that contains a list of warnings to ignore. And then in
js2-report-warning
check if the warning is in the list before proceeding.That way I can do something like this in my config in order to solve my problem.
If this could be added to
js2-mode
I'd be happy to submit a pull request. But given the size of the project, there may be a better way to do this I overlooked.The text was updated successfully, but these errors were encountered: