Skip to content

Commit

Permalink
Tidy up documentation, test cases
Browse files Browse the repository at this point in the history
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
  • Loading branch information
mattxwang and ybiquitous committed Jan 28, 2023
1 parent e54eaf5 commit 5449cd1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 23 deletions.
4 changes: 2 additions & 2 deletions lib/rules/unit-disallowed-list/README.md
Expand Up @@ -167,7 +167,7 @@ For example, with `["px"]`.
Given:

```json
"ignoreFunctions": ["calc", "/^translate/"]
["calc", "/^translate/"]
```

The following patterns are _not_ considered problems:
Expand All @@ -179,5 +179,5 @@ a { margin: calc(50% - 100px) }

<!-- prettier-ignore -->
```css
a { transform: translateX(50% - 100px) }
a { transform: translateX(100px) }
```
26 changes: 5 additions & 21 deletions lib/rules/unit-disallowed-list/__tests__/index.js
Expand Up @@ -403,10 +403,10 @@ testRule({
code: 'a { margin: calc(50% - 100px) }',
},
{
code: 'a { transform: translate(50% - 100px, 100px) }',
code: 'a { transform: translate(100px, 100px) }',
},
{
code: 'a { transform: translateX(50% - 100px) }',
code: 'a { transform: translateX(100px) }',
},
],

Expand All @@ -420,28 +420,12 @@ testRule({
endColumn: 18,
},
{
code: 'a { translateX: 100px }',
code: 'a { translate: 100px }',
message: messages.rejected('px'),
line: 1,
column: 20,
endLine: 1,
endColumn: 22,
},
{
code: 'a { translateY: 100px }',
message: messages.rejected('px'),
line: 1,
column: 20,
endLine: 1,
endColumn: 22,
},
{
code: 'a { translateZ: 100px }',
message: messages.rejected('px'),
line: 1,
column: 20,
column: 19,
endLine: 1,
endColumn: 22,
endColumn: 21,
},
],
});
Expand Down

0 comments on commit 5449cd1

Please sign in to comment.