Comments (14)
please create another issue
Done.
Show a warning ifโฆ
I will only do it if the value starts with a known prefix.
Update
stylelint-config-standard
to rewrite the string values to regex ones forvalue-no-vendor-prefix
After the processes completes, we can fix false negatives reported in this issue. Any thoughts?
stylelint-config-standard
will have to be updated twice: once for string to regex and once for the "/^-apple-system$/"
addition. I would prefer to wait for both issues to be fixed on stylelint/stylelint to move on with the PR.
from stylelint.
Agree. We'd like to release stylelint
and stylelint-config-standard
only once.
from stylelint.
@Mouvedia Thanks for the report. Supporting the -apple-
prefix sounds good to me. ๐๐ผ
And, adding regex support to the ignoreValues
secondary option of value-no-vendor-prefix
seems no problem. ๐๐ผ
Just to be sure, I have a few questions:
- Adding
-apple-
toreference/prefixes.mjs
will affectselector-no-vendor-prefix
, but are there any-apple-
selectors? And, if there are (e.g.:-apple-foo-bar
), will this addition fix alsoselector-no-vendor-prefix
false negatives? - You suggest adding also
-konq-
and-khtml-
, but what is rationale to add them, too?
from stylelint.
โฆbut are there any
-apple-
selectors?
If you are talking about properties there are 3 AFAIK:
-apple-dashboard-region
-apple-line-clamp
-apple-text-size-adjust
โฆwill this addition fix also
selector-no-vendor-prefix
false negatives?
It will but it's not problematic. The problem is that this fix requires to update the ignoreValues
option of value-no-vendor-prefix
. It's similar to #7232 in the sense that a fix must be accompanied by its cure or it would be a downgrade.
And depending on our policies, updating ['string']
might require to wait for the next major.
There are 2 alternatives:
- technically we could have 2
export
for each rule (only changeselector-no-vendor-prefix
before v17) - add
["/regex/", /regex/]
and wait for v17 to update['string']
(make it exact match)
I vote for 2 because you can do exact match using regexes too. If so a new issue will have to be created akin to #7542.
tl;dr: the fix for selector-no-vendor-prefix
is uncomplicated, for value-no-vendor-prefix
it requires to update stylelint-config-standard
and its secondary option.
โฆbut what is rationale to add them, too?
Adding all the prefixes that ever existed makes sense.
At least that's what I would expect from *-no-vendor-prefix
rules.
from stylelint.
Adding all the prefixes that ever existed makes sense.
At least that's what I would expect from*-no-vendor-prefix
rules.
Okay. For -konq-
and -khtml-
, are there any resources? If yes, it seems good to leave a comment with links to such resources in reference/prefixes.mjs
.
EDIT: Because many people may not know the -apple-
, -konq-
, and -khtml-
prefixes.
from stylelint.
And depending on our policies, updating
['string']
might require to wait for the next major.
Just to confirm, does this update mean the following in my previous comment (#7624 (comment))? ๐๐ผ
adding regex support to the
ignoreValues
secondary option ofvalue-no-vendor-prefix
from stylelint.
โฆare there any resources?
Yes, Iv linked to it in #7016 (review)
โฆit seems good to leave a comment with links to such resources in
reference/prefixes.mjs
.
๐
And depending on our policies, updating
['string']
might require to wait for the next major.Just to confirm, does this update mean the following in my previous comment (#7624 (comment))? ๐๐ผ
adding regex support to the
ignoreValues
secondary option ofvalue-no-vendor-prefix
If I did the PR, I would add support for ["/regex/", /regex/]
without updating ["string"]
.
i.e. "a new issue will have to be created akin to #7542" to cover the breaking change
from stylelint.
Sorry, I can't still understand what you mean... It seems that it's not breaking to change ignoreValues: ["string"]
to ignoreValues: ["/regex/", /regex/, "string"]
๐ค
from stylelint.
It depends on how you proceed :)
Currently ["string"]
picks up prefixes by default.
e.g. ['foo']
will match -webkit-foo
That's undesirable and unexpected and ["/regex/", /regex/]
won't work that way.
e.g. stylelint-config-standard
currently is ignoring more than it should
see stylelint/stylelint-config-standard#261 (comment)
So until the next major there will be inconsistencies between ["/regex/", /regex/]
and ["string"]
.
Is that clearer?
from stylelint.
Ah, I now understand the problem here. ๐
The current ignoreValues
option of value-no-vendor-prefix
works on unprefixed values, but we'd like to support regex for a whole value (e.g. /^-apple-system/
).
stylelint/lib/rules/value-no-vendor-prefix/index.mjs
Lines 55 to 57 in 9959110
Indeed, this may a breaking change. So, cannot we add the regex support, keeping compatibility? ๐ค
E.g.
if (optionsMatches(secondaryOptions, 'ignoreValues', vendor.unprefixed(value))) {
return;
}
+if (optionsMatches(secondaryOptions, 'ignoreValues', value)) {
+ return;
+}
from stylelint.
You can probably parse ignoreValues
values.
Anyhow that's up to the implementor to decide.
from stylelint.
You can probably parse
ignoreValues
values.
Hum, I'd like to avoid parsing the option values since it seems too complicated... ๐ค
from stylelint.
@ybiquitous Should I create another issue for ["/regex/", /regex/]
?
If not is the secondary option update ready to be implemented?
from stylelint.
@Mouvedia Yes, please create another issue. For the secondary option, I guess:
- Add regex support. Specified regex should match a whole value rather than an unprefixed value. E.g.
ignoreValues: [/^-apple-/]
should match-apple-system
or-apple-foo
etc. - Show a warning if a string is included in
ignoreValues
. E.g.String values in "ignoredValues" for "value-no-vendor-prefix" will match a whole declaration value rather than a unprefixed value in the next major version. If you want to keep the current behavior, please consider using a regex
- Update
stylelint-config-standard
to rewrite the string values to regex ones forvalue-no-vendor-prefix
After the processes completes, we can fix false negatives reported in this issue. Any thoughts?
from stylelint.
Related Issues (20)
- Create option to extend rule: font-family-no-duplicate-names HOT 1
- Create option to extend rule: no-duplicate-at-import-rules HOT 1
- Create option to extend rule: no-unknown-animations HOT 1
- CLI doesn't seem to work as expected. HOT 2
- [16.4.0] Cannot suppress `selector-max-universal` HOT 4
- Add regex support to `value-no-vendor-prefix` secondary option
- Provide links to message HOT 4
- Fix `shorthand-property-no-redundant-values` false negatives for `var()` HOT 10
- Add flags/options to set custom exit codes depending on the severity 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
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.