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

Fixed: ignore variables with signs in value-keyword-case. #2558

Merged
merged 1 commit into from Jun 2, 2017
Merged

Conversation

alexander-akait
Copy link
Member

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

#2404

Is there anything in the PR that needs further explanation?

No, it's self explanatory.

@@ -6,18 +6,26 @@ const hasInterpolation = require("../utils/hasInterpolation")
* Check whether a value is standard
*/
module.exports = function (value/*: string*/)/*: boolean*/ {
let normalizedValue = value

// Ignore signs before variable (example `-$variable`)
Copy link
Member

@ntwb ntwb May 8, 2017

Choose a reason for hiding this comment

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

Maybe Ignore operators before variables (example -$variable) instead of signs?

let normalizedValue = value

// Ignore signs before variable (example `-$variable`)
// Sings `*` and `/` should be removed after resolve this issue in `postcss-value-parser`
Copy link
Member

@ntwb ntwb May 8, 2017

Choose a reason for hiding this comment

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

Spelling Signs, not Sings, or Operators based on comment above

@alexander-akait
Copy link
Member Author

/cc @ntwb

let normalizedValue = value

// Ignore operators before variables (example -$variable)
if (value[0] === "-" || value[0] === "+" || value[0] === "*" || value[0] === "/") {
Copy link
Contributor

Choose a reason for hiding this comment

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

A regular expression makes more sense here, I think. Something like /^[-+\*\/]/.

Copy link
Member

Choose a reason for hiding this comment

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

You don't even need to escape, if I'm not mistaken: /^[-+*/]/.

@jeddy3
Copy link
Member

jeddy3 commented May 17, 2017

@evilebottnawi Am I right in thinking this PR supersedes #2438?

@alexander-akait
Copy link
Member Author

@jeddy3 yep, we can close this issue

@jeddy3
Copy link
Member

jeddy3 commented May 25, 2017

LGTM after David's request is addressed: https://github.com/stylelint/stylelint/pull/2558/files#r116360039

@hudochenkov hudochenkov mentioned this pull request May 25, 2017
5 tasks
@alexander-akait
Copy link
Member Author

/cc @davidtheclark @jeddy3

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

@jeddy3 jeddy3 merged commit 056395d into master Jun 2, 2017
@jeddy3 jeddy3 deleted the issue-2404 branch June 2, 2017 19:41
@jeddy3
Copy link
Member

jeddy3 commented Jun 2, 2017

Changelog:

  • Fixed: value-keyword-case now ignores variables with signs (#2558).

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.

None yet

5 participants