@taiga-ui/stylelint-config 0.521.0 → 0.523.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -12
- package/configs/recommended.d.ts +6 -0
- package/configs/taiga-specific.d.ts +6 -0
- package/docs/no-mask-shorthand.md +28 -0
- package/docs/no-webkit-box-orient-block-axis.md +25 -0
- package/docs/relative-less-import-extension.md +21 -0
- package/index.d.ts +1 -6
- package/index.esm.js +964 -0
- package/index.esm.js.map +1 -0
- package/package.json +66 -53
- package/rules/no-mask-shorthand.d.ts +1 -1
- package/rules/no-webkit-box-orient-block-axis.d.ts +1 -1
- package/rules/relative-less-import-extension.d.ts +1 -1
- package/taiga-specific.d.ts +1 -6
- package/{taiga-specific.js → taiga-specific.esm.js} +4 -4
- package/taiga-specific.esm.js.map +1 -0
- package/index.js +0 -398
- package/index.js.map +0 -1
- package/rules/no-mask-shorthand.js +0 -433
- package/rules/no-mask-shorthand.js.map +0 -1
- package/rules/no-webkit-box-orient-block-axis.js +0 -47
- package/rules/no-webkit-box-orient-block-axis.js.map +0 -1
- package/rules/relative-less-import-extension.js +0 -101
- package/rules/relative-less-import-extension.js.map +0 -1
- package/taiga-specific.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,22 +1,64 @@
|
|
|
1
1
|
# @taiga-ui/stylelint-config
|
|
2
2
|
|
|
3
|
-
Common Stylelint configuration for
|
|
3
|
+
Common Stylelint configuration for Taiga UI projects.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
```bash
|
|
6
|
+
npm i -D stylelint @taiga-ui/stylelint-config
|
|
7
|
+
```
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
`stylelint.config.mjs`
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
**Attention**: package does not support CommonJS, use `stylelint.config.mjs` or `stylelint.config.js` in a module
|
|
12
|
+
package instead of `stylelint.config.cjs`.
|
|
13
|
+
|
|
14
|
+
```js
|
|
15
|
+
export default {
|
|
16
|
+
extends: ['@taiga-ui/stylelint-config'],
|
|
17
|
+
};
|
|
11
18
|
```
|
|
12
19
|
|
|
13
|
-
|
|
20
|
+
Taiga UI projects can also add the stricter package-specific config:
|
|
14
21
|
|
|
15
|
-
```
|
|
16
|
-
{
|
|
17
|
-
extends: ['@taiga-ui/stylelint-config/taiga'],
|
|
18
|
-
}
|
|
22
|
+
```js
|
|
23
|
+
export default {
|
|
24
|
+
extends: ['@taiga-ui/stylelint-config', '@taiga-ui/stylelint-config/taiga-specific'],
|
|
25
|
+
};
|
|
19
26
|
```
|
|
20
27
|
|
|
21
|
-
|
|
22
|
-
|
|
28
|
+
## Configs
|
|
29
|
+
|
|
30
|
+
| Config | Entry point | Description |
|
|
31
|
+
| ---------------- | ------------------------------------------- | ------------------------------------------------ |
|
|
32
|
+
| `recommended` | `@taiga-ui/stylelint-config` | Common CSS, Less, compatibility, and style rules |
|
|
33
|
+
| `taiga-specific` | `@taiga-ui/stylelint-config/taiga-specific` | Taiga UI custom property naming |
|
|
34
|
+
|
|
35
|
+
## Recommended config contents
|
|
36
|
+
|
|
37
|
+
The root entry point combines Taiga UI custom rules with external Stylelint presets and plugins. The exact options live
|
|
38
|
+
in
|
|
39
|
+
[`configs/recommended.ts`](https://github.com/taiga-family/toolkit/blob/main/projects/stylelint-config/configs/recommended.ts).
|
|
40
|
+
|
|
41
|
+
| Package | What is included in `recommended` |
|
|
42
|
+
| --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- |
|
|
43
|
+
| [Stylelint core](https://stylelint.io/user-guide/rules) | Individual CSS correctness and formatting rules |
|
|
44
|
+
| [@stylistic/stylelint-config](https://github.com/stylelint-stylistic/stylelint-stylistic) | Base stylistic preset |
|
|
45
|
+
| [@stylistic/stylelint-plugin](https://github.com/stylelint-stylistic/stylelint-stylistic) | Individual stylistic rule overrides |
|
|
46
|
+
| [stylelint-plugin-logical-css](https://github.com/yuschick/stylelint-plugin-logical-css) | Logical property and keyword rules |
|
|
47
|
+
| [stylelint-use-logical](https://github.com/csstools/stylelint-use-logical) | Logical CSS migration rules |
|
|
48
|
+
| [stylelint-order](https://github.com/hudochenkov/stylelint-order) | Property ordering |
|
|
49
|
+
| [stylelint-rem-over-px](https://github.com/a-tarasyuk/stylelint-rem-over-px) | Prefer `rem` values over most `px` values |
|
|
50
|
+
| [stylelint-plugin-use-baseline](https://github.com/ryo-manba/stylelint-plugin-use-baseline) | Baseline browser feature checks |
|
|
51
|
+
| [stylelint-no-unsupported-browser-features](https://github.com/ismay/stylelint-no-unsupported-browser-features) | Browserslist compatibility checks |
|
|
52
|
+
| Taiga UI custom rules | Project-specific rules listed below |
|
|
53
|
+
|
|
54
|
+
- ✅ = recommended
|
|
55
|
+
- 🔧 = fixable
|
|
56
|
+
|
|
57
|
+
| Rule | Description | ✅ | 🔧 |
|
|
58
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------- | --- | --- |
|
|
59
|
+
| [no-mask-shorthand](https://github.com/taiga-family/toolkit/tree/main/projects/stylelint-config/docs/no-mask-shorthand.md) | Expands `mask` shorthand declarations into explicit longhand declarations | ✅ | 🔧 |
|
|
60
|
+
| [no-webkit-box-orient-block-axis](https://github.com/taiga-family/toolkit/tree/main/projects/stylelint-config/docs/no-webkit-box-orient-block-axis.md) | Replaces `-webkit-box-orient: block-axis` with `vertical` | ✅ | 🔧 |
|
|
61
|
+
| [relative-less-import-extension](https://github.com/taiga-family/toolkit/tree/main/projects/stylelint-config/docs/relative-less-import-extension.md) | Adds an explicit extension to relative stylesheet imports | ✅ | 🔧 |
|
|
62
|
+
|
|
63
|
+
More information about configuring Stylelint is available in the
|
|
64
|
+
[Stylelint documentation](https://stylelint.io/user-guide/configure).
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# no-mask-shorthand
|
|
2
|
+
|
|
3
|
+
<sup>`✅ Recommended`</sup> <sup>`Fixable`</sup>
|
|
4
|
+
|
|
5
|
+
> ✅ Included in `recommended`.
|
|
6
|
+
|
|
7
|
+
Disallows the `mask` shorthand and expands it into explicit `mask-*` longhand declarations. This keeps resets visible,
|
|
8
|
+
avoids accidental changes to unrelated mask longhands, and makes review diffs easier to read. Autofix is skipped for
|
|
9
|
+
CSS-wide keywords, CSS variables, and values the rule cannot safely classify.
|
|
10
|
+
|
|
11
|
+
```css
|
|
12
|
+
/* ❌ error */
|
|
13
|
+
.icon {
|
|
14
|
+
mask: url('icon.svg') no-repeat center / 1rem;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* ✅ after autofix */
|
|
18
|
+
.icon {
|
|
19
|
+
mask-image: url('icon.svg');
|
|
20
|
+
mask-repeat: no-repeat;
|
|
21
|
+
mask-position: center;
|
|
22
|
+
mask-size: 1rem;
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Options
|
|
27
|
+
|
|
28
|
+
This rule has no options.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# no-webkit-box-orient-block-axis
|
|
2
|
+
|
|
3
|
+
<sup>`✅ Recommended`</sup> <sup>`Fixable`</sup>
|
|
4
|
+
|
|
5
|
+
> ✅ Included in `recommended`.
|
|
6
|
+
|
|
7
|
+
Disallows `-webkit-box-orient: block-axis` and replaces it with `-webkit-box-orient: vertical`. Legacy WebKit line
|
|
8
|
+
clamping depends on the physical `vertical` value, so the logical `block-axis` value can break truncation in browsers
|
|
9
|
+
that still rely on this property.
|
|
10
|
+
|
|
11
|
+
```css
|
|
12
|
+
/* ❌ error */
|
|
13
|
+
.title {
|
|
14
|
+
-webkit-box-orient: block-axis;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* ✅ after autofix */
|
|
18
|
+
.title {
|
|
19
|
+
-webkit-box-orient: vertical;
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Options
|
|
24
|
+
|
|
25
|
+
This rule has no options.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# relative-less-import-extension
|
|
2
|
+
|
|
3
|
+
<sup>`✅ Recommended`</sup> <sup>`Fixable`</sup>
|
|
4
|
+
|
|
5
|
+
> ✅ Included in `recommended`.
|
|
6
|
+
|
|
7
|
+
Requires relative stylesheet imports to include an explicit file extension. The autofix uses the current file extension
|
|
8
|
+
when it is `.less`, `.scss`, or `.css`, and falls back to `.less` otherwise. Package imports, absolute imports, URLs,
|
|
9
|
+
data URLs, and paths that already include a style extension are ignored.
|
|
10
|
+
|
|
11
|
+
```css
|
|
12
|
+
/* ❌ error */
|
|
13
|
+
@import './tokens';
|
|
14
|
+
|
|
15
|
+
/* ✅ after autofix */
|
|
16
|
+
@import './tokens.less';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Options
|
|
20
|
+
|
|
21
|
+
This rule has no options.
|