@anolilab/stylelint-config 4.0.2 → 4.0.4
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/CHANGELOG.md +20 -0
- package/README.md +50 -8
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## @anolilab/stylelint-config [4.0.4](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/stylelint-config@4.0.3...@anolilab/stylelint-config@4.0.4) (2023-06-23)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Dependencies
|
|
6
|
+
|
|
7
|
+
* **@anolilab/package-json-utils:** upgraded to 1.5.0
|
|
8
|
+
* **browserslist-config-anolilab:** upgraded to 4.0.6
|
|
9
|
+
* **@anolilab/semantic-release-preset:** upgraded to 4.0.0
|
|
10
|
+
|
|
11
|
+
## @anolilab/stylelint-config [4.0.3](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/stylelint-config@4.0.2...@anolilab/stylelint-config@4.0.3) (2023-06-22)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Dependencies
|
|
16
|
+
|
|
17
|
+
* **@anolilab/package-json-utils:** upgraded to 1.4.1
|
|
18
|
+
* **browserslist-config-anolilab:** upgraded to 4.0.5
|
|
19
|
+
* **@anolilab/semantic-release-preset:** upgraded to 3.1.3
|
|
20
|
+
|
|
1
21
|
## @anolilab/stylelint-config [4.0.2](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/stylelint-config@4.0.1...@anolilab/stylelint-config@4.0.2) (2023-06-22)
|
|
2
22
|
|
|
3
23
|
|
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
Stylelint
|
|
3
|
+
<h1>Shareable Stylelint Config</h1>
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This npm package provides a set of shareable configurations for Stylelint 15+ — a linter for CSS.
|
|
6
6
|
|
|
7
7
|
[![npm-image]][npm-url] [![license-image]][license-url]
|
|
8
8
|
|
|
@@ -20,17 +20,40 @@ Stylelint config enforcing an understandable and consistent code style.
|
|
|
20
20
|
|
|
21
21
|
---
|
|
22
22
|
|
|
23
|
+
## Propose
|
|
24
|
+
|
|
25
|
+
Our package offers a comprehensive collection of opinionated, yet adaptable configurations for [stylelint](https://stylelint.io/).
|
|
26
|
+
These configurations are designed to empower developers in achieving consistent code styling and mitigating common errors. Here's what our package brings to the table:
|
|
27
|
+
|
|
28
|
+
- A Strong Foundation for Code Styling: We provide a robust starting point for your project's code styling. Our configurations serve as a solid foundation that can be effortlessly extended and modified according to your specific needs. With this flexibility, you can easily tailor the styling rules to align with your project's requirements.
|
|
29
|
+
|
|
30
|
+
- Enforcing Best Practices: Our package ensures adherence to widely accepted best practices for CSS development. By enforcing consistent indentation, discouraging the use of vendor prefixes, and discouraging unnecessary specificity, we promote cleaner and more maintainable code. These practices help streamline collaboration and enhance the readability of your stylesheets.
|
|
31
|
+
|
|
32
|
+
- Error Prevention: Our configurations are equipped to catch common errors that can often go unnoticed. We help you identify and rectify issues like missing units for numeric values, usage of invalid colors, and utilization of unsupported or deprecated CSS features. By proactively highlighting these errors, we aid in improving the overall quality and compatibility of your stylesheets.
|
|
33
|
+
|
|
34
|
+
- Consistency Across Codebase: Maintaining consistency throughout your codebase is essential for a polished end result. Our package plays a pivotal role in achieving this objective. By providing clear and consistent rules for code styling, we empower developers to adhere to a unified approach. This not only enhances readability but also simplifies maintenance and collaboration within your team.
|
|
35
|
+
|
|
36
|
+
In summary, our package equips developers with opinionated yet flexible stylelint configurations. By ensuring consistent code styling and error prevention, we streamline the development process and foster a more efficient and harmonious coding environment.
|
|
37
|
+
|
|
23
38
|
## Install
|
|
24
39
|
|
|
25
40
|
```bash
|
|
26
41
|
npm install --dev-save browserslist stylelint @anolilab/stylelint-config
|
|
27
42
|
```
|
|
28
43
|
|
|
44
|
+
```sh
|
|
45
|
+
pnpm add -D browserslist stylelint @anolilab/stylelint-config
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
yarn add -D browserslist stylelint @anolilab/stylelint-config
|
|
50
|
+
```
|
|
51
|
+
|
|
29
52
|
## Usage
|
|
30
53
|
|
|
31
|
-
If you don’t have a `.stylelintrc.
|
|
54
|
+
If you don’t have a `.stylelintrc.js`, we will create the file for you after installing `@anolilab/stylelint-config`.
|
|
32
55
|
|
|
33
|
-
If you already have a `.stylelintrc.
|
|
56
|
+
If you already have a `.stylelintrc.js`, then you can extend the `.stylelintrc.js`, with `@anolilab/stylelint-config`.
|
|
34
57
|
|
|
35
58
|
```js
|
|
36
59
|
module.exports = {
|
|
@@ -40,6 +63,11 @@ module.exports = {
|
|
|
40
63
|
};
|
|
41
64
|
```
|
|
42
65
|
|
|
66
|
+
You can also customize the rules provided in the configurations or create your own configuration that extends one of the provided configurations.
|
|
67
|
+
For more information on how to configure stylelint, see the [stylelint configuration documentation](https://stylelint.io/user-guide/configure).
|
|
68
|
+
|
|
69
|
+
## Tailwind Support
|
|
70
|
+
|
|
43
71
|
For tailwind you need to extend the stylelint rules
|
|
44
72
|
|
|
45
73
|
```js
|
|
@@ -61,17 +89,31 @@ module.exports = {
|
|
|
61
89
|
};
|
|
62
90
|
```
|
|
63
91
|
|
|
64
|
-
Add
|
|
92
|
+
## Add a Package.json Script
|
|
93
|
+
|
|
94
|
+
To add an NPM script for running `stylelint` use command, which will add the `lint:css` and `lint:css:fix` script to the scripts section of your `package.json`.
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
pnpm pkg set scripts.lint:css="stylelint --config=./.stylelintrc.js '**/*.{js,jsx,tsx,ts,less,css,scss,sass}'"
|
|
98
|
+
pnpm pkg set scripts.lint:css:fix="pnpm run lint:css --fix"
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
> For `npm` users, replace `pnpm` with `npm` in the above command.
|
|
102
|
+
|
|
103
|
+
or copy the following to your `package.json`:
|
|
65
104
|
|
|
66
105
|
```json
|
|
67
106
|
{
|
|
68
107
|
"scripts": {
|
|
69
|
-
"lint:css": "stylelint --config=./.stylelintrc.
|
|
70
|
-
"lint:css:fix": "stylelint --config=./.stylelintrc.
|
|
108
|
+
"lint:css": "stylelint --config=./.stylelintrc.js '**/*.{js,jsx,tsx,ts,less,css,scss,sass}'",
|
|
109
|
+
"lint:css:fix": "stylelint --config=./.stylelintrc.js '**/*.{js,jsx,tsx,ts,less,css,scss,sass}' --fix"
|
|
71
110
|
}
|
|
72
111
|
}
|
|
73
112
|
```
|
|
74
113
|
|
|
114
|
+
This will run `stylelint` on all defined files in your app's directory and its subdirectories.
|
|
115
|
+
You can customize the files and directories to be linted as needed.
|
|
116
|
+
|
|
75
117
|
> Note: this package use `browserslist` to detect the correct browserslist config.
|
|
76
118
|
|
|
77
119
|
## Supported Node.js Versions
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anolilab/stylelint-config",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"description": "Stylelint shareable config for the Anolilab stylesheet guide.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"css",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"test:coverage": "vitest --config ./vitest.config.ts --run --coverage"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@anolilab/package-json-utils": "1.
|
|
64
|
-
"browserslist-config-anolilab": "4.0.
|
|
63
|
+
"@anolilab/package-json-utils": "1.5.0",
|
|
64
|
+
"browserslist-config-anolilab": "4.0.6",
|
|
65
65
|
"stylelint-a11y": "^1.2.3",
|
|
66
66
|
"stylelint-config-rational-order": "^0.1.2",
|
|
67
67
|
"stylelint-config-standard": "^33.0.0",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"stylelint-selector-no-empty": "^1.0.9"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@anolilab/semantic-release-preset": "
|
|
75
|
+
"@anolilab/semantic-release-preset": "4.0.0",
|
|
76
76
|
"postcss": "^8.4.24",
|
|
77
77
|
"semantic-release": "^21.0.5",
|
|
78
78
|
"stylelint": "15.8.0",
|