Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #589, #638, #1241 and this UserVoice ticket.
The docs should go to http://www.github.com/madskristensen/vswebessentials.com/ which would eventually appear at http://www.vswebessentials.com/.
WEIgnore
WEIgnore,
.weignore
, is a file containing the list of linefeed-separated file-path patterns to prevent compilers and linters used in Web Essentials (WE). As per @nschonni's kind suggestion and @SLaks' cool Minimatch utility -- a port of Nodejs' minimatch; it supports both Unix-like and Windows-like file paths.That said, it supports all styles supported by
.jshintignore
.Limitations:
Currently it only targets nodejs pipeline services, meaning TypeScript compilation (not TSLint) and Markdown are out. For markdown, we would probably shift to nodejs-based marked compiler, once this feature is implemented.
Discoverability:
It works just like
.jscs
,.jshintrc
,coffee.json
,coffeelint.js
andtslint.json
. For each request, it looks for.weignore
file in the current directory, then its parent till the drive's root. After that it will look into user's HOME directory (c:\users\<your-name>
).How it works:
The first config file that is found in the aforementioned chain takes effect. All the file-path patterns inside the
.weignore
file are relative to the source file being processed, not the.weignore
file itself.Basic Usage:
.min.js
at the end:or:
Or:
Intermediate Complexity:
!
before the path:Note: The space between
doodle.less
andcompiler
is a TAB\t
. Although TAB is not the disallowed character in any major file-system, but it's extremely obscure in usage -- hence the best candidate of our separator. If you have files with TAB anywhere file path, you are out of luck! :(less
:autoprefixer
:linter
:Here is the list of all the (node-based) compilers and linters currently supported by WE:
The parent list items are referred as "service-categories" and sub-list constitutes "service-names".
Advanced Usage (going crazy):
You can have negation for service type and service names as well!
It will only ignore autoprefixer.
But this:
will not ignore coffeescript compilation, because the negation of pattern will take precedence. We can implement this logic, if its really desired. Meanwhile, it is recommended to keep your logic simplified (see this Wolfarm|Alpha's logic expression simplifier).
Precedence:
As describe above, it first skips the negative patterns (those starting with exclamation mark
!
).Then it looks for service-category or service-name. If none is found, it moves on to test the pattern match.
If there was tab-separated service category/name specified on the line, before matching the pattern, it checks if the caller service needs to be ignored (or that it has
!
) and skips accordingly.Take it for a spin with v2.2.3+ ........ 🚗