I\'m using sass-lint with Gulp. How can I disable warnings for a particular style in my sass from the lint console output?
I\'ve found a similar question but I
As of sass-lint 1.10.0 it's been possible to disable sass-lint rules via source comments
Below are the different permutations of this, intentionally almost identical to the scss-lint way before.
Disable a rule for the entire file
// sass-lint:disable border-zero
p {
border: none; // No lint reported
}
Disable more than 1 rule
// sass-lint:disable border-zero, quotes
p {
border: none; // No lint reported
content: "hello"; // No lint reported
}
p {
border: none; // sass-lint:disable-line border-zero
}
p {
// sass-lint:disable-block border-zero
border: none; // No result reported
}
a {
border: none; // Failing result reported
}
// sass-lint:disable border-zero
p {
border: none; // No result reported
}
// sass-lint:enable border-zero
a {
border: none; // Failing result reported
}
// sass-lint:disable-all
p {
border: none; // No result reported
}
// sass-lint:enable-all
a {
border: none; // Failing result reported
}
The sass-lint readme includes all of the details and the docs have been updated too.
The grunt, gulp and atom plugins have all been updated too to require v1.10 and above so a quick reinstall of these or an update and you'll be ready to go.
We're sorry it took so long to come out but we had to fix a few issues in our AST before we were confident of them being useful.