-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
1,475 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
pageClass: "rule-details" | ||
sidebarDepth: 0 | ||
title: "css/no-number-trailing-zeros" | ||
description: "disallow trailing zeros in numbers." | ||
--- | ||
# css/no-number-trailing-zeros | ||
|
||
> disallow trailing zeros in numbers. | ||
- :exclamation: <badge text="This rule has not been released yet." vertical="middle" type="error"> ***This rule has not been released yet.*** </badge> | ||
- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. | ||
|
||
## :book: Rule Details | ||
|
||
This rule aims to remove unnecessary trailing zeros. | ||
|
||
This rule was inspired by [Stylelint's number-no-trailing-zeros rule](https://stylelint.io/user-guide/rules/list/color-no-invalid-hex/). | ||
|
||
<eslint-code-block fix> | ||
|
||
```js | ||
/* eslint css/no-number-trailing-zeros: "error" */ | ||
|
||
/* ✓ GOOD */ | ||
var foo = <div | ||
style={ | ||
{ | ||
height: '0.5px' | ||
} | ||
} > | ||
</div> | ||
|
||
/* ✗ BAD */ | ||
var foo = <div | ||
style={ | ||
{ | ||
height: '0.50px' | ||
} | ||
} > | ||
</div> | ||
``` | ||
|
||
</eslint-code-block> | ||
|
||
## :wrench: Options | ||
|
||
Nothing. | ||
|
||
## :books: Further reading | ||
|
||
- [Stylelint - number-no-trailing-zeros] | ||
|
||
[Stylelint - number-no-trailing-zeros]: https://stylelint.io/user-guide/rules/list/number-no-trailing-zeros/ | ||
|
||
## :mag: Implementation | ||
|
||
- [Rule source](https://github.com/ota-meshi/eslint-plugin-css/blob/main/lib/rules/no-number-trailing-zeros.ts) | ||
- [Test source](https://github.com/ota-meshi/eslint-plugin-css/blob/main/tests/lib/rules/no-number-trailing-zeros.ts) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
--- | ||
pageClass: "rule-details" | ||
sidebarDepth: 0 | ||
title: "css/number-leading-zero" | ||
description: "require or disallow a leading zero for fractional numbers less than 1" | ||
--- | ||
# css/number-leading-zero | ||
|
||
> require or disallow a leading zero for fractional numbers less than 1 | ||
- :exclamation: <badge text="This rule has not been released yet." vertical="middle" type="error"> ***This rule has not been released yet.*** </badge> | ||
- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. | ||
|
||
## :book: Rule Details | ||
|
||
This rule aims to consistently require or disallow leading zeros for fractional numbers less than one. | ||
|
||
This rule was inspired by [Stylelint's number-leading-zero rule](https://stylelint.io/user-guide/rules/list/number-leading-zero/). | ||
|
||
<eslint-code-block fix> | ||
|
||
```js | ||
/* eslint css/number-leading-zero: "error" */ | ||
|
||
/* ✓ GOOD */ | ||
var foo = <div | ||
style={ | ||
{ | ||
height: '0.5px' | ||
} | ||
} > | ||
</div> | ||
|
||
/* ✗ BAD */ | ||
var foo = <div | ||
style={ | ||
{ | ||
height: '.5px' | ||
} | ||
} > | ||
</div> | ||
``` | ||
|
||
</eslint-code-block> | ||
|
||
## :wrench: Options | ||
|
||
```json | ||
{ | ||
"css/number-leading-zero": ["error", | ||
"always" // or "never" | ||
] | ||
} | ||
``` | ||
|
||
- `"always"` ... Require always have leading zero. | ||
- `"never"` ... Disallow leading zero. | ||
|
||
## :books: Further reading | ||
|
||
- [Stylelint - number-leading-zero] | ||
|
||
[Stylelint - number-leading-zero]: https://stylelint.io/user-guide/rules/list/number-leading-zero/ | ||
|
||
## :mag: Implementation | ||
|
||
- [Rule source](https://github.com/ota-meshi/eslint-plugin-css/blob/main/lib/rules/number-leading-zero.ts) | ||
- [Test source](https://github.com/ota-meshi/eslint-plugin-css/blob/main/tests/lib/rules/number-leading-zero.ts) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
pageClass: "rule-details" | ||
sidebarDepth: 0 | ||
title: "css/prefer-reduce-shorthand-property-box-values" | ||
description: "require reduction in box values of shorthand property" | ||
--- | ||
# css/prefer-reduce-shorthand-property-box-values | ||
|
||
> require reduction in box values of shorthand property | ||
- :exclamation: <badge text="This rule has not been released yet." vertical="middle" type="error"> ***This rule has not been released yet.*** </badge> | ||
- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. | ||
|
||
## :book: Rule Details | ||
|
||
This rule aims to reduce the box values of the shorthand properties. | ||
|
||
This rule was inspired by [Stylelint's shorthand-property-no-redundant-values rule](https://stylelint.io/user-guide/rules/list/shorthand-property-no-redundant-values/). | ||
|
||
<eslint-code-block fix> | ||
|
||
```js | ||
/* eslint css/prefer-reduce-shorthand-property-box-values: "error" */ | ||
|
||
/* ✓ GOOD */ | ||
var foo = <div | ||
style={ | ||
{ | ||
padding: '8px' | ||
} | ||
} > | ||
</div> | ||
|
||
/* ✗ BAD */ | ||
var foo = <div | ||
style={ | ||
{ | ||
padding: '8px 8px 8px 8px' | ||
} | ||
} > | ||
</div> | ||
``` | ||
|
||
</eslint-code-block> | ||
|
||
## :wrench: Options | ||
|
||
Nothing. | ||
|
||
## :books: Further reading | ||
|
||
- [Stylelint - shorthand-property-no-redundant-values] | ||
|
||
[Stylelint - shorthand-property-no-redundant-values]: https://stylelint.io/user-guide/rules/list/shorthand-property-no-redundant-values/ | ||
|
||
## :mag: Implementation | ||
|
||
- [Rule source](https://github.com/ota-meshi/eslint-plugin-css/blob/main/lib/rules/prefer-reduce-shorthand-property-box-values.ts) | ||
- [Test source](https://github.com/ota-meshi/eslint-plugin-css/blob/main/tests/lib/rules/prefer-reduce-shorthand-property-box-values.ts) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.