Comments (10)
@ybiquitous Yes, you got it right. I need this to do a warning job in GitLab CI. As @Mouvedia suggested, this can be done through the flag feature, then it won’t break anything.
from stylelint.
The eslint cli also does not have this option, so I opened an issue for them. Let's see what they answer me there.
from stylelint.
If you add --max-warnings 0
it should exit 2
if you have 1 or more warnings.
from stylelint.
This option doesn't suit me. I want my job to not crash with an error when stylelint ended with warning. What i want:
- stylelint command completed successfully (0 errors, 0 warnings) - job successful
- stylelint command ended with warnings (0 errors, more than 0 warnings) - job warning
- stylelint command ended with errors (more than 0 errors) - job errors
In GitLab CI this can be implemented using exit code.
from stylelint.
That sounds like a change that would break many scripts that assumes 2
for errors and --max-warnings
.
It could possibly be done in the next major version.
Adding 2 new flags that sets custom exit code for lint problems of severity error and warning could be a solution in the meantime.
e.g. --lint-error-code 3
, --lint-warning-code 4
It must fail if the custom code is one of the reserved ones.
from stylelint.
Adding the flags feature sounds like a cool solution that won't break anything. At the same time, it will solve my problem.
from stylelint.
@ybiquitous what's your take on this?
It seems like a legitimate request. Do you have proposals for the names?
from stylelint.
@alSergey Just to clarify, you want a different exit code from 0
if lint problems are only warning, right?
$ stylelint error-and-warning.css
...
✖ 2 problems (1 error, 1 warning)
$ echo $?
2
$ stylelint warning.css
...
⚠ 1 problem (0 errors, 1 warning)
$ echo $?
0 #=> Do you want a different exit code here?
from stylelint.
@alSergey Thanks for the answer. I understand your motivation. I was wondering if ESLint CLI had already provided a similar option (I couldn't find such an option in the ESLint doc). If you have the same problem with ESLint, can you please provide us with some information?
from stylelint.
Thanks for sharing the ESLint issue. I agree with seeing an ESLint team's answer.
from stylelint.
Related Issues (20)
- Fix `shorthand-property-no-redundant-values` false negatives for `var()` HOT 10
- TypeScript reports "Type 'CosmiconfigResult' is not generic" HOT 1
- Release 16.5.0 HOT 5
- Stylelint --fix does not fix two problems at the same time: the order/properties-order property, and the removal of extra empty lines. HOT 4
- no-missing-end-of-source-newline false positive after upgrade to v16.4.0 (from 15.11.0) HOT 1
- SCSS: Issue with double slash comment HOT 1
- DeprecationWarning: fs.Stats constructor is deprecated HOT 6
- Node.js API should allow fixing a list of files in-place HOT 3
- Rule idea: `declaration-prefer-shorthand` HOT 2
- Fix `selector-type-no-unknown` false positive for `model`
- Release 16.6.0 HOT 11
- Missing semicolon in JSON file HOT 5
- Fix `no-descending-specificity` false positives for nested selectors HOT 2
- Release 16.6.1 HOT 5
- breaking changes for `property-no-vendor-prefix` HOT 6
- New rule: identifier-pattern HOT 12
- Remove `postcssResult.stylelint.disableWritingFix` HOT 7
- Unknown rule no-extra-semicolons. HOT 3
- `block-no-empty` false `needless-disable` in blocks with comments. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stylelint.