How to force Visual Studio to stop "compiling" .js and .css files

I use Visual Studio as my editor for .css and .js files. It REALLY SAVE , especially with .js files, since it insists on backing off in a very strange way, but I find it that the first alt tab is always a browser instead of another editor, and that ctrl-tab is always either a code file , or css / js.

In any case, in all his radiant wisdom, he also decides to check them for syntax errors, and every time I compile my project, he gives several “errors” that crowd out real compilation errors, so every time I make syntax an error in the code file I need to scroll through all the js / css errors to see what is wrong.

Examples of such errors (which are not really errors):

 Error 7 Validation (CSS 2.1): 'text-rendering' is not a known CSS property name.
 Error 8 Validation (CSS 2.1): 'opacity' is not a known CSS property name.

Recently, the situation has also deteriorated dramatically, because for some reason it continues to analyze the .js file as a .css file, so I get errors such as:

 Error 1 Unexpected character sequence.  Expected a selector for the style rule.  E: \ Dev \ anacletus \ Static \ set_focus.js 2
 Error 2 Unexpected character sequence.  Expected a property name for the ":" declaration.  E: \ Dev \ anacletus \ Static \ set_focus.js 3
 Error 3 Validation (CSS 2.1): 'set-focus' is not a known CSS property name.  E: \ Dev \ anacletus \ Static \ set_focus.js 3

I even deleted this specific file from the solution (it is no longer in any place), but it still continues to parse it.

In short, how can I turn off this feature?

+48
javascript css visual-studio-2008 visual-studio
Jan 24
source share
2 answers

Enter parameters through

Tools> Options

If it is not installed, select the "Show all settings" checkbox at the bottom of this window.

In the tree on the left, select:

Text Editor> CSS> Specific CSS

Uncheck the "Error Detection" box. Then select:

Text Editor> JScript> Miscellaneous

Uncheck the box next to "Show syntax errors."

You can also change how it inserts each type of code into the various settings in these Text Editor options.

+63
Jan 24 '10 at 1:16
source share

I know this question is old, but I have an update (for Visual Studio 2010):

The decision made has a big drawback: it disables CSS and JScript syntax checking. If you still want to have meaningful warnings , you can do the following workaround. It will handle errors as warnings , and it will perform a css check at css V3.0 level, and not at (old) css V2.1:

  • Close Visual Studio
  • Download and install the web standards pack for Visual Studio 2010 SP 1
  • Open the path (on 32-bit machines, Program Files )

    C: \ Program Files (x86) \ Microsoft Visual Studio 10.0 \ Common7 \ Packages \ 1033 \ schemas \ CSS

  • CSS21.xml backup for security reasons
  • Overwrite CSS21.xml with CSS30.xml (in the same directory)
  • Open Visual Studio. In the settings of the text editor (re) enable "Show syntax errors". Make sure you also mark “as warnings”.
Starting today, CSS parsing is performed at level 3.0 (although it now appears in Visual Studio as 2.1), and you get warnings instead of errors if you check the syntax.

(Note that the Style Sheet Sheet toolbar allows you to enable CSS 3.0 validation for css files, not HTML. Therefore, this fix is ​​necessary if you want to keep the syntax validation)

+3
Aug 12 '13 at 12:08
source share



All Articles