UNPKG

1.28 kBMarkdownView Raw
1# number-leading-zero
2
3Require or disallow a leading zero for fractional numbers less than 1.
4
5<!-- prettier-ignore -->
6```css
7a { line-height: 0.5; }
8/** ↑
9 * This leading zero */
10```
11
12This rule ignores mixin parameters in Less.
13
14The [`fix` option](../../../docs/user-guide/usage/options.md#fix) can automatically fix all of the problems reported by this rule.
15
16## Options
17
18`string`: `"always"|"never"`
19
20### `"always"`
21
22There _must always_ be a leading zero.
23
24The following patterns are considered problems:
25
26<!-- prettier-ignore -->
27```css
28a { line-height: .5; }
29```
30
31<!-- prettier-ignore -->
32```css
33a { transform: translate(2px, .4px); }
34```
35
36The following patterns are _not_ considered problems:
37
38<!-- prettier-ignore -->
39```css
40a { line-height: 0.5; }
41```
42
43<!-- prettier-ignore -->
44```css
45a { transform: translate(2px, 0.4px); }
46```
47
48### `"never"`
49
50There _must never_ be a leading zero.
51
52The following patterns are considered problems:
53
54<!-- prettier-ignore -->
55```css
56a { line-height: 0.5; }
57```
58
59<!-- prettier-ignore -->
60```css
61a { transform: translate(2px, 0.4px); }
62```
63
64The following patterns are _not_ considered problems:
65
66<!-- prettier-ignore -->
67```css
68a { line-height: .5; }
69```
70
71<!-- prettier-ignore -->
72```css
73a { transform: translate(2px, .4px); }
74```