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

3 participants
@sendilkumarn
Contributor

sendilkumarn commented Oct 4, 2017

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

@jeddy3

@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

This comment has been minimized.

@jeddy3

jeddy3 Oct 5, 2017

Member

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"]`

This comment has been minimized.

@jeddy3

jeddy3 Oct 5, 2017

Member

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: ["%"] }],

This comment has been minimized.

@jeddy3

jeddy3 Oct 5, 2017

Member

Can we get update the config to:

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

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

@sendilkumarn sendilkumarn force-pushed the sendilkumarn:ignore-num-max-precision branch from 520b777 to d22eabb Oct 5, 2017

@sendilkumarn

This comment has been minimized.

Contributor

sendilkumarn commented Oct 5, 2017

@jeddy3 done the changes. 👍

@jeddy3

@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"]`

This comment has been minimized.

@jeddy3

jeddy3 Oct 5, 2017

Member

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

### `ignoreUnits: ["string"]`
Ignore number-max-precision rule for the value with the unit.

This comment has been minimized.

@jeddy3

jeddy3 Oct 5, 2017

Member

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.

Add ignoreUnits option to number-max-precision rule
adding regex option

fixing comments

@sendilkumarn sendilkumarn force-pushed the sendilkumarn:ignore-num-max-precision branch from d22eabb to e31a988 Oct 5, 2017

@jeddy3

jeddy3 approved these changes Oct 5, 2017 edited

@sendilkumarn Thanks for making the changes. LGTM.

@jeddy3 jeddy3 referenced this pull request Oct 5, 2017

Closed

Release 8.2.0 #2913

6 of 6 tasks complete

@jeddy3 jeddy3 merged commit 9f22b43 into stylelint:master Oct 5, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jeddy3

This comment has been minimized.

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