How do I disable inspections in html/css/js files

My question is more generic but let me simplify this: my aim is to disable, say, all the warning and errors in html pages. Ideally this wouldn't be limited to editor but will also propagate to commit/code analysis.

So, I went to configure inspections (current project only) and disabled or so I think pretty much everything under Html, CSS and even Javascript. For good measure I even disabled XML, LESS, and other markup languages related inspections.

 

My end result, indeed, the number of errors reported decreased by a few orders of magnitude but there are still many left. 

 

For instance, in this html file I am looking at, I still have left "186 errors found".

 

Let me give you a few examples:

"unexpected token"

"un identifier expected"

"{ expected"

"a term expected"

": expected"

"closing tag matches nothing"

 

Is there any way to *really* get rid of these messages ? Thanks!

 

 

 

10 comments
Comment actions Permalink

Hi there,

So far (based on your sample messages) that sounds like errors from a parser/lexer level -- they cannot be suppressed/disabled as they are not inspections (which are high level) but (lower level) parser errors. Such errors could be caused by unsupported languages or language features/constructs (e.g. wrong JavaScript language level is set etc).

Please provide some details

1
Comment actions Permalink

Just as Andriy mentioned, these errors likely come from parser. The only way to disable such errors is turning error highlighting off for your file using Hector icon in the lower right corner: open your HTML file in editor, click the Hector icon and then move the slider to change the Highlighting level to None. See http://www.jetbrains.com/webstorm/webhelp/changing-highlighting-level-for-the-current-file.html

However, it's possible to fix these errors in most cases - by removing extra/invalid language injections, associating file with correct file type, etc. So details are welcome. I'd suggest starting with screenshots that show up the issue

0
Comment actions Permalink

Indeed, some of the messages look like coming from cssparser..hehe

for instance, in css declarations 

p.1, li.1, div.1

generate "unexpected token"

Too bad if cannot be disabled. In some cases, while using external broken html and css, I am not concerned
with some of the errors that unnecessarily pollute the log.

Thanks for your reply, appreciated

 

--john

0
Comment actions Permalink

Thanks Elena, I know about changing the highlighting level for current file but that is not very useful here. What would help instead is to have a set of rules for these low-level entities that can be easily associated with project or globally. I could probably use something like enable/disable low-level css/html parser errors/warnings (I mean it'd help in most of my use cases).

0
Comment actions Permalink

The only way to suppress low-level errors is choosing the appropriate highlighting level. And this can only be done per-file.

You can enable File | Power Save Mode as a workaround - but it will affect all files in all your projects.

Related feature request: https://youtrack.jetbrains.com/issue/IDEA-141497

0
Comment actions Permalink

I am facing this on css files for angular development. I don't want to disable all the good things about intellij erroring the css, just remove the "unexpected token" errors I always get for styles with the  /deep/ selector (which is replaced by angular when rendered in the browser).

Is there a bugfix / workaround for this?

 

0
Comment actions Permalink

/deep/ selector doesn't cause errors to me. what Webstorm version do you use?

0
Comment actions Permalink

I just upgraded to the latest intellij and still consistently get these errors:

This compiles and works fine in angular

0
Comment actions Permalink

to me, the issue only occurs if /deep/ is the first item in selectors list... https://youtrack.jetbrains.com/issue/WEB-26368

0
Comment actions Permalink

Thanks for reporting it and for the workaround!

0

Please sign in to leave a comment.