@benhigham/stylelint-config 0.3.0 → 1.0.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/package.json +33 -46
- package/src/index.js +0 -8
- package/README.md +0 -79
package/package.json
CHANGED
|
@@ -1,31 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@benhigham/stylelint-config",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"homepage": "https://github.com/benhigham/stylelint-config#readme",
|
|
7
|
-
"bugs": {
|
|
8
|
-
"url": "https://github.com/benhigham/stylelint-config/issues/new"
|
|
9
|
-
},
|
|
10
|
-
"repository": {
|
|
11
|
-
"type": "git",
|
|
12
|
-
"url": "https://github.com/benhigham/stylelint-config.git"
|
|
13
|
-
},
|
|
14
|
-
"funding": "https://github.com/sponsors/benhigham",
|
|
15
|
-
"author": {
|
|
16
|
-
"name": "Ben Higham",
|
|
17
|
-
"url": "https://benhigham.com"
|
|
18
|
-
},
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Shareable Stylelint configuration",
|
|
19
5
|
"type": "module",
|
|
20
|
-
"module": "./src/index.js",
|
|
21
6
|
"exports": "./src/index.js",
|
|
22
|
-
"sideEffects": false,
|
|
23
|
-
"engines": {
|
|
24
|
-
"node": "^18.20.0 || ^20.10.0 || >=21.0.0"
|
|
25
|
-
},
|
|
26
7
|
"files": [
|
|
27
8
|
"src"
|
|
28
9
|
],
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": ">=22"
|
|
12
|
+
},
|
|
29
13
|
"keywords": [
|
|
30
14
|
"stylelint",
|
|
31
15
|
"stylelint-config",
|
|
@@ -49,41 +33,44 @@
|
|
|
49
33
|
"validate",
|
|
50
34
|
"verify"
|
|
51
35
|
],
|
|
36
|
+
"author": "Benjamin Higham",
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"homepage": "https://github.com/benhigham/javascript/tree/main/packages/stylelint-config#readme",
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "https://github.com/benhigham/javascript.git",
|
|
42
|
+
"directory": "packages/stylelint-config"
|
|
43
|
+
},
|
|
44
|
+
"bugs": {
|
|
45
|
+
"url": "https://github.com/benhigham/javascript/issues"
|
|
46
|
+
},
|
|
52
47
|
"dependencies": {
|
|
53
|
-
"stylelint-config-recess-order": "^
|
|
54
|
-
"stylelint-config-standard-scss": "^
|
|
55
|
-
"stylelint-declaration-block-no-ignored-properties": "^
|
|
48
|
+
"stylelint-config-recess-order": "^7.2.0",
|
|
49
|
+
"stylelint-config-standard-scss": "^17.0.0",
|
|
50
|
+
"stylelint-declaration-block-no-ignored-properties": "^3.0.0",
|
|
56
51
|
"stylelint-declaration-strict-value": "^1.10.11",
|
|
57
|
-
"stylelint-gamut": "^
|
|
58
|
-
"stylelint-high-performance-animation": "^
|
|
52
|
+
"stylelint-gamut": "^2.0.0",
|
|
53
|
+
"stylelint-high-performance-animation": "^2.0.0",
|
|
59
54
|
"stylelint-media-use-custom-media": "^4.0.0",
|
|
60
55
|
"stylelint-no-indistinguishable-colors": "^2.3.1",
|
|
61
|
-
"stylelint-no-unresolved-module": "^2.
|
|
56
|
+
"stylelint-no-unresolved-module": "^2.5.0",
|
|
62
57
|
"stylelint-no-unsupported-browser-features": "^8.0.4",
|
|
63
|
-
"stylelint-
|
|
64
|
-
"stylelint-
|
|
58
|
+
"stylelint-order": "^7.0.0",
|
|
59
|
+
"stylelint-plugin-use-baseline": "^1.0.3",
|
|
65
60
|
"stylelint-use-nesting": "^6.0.0"
|
|
66
61
|
},
|
|
67
|
-
"devDependencies": {
|
|
68
|
-
"@benhigham/commitlint-config": "^0.1.3",
|
|
69
|
-
"@benhigham/prettier-config": "^0.1.1",
|
|
70
|
-
"@changesets/changelog-github": "^0.5.1",
|
|
71
|
-
"@changesets/cli": "^2.29.3",
|
|
72
|
-
"@commitlint/cli": "^19.8.0",
|
|
73
|
-
"lefthook": "^1.11.12",
|
|
74
|
-
"prettier": "^3.5.3",
|
|
75
|
-
"stylelint": "^16.19.1",
|
|
76
|
-
"stylelint-find-new-rules": "^5.0.0"
|
|
77
|
-
},
|
|
78
62
|
"peerDependencies": {
|
|
79
|
-
"stylelint": ">=
|
|
63
|
+
"stylelint": ">=17.0.0"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"eslint": "^10.0.0",
|
|
67
|
+
"stylelint": "^17.4.0",
|
|
68
|
+
"stylelint-find-new-rules": "^6.0.0",
|
|
69
|
+
"@benhigham/eslint-config": "3.0.0"
|
|
80
70
|
},
|
|
81
71
|
"scripts": {
|
|
82
|
-
"format": "prettier --write .",
|
|
83
72
|
"format:check": "prettier --check .",
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"version": "changeset version",
|
|
87
|
-
"release": "changeset publish"
|
|
73
|
+
"lint": "eslint .",
|
|
74
|
+
"lint:fix": "eslint --fix ."
|
|
88
75
|
}
|
|
89
76
|
}
|
package/src/index.js
CHANGED
|
@@ -10,7 +10,6 @@ const config = {
|
|
|
10
10
|
'stylelint-high-performance-animation',
|
|
11
11
|
'stylelint-no-indistinguishable-colors',
|
|
12
12
|
'stylelint-gamut',
|
|
13
|
-
'stylelint-selector-bem-pattern',
|
|
14
13
|
'stylelint-media-use-custom-media',
|
|
15
14
|
'stylelint-use-nesting',
|
|
16
15
|
'stylelint-plugin-use-baseline',
|
|
@@ -31,7 +30,6 @@ const config = {
|
|
|
31
30
|
'scss/max-nesting-depth': 3,
|
|
32
31
|
|
|
33
32
|
// Selector and class naming
|
|
34
|
-
'plugin/selector-bem-pattern': { preset: 'suit' },
|
|
35
33
|
'selector-max-id': 0,
|
|
36
34
|
'selector-max-specificity': '0,3,2',
|
|
37
35
|
|
|
@@ -69,12 +67,6 @@ const config = {
|
|
|
69
67
|
rules: {
|
|
70
68
|
// More permissive rules for CSS modules
|
|
71
69
|
'selector-class-pattern': null,
|
|
72
|
-
'plugin/selector-bem-pattern': {
|
|
73
|
-
preset: 'suit',
|
|
74
|
-
presetOptions: {
|
|
75
|
-
namespace: false,
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
70
|
},
|
|
79
71
|
},
|
|
80
72
|
],
|
package/README.md
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
# @benhigham/stylelint-config
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/@benhigham/stylelint-config)
|
|
4
|
-
[](https://www.npmjs.com/package/@benhigham/stylelint-config)
|
|
5
|
-
[](LICENSE.md)
|
|
6
|
-
|
|
7
|
-
My personal [Stylelint](https://stylelint.io/) configuration for maintaining consistent, high-quality CSS/SCSS code.
|
|
8
|
-
|
|
9
|
-
## Features
|
|
10
|
-
|
|
11
|
-
This configuration:
|
|
12
|
-
|
|
13
|
-
- Extends [`stylelint-config-standard-scss`](https://github.com/stylelint-scss/stylelint-config-standard-scss) for SCSS support and best practices
|
|
14
|
-
- Uses [`stylelint-config-recess-order`](https://github.com/stormwarning/stylelint-config-recess-order) for consistent property ordering
|
|
15
|
-
- Enforces strict value usage for colors, font-sizes, and z-indices
|
|
16
|
-
- Prevents performance issues with animations
|
|
17
|
-
- Requires proper use of custom media queries and nesting
|
|
18
|
-
- Enforces BEM naming conventions with SUIT CSS methodology
|
|
19
|
-
- Ensures browser compatibility with [Baseline](https://web.dev/baseline) requirements
|
|
20
|
-
- Detects and prevents indistinguishable colors and out-of-gamut colors
|
|
21
|
-
- Provides special handling for CSS modules
|
|
22
|
-
|
|
23
|
-
## Installation
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
# npm
|
|
27
|
-
npm install --save-dev @benhigham/stylelint-config
|
|
28
|
-
|
|
29
|
-
# yarn
|
|
30
|
-
yarn add --dev @benhigham/stylelint-config
|
|
31
|
-
|
|
32
|
-
# pnpm
|
|
33
|
-
pnpm add --save-dev @benhigham/stylelint-config
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## Usage
|
|
37
|
-
|
|
38
|
-
Create a `stylelint.config.js` file in your project root and extend this configuration:
|
|
39
|
-
|
|
40
|
-
```javascript
|
|
41
|
-
/** @type {import('stylelint').Config} */
|
|
42
|
-
export default {
|
|
43
|
-
extends: ['@benhigham/stylelint-config'],
|
|
44
|
-
};
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Configuration Details
|
|
48
|
-
|
|
49
|
-
### Extended Configs
|
|
50
|
-
|
|
51
|
-
- [`stylelint-config-standard-scss`](https://github.com/stylelint-scss/stylelint-config-standard-scss): Provides standard rules for SCSS files
|
|
52
|
-
- [`stylelint-config-recess-order`](https://github.com/stormwarning/stylelint-config-recess-order): Enforces a consistent property ordering based on the Recess methodology
|
|
53
|
-
|
|
54
|
-
### Plugins
|
|
55
|
-
|
|
56
|
-
This configuration includes several plugins:
|
|
57
|
-
|
|
58
|
-
- [`stylelint-declaration-block-no-ignored-properties`](https://github.com/kristerkari/stylelint-declaration-block-no-ignored-properties): Prevents using ignored or overridden properties
|
|
59
|
-
- [`stylelint-declaration-strict-value`](https://github.com/AndyOGo/stylelint-declaration-strict-value): Enforces the use of variables, functions or custom CSS for specific properties
|
|
60
|
-
- [`stylelint-high-performance-animation`](https://github.com/kristerkari/stylelint-high-performance-animation): Prevents using low-performance animation properties
|
|
61
|
-
- [`stylelint-media-use-custom-media`](https://github.com/csstools/stylelint-media-use-custom-media): Enforces the use of custom media queries
|
|
62
|
-
- [`stylelint-use-nesting`](https://github.com/csstools/stylelint-use-nesting): Enforces proper CSS nesting
|
|
63
|
-
- [`stylelint-plugin-use-baseline`](https://github.com/ryo-manba/stylelint-plugin-use-baseline): Disallow CSS features not in [Baseline](https://web.dev/baseline)
|
|
64
|
-
- [`stylelint-no-unresolved-module`](https://github.com/niksy/stylelint-no-unresolved-module): Ensures all imported modules can be resolved
|
|
65
|
-
- [`stylelint-no-indistinguishable-colors`](https://github.com/ierhyna/stylelint-no-indistinguishable-colors): Prevents colors that are too similar
|
|
66
|
-
- [`stylelint-gamut`](https://github.com/csstools/stylelint-gamut): Prevents colors outside of supported gamut range
|
|
67
|
-
- [`stylelint-selector-bem-pattern`](https://github.com/simonsmith/stylelint-selector-bem-pattern): Enforces BEM naming convention
|
|
68
|
-
- [`stylelint-no-unsupported-browser-features`](https://github.com/ismay/stylelint-no-unsupported-browser-features): Warns about unsupported browser features
|
|
69
|
-
|
|
70
|
-
### Key Rules
|
|
71
|
-
|
|
72
|
-
- **Browser Compatibility**: Enforces only widely supported CSS features
|
|
73
|
-
- **SCSS Best Practices**: Limits nesting depth, enforces consistent naming patterns
|
|
74
|
-
- **BEM Pattern**: Uses SUIT CSS methodology for class naming
|
|
75
|
-
- **CSS Modules**: Special handling for `.module.scss` files with relaxed naming rules
|
|
76
|
-
|
|
77
|
-
## License
|
|
78
|
-
|
|
79
|
-
This project is licensed under the [MIT License](LICENSE.md).
|