Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix selector-{type,pseudo-class}-no-unknown and selector-type-case false positives for deprecated selectors #8264

Merged
merged 2 commits into from
Dec 31, 2024

Conversation

Mouvedia
Copy link
Member

@Mouvedia Mouvedia commented Dec 31, 2024

Which issue, if any, is this issue related to?

#8225

Resources

Is there anything in the PR that needs further explanation?

Since Mozilla never went ahead with https://bugzilla.mozilla.org/show_bug.cgi?id=371323 back in 2007 I chose not to include :nth-column and :nth-last-column. They were supported by sel though.
We can discuss whether we should add these 2 and :active-drop-target, :valid-drop-target, :invalid-drop-target, :nth-match and :nth-last-match in #8225.
i.e. this PR goal is not to be exhaustive

Copy link

changeset-bot bot commented Dec 31, 2024

🦋 Changeset detected

Latest commit: c4cf677

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
stylelint Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@@ -85,6 +106,7 @@ export const mixedCaseSvgTypeSelectors = new Set([
'feTurbulence',
'foreignObject',
'glyphRef',
'hatchPath',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -100,11 +100,12 @@ const rule = (primary, secondaryOptions) => {

const tagName = tagNode.value;
const tagNameLowerCase = tagName.toLowerCase();
// SVG tags are case-sensitive
const svgTypeSelectors = [...svgTags, 'hatch', 'hatchpath', 'hatchPath'];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mouvedia Mouvedia marked this pull request as ready for review December 31, 2024 11:25
@Mouvedia Mouvedia requested a review from jeddy3 December 31, 2024 11:26
@@ -231,6 +255,15 @@ export const linguisticPseudoClasses = new Set(['dir', 'lang']);

export const logicalCombinationsPseudoClasses = new Set(['has', 'is', 'matches', 'not', 'where']);

export const deprecatedPseudoClasses = new Set([
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note

Depending on whether the PR that adds selector-no-deprecated will have a fixer or not, deprecatedPseudoClasses should or should not be exported.

@jeddy3 jeddy3 changed the title Prepare selector-no-deprecated addition Fix selector-*-unknown|case false positives for deprecated selectors Dec 31, 2024
Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you.

And thank you for diving into the specs and other resources to uncover these.

@Mouvedia Mouvedia changed the title Fix selector-*-unknown|case false positives for deprecated selectors Fix selector-{type,pseudo-class}-no-unknown and selector-type-case false positives for deprecated selectors Dec 31, 2024
@Mouvedia Mouvedia merged commit 1709aa5 into stylelint:main Dec 31, 2024
17 checks passed
@Mouvedia Mouvedia deleted the prepare-8225 branch December 31, 2024 14:13
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Jan 12, 2025
| datasource | package   | from    | to      |
| ---------- | --------- | ------- | ------- |
| npm        | stylelint | 16.12.0 | 16.13.0 |


## [v16.13.0](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#16130---2025-01-12)

It adds 3 rules to help you write error-free at-rules and 2 rules to warn you about deprecated CSS features. We've turned these rules on in our [standard config](https://www.npmjs.com/package/stylelint-config-standard).

It also adds new rule options, a feature to display how long rules take, lax autofix and support for `messageArgs` in more rules. It fixes 7 bugs.

Lastly, we've made a deprecation that may affect some plugins. We've updated our docs for [plugin authors](docs/developer-guide/plugins.md#quiet-deprecation-warnings) and [end users](docs/user-guide/options.md#quietdeprecationwarnings) on how to silence deprecation warnings.

-   Deprecated: ambiguous position arguments passed to `utils.report()` ([#8244](stylelint/stylelint#8244)) ([@romainmenke](https://github.com/romainmenke)).
-   Added: `lax`/`strict` values to the `fix` Node.js API option and CLI flag ([#8106](stylelint/stylelint#8106)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: support for profiling rule performance via the `TIMING` environment variable ([#8108](stylelint/stylelint#8108)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `at-rule-descriptor-no-unknown` rule ([#8197](stylelint/stylelint#8197)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `at-rule-descriptor-value-no-unknown` rule ([#8211](stylelint/stylelint#8211)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `at-rule-no-deprecated` rule ([#8251](stylelint/stylelint#8251)) ([@jeddy3](https://github.com/jeddy3)).
-   Added: `at-rule-prelude-no-invalid` rule ([#8268](stylelint/stylelint#8268)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `declaration-property-value-keyword-no-deprecated` rule ([#8223](stylelint/stylelint#8223)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Added: `"ignore": ["at-rule-preludes", "declaration-values"]` to `string-no-newline` ([#8214](stylelint/stylelint#8214)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `messageArgs` to `declaration-property-value-no-unknown`, `font-family-name-quotes`, `font-family-no-duplicate-names`, `function-calc-no-unspaced-operator`, `import-notation`, `media-feature-name-unit-allowed-list`, `selector-attribute-quotes` and `selector-pseudo-element-colon-notation` ([#8285](stylelint/stylelint#8285) & [#8252](stylelint/stylelint#8252)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: deprecation warnings to only display once per (custom) rule ([#8265](stylelint/stylelint#8265)) ([@romainmenke](https://github.com/romainmenke)).
-   Fixed: `*-no-vendor-prefix` message ambiguity ([#8239](stylelint/stylelint#8239)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `at-rule-(dis)allowed-list`, `at-rule-no-vendor-prefix`, `at-rule-property-required-list` message argument ([#8277](stylelint/stylelint#8277)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `at-rule-property-required-list` message for inclusion of properties and descriptors ([#8207](stylelint/stylelint#8207)) ([@jeddy3](https://github.com/jeddy3)).
-   Fixed: `at-rule-*` false positives and negatives for `@charset` rule ([#8215](stylelint/stylelint#8215)) ([@jeddy3](https://github.com/jeddy3)).
-   Fixed: `declaration-property-value-no-unknown` false positives for descriptors ([#8240](stylelint/stylelint#8240)) ([@jeddy3](https://github.com/jeddy3)).
-   Fixed: `property-(dis)allowed-list` false negatives for custom properties, use `/^--/` to (dis)allow them ([#8209](stylelint/stylelint#8209)) ([@fbasmaison-lucca](https://github.com/fbasmaison-lucca)).
-   Fixed: `property-no-unknown` false positives for descriptors ([#8203](stylelint/stylelint#8203)) ([@jeddy3](https://github.com/jeddy3)).
-   Fixed: `selector-pseudo-class-no-unknown` false positives for deprecated pseudo-classes ([#8264](stylelint/stylelint#8264)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `selector-type-case` false positives for `hatchPath` ([#8264](stylelint/stylelint#8264)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `selector-type-no-unknown` false positives for `shadow`, `hatch` and `hatchpath` ([#8264](stylelint/stylelint#8264)) ([@Mouvedia](https://github.com/Mouvedia)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants