Giter VIP home page Giter VIP logo

Comments (14)

Mouvedia avatar Mouvedia commented on June 9, 2024 1

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 for value-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.

ybiquitous avatar ybiquitous commented on June 9, 2024 1

Agree. We'd like to release stylelint and stylelint-config-standard only once.

from stylelint.

ybiquitous avatar ybiquitous commented on June 9, 2024

@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- to reference/prefixes.mjs will affect selector-no-vendor-prefix, but are there any -apple- selectors? And, if there are (e.g. :-apple-foo-bar), will this addition fix also selector-no-vendor-prefix false negatives?
  • You suggest adding also -konq- and -khtml-, but what is rationale to add them, too?

from stylelint.

Mouvedia avatar Mouvedia commented on June 9, 2024

โ€ฆ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:

  1. technically we could have 2 export for each rule (only change selector-no-vendor-prefix before v17)
  2. 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.

ybiquitous avatar ybiquitous commented on June 9, 2024

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.

ybiquitous avatar ybiquitous commented on June 9, 2024

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 of value-no-vendor-prefix

from stylelint.

Mouvedia avatar Mouvedia commented on June 9, 2024

โ€ฆ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 of value-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.

ybiquitous avatar ybiquitous commented on June 9, 2024

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.

Mouvedia avatar Mouvedia commented on June 9, 2024

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.

ybiquitous avatar ybiquitous commented on June 9, 2024

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/).

if (optionsMatches(secondaryOptions, 'ignoreValues', vendor.unprefixed(value))) {
return;
}

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.

Mouvedia avatar Mouvedia commented on June 9, 2024

You can probably parse ignoreValues values.
Anyhow that's up to the implementor to decide.

from stylelint.

ybiquitous avatar ybiquitous commented on June 9, 2024

You can probably parse ignoreValues values.

Hum, I'd like to avoid parsing the option values since it seems too complicated... ๐Ÿค”

from stylelint.

Mouvedia avatar Mouvedia commented on June 9, 2024

@ybiquitous Should I create another issue for ["/regex/", /regex/]?
If not is the secondary option update ready to be implemented?

from stylelint.

ybiquitous avatar ybiquitous commented on June 9, 2024

@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 for value-no-vendor-prefix

After the processes completes, we can fix false negatives reported in this issue. Any thoughts?

from stylelint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.