Fixed: False positive for custom selectors in `selector-pseudo-class-no-unknown` #2141 #2147

Merged
merged 3 commits into from Nov 30, 2016

Projects

None yet

4 participants

@MoOx
Member
MoOx commented Nov 29, 2016

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

#2141

Is there anything in the PR that needs further explanation?

First commit proves it's failing. 2nd fix it.

Hope I fixed this the right way.

Closes #2141

CHANGELOG.md
@@ -5,6 +5,7 @@
- Fixed: `comment-whitespace-inside` no longer complains about `/*!` comments with non-space whitespace (e.g. newlines) ([#2121](https://github.com/stylelint/stylelint/pull/2121))
- Fixed: `selector-max-compound-selectors` ignores SCSS nested declarations ([#2102](https://github.com/stylelint/stylelint/pull/2102))
- Fixed: regression causing `--stdin-filename` in CLI and `codeFilename` in Node API to error if a non-existent filename is provided ([#2128](https://github.com/stylelint/stylelint/pull/2128))
+- Fixed: False positive for custom selectors in `selector-pseudo-class-no-unknown` ([#2141](https://github.com/stylelint/stylelint/pull/2141))
@evilebottnawi
evilebottnawi Nov 29, 2016 Member

Don't add lines in changelog, this added after merge PR

@@ -47,6 +47,9 @@ export default function (actual, options) {
// Ignore pseudo-elements
if (value.slice(0, 2) === "::") { return }
+ // Ignore custom selectors
+ if (value.slice(0, 3) === ":--") { return }
@evilebottnawi
evilebottnawi Nov 29, 2016 Member

Best solution is write util isCustomSelector.js (also add tests) and use it

@evilebottnawi
Member

@MoOx thanks for helping 👍

@evilebottnawi

Great! Thanks!

@MoOx MoOx added a commit to MoOx/phenomic that referenced this pull request Nov 29, 2016
@MoOx MoOx (temporary) Disable "selector-pseudo-class-no-unknown" stylelint rule ( 94c8700
MoOx added some commits Nov 29, 2016
@MoOx MoOx Add failing test for #2141 f2a4352
@MoOx MoOx Fixed: False positive for custom selectors in `selector-pseudo-class-…
…no-unknown`

Hope I fixed this the right way.

Closes #2141
b76eebc
@MoOx
Member
MoOx commented Nov 30, 2016

PR rebased on master ;)

@MoOx MoOx Add isCustomSelector utils and use it for #2141
47ccfa4
@MoOx MoOx added a commit to MoOx/phenomic that referenced this pull request Nov 30, 2016
@MoOx MoOx (temporary) Disable "selector-pseudo-class-no-unknown" stylelint rule ( 9c10e37
@davidtheclark
Contributor

👍

@jeddy3
jeddy3 approved these changes Nov 30, 2016 View changes

Thanks for rebasing as well @MoOx !

@jeddy3 jeddy3 merged commit de0c4bf into master Nov 30, 2016

3 of 4 checks passed

coverage/coveralls Coverage increased (+0.005%) to 91.891%
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@jeddy3 jeddy3 deleted the fix-2141 branch Nov 30, 2016
@jeddy3
Member
jeddy3 commented Nov 30, 2016

Added to changelog as:

  • Fixed: selector-pseudo-class-no-unknown no longer reports false positives for custom selectors (#2147).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment