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

Add ignoreUnits option to number-max-precision rule #2941

Merged
merged 1 commit into from
Oct 5, 2017

Conversation

sendilkumarn
Copy link
Contributor

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

#2785

Is there anything in the PR that needs further explanation?

No, it's self explanatory

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.

@sendilkumarn Thanks for this!

I've made a couple of test and docs requests as the option also accepts regexs.

Can you also remove the CHANGELOG item (as we do that after the PR is merged to avoid conflicts) and the yarn.lock file.

Note: let's add yarn.lock to .gitignore in another PR.

@@ -37,3 +37,46 @@ a { top: 3.24px; }
```css
@media (min-width: 3.23em) {}
```
## Optional secondary options
Copy link
Member

Choose a reason for hiding this comment

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

Please add one blank line above the heading.

(Note: Let's see if remark can lint for this).

@@ -37,3 +37,46 @@ a { top: 3.24px; }
```css
@media (min-width: 3.23em) {}
```
## Optional secondary options

### `ignoreUnits: ["string"]`
Copy link
Member

Choose a reason for hiding this comment

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

The optionsMatches util accepts regular expressions as well as strings. Can you update the examples to reflect this please, like so? e.g.

["/^my-/", "%"]
a { top: 3.245my-unit; }


testRule(rule, {
ruleName,
config: [0, { ignoreUnits: ["%"] }],
Copy link
Member

Choose a reason for hiding this comment

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

Can we get update the config to:

ignoreUnits: ["%", "/^my-/"]

And get an accept and reject test for the "/^my-/" value.

@sendilkumarn
Copy link
Contributor Author

@jeddy3 done the changes. 👍

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.

@sendilkumarn Thanks for making the changes (and for the other PRs!).

I've two very minor doc requests, then I think this is ready.


## Optional secondary options

### `ignoreUnits: ["string"]`
Copy link
Member

Choose a reason for hiding this comment

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

### ignoreUnits: ["/regex/", "string"]


### `ignoreUnits: ["string"]`

Ignore number-max-precision rule for the value with the unit.
Copy link
Member

Choose a reason for hiding this comment

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

Can we use the following description, please:

"Ignore the precision of numbers for values with the specified units."

As it's more consistent with the descriptions else where.

adding regex option

fixing comments
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.

@sendilkumarn Thanks for making the changes. LGTM.

@jeddy3 jeddy3 mentioned this pull request Oct 5, 2017
6 tasks
@jeddy3 jeddy3 merged commit 9f22b43 into stylelint:master Oct 5, 2017
@jeddy3
Copy link
Member

jeddy3 commented Oct 5, 2017

  • Added: ignoreUnits option to number-max-precision (#2941).

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

3 participants