stylelint-config-alphabetical-order 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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +40 -0
  3. package/index.js +7 -0
  4. package/package.json +39 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 - present jeddy3
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # stylelint-config-alphabetical-order
2
+
3
+ [![NPM version](https://img.shields.io/npm/v/stylelint-config-alphabetical-order.svg)](https://www.npmjs.com/package/stylelint-config-alphabetical-order) [![Actions Status](https://github.com/jeddy3/stylelint-config-alphabetical-order/workflows/node-ci/badge.svg)](https://github.com/jeddy3/stylelint-config-alphabetical-order/actions)
4
+
5
+ A shareable config for [Stylelint](https://stylelint.io) that alphabetically orders properties.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install --save-dev stylelint-config-alphabetical-order
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ Update your `stylelint` config to:
16
+
17
+ ```diff json
18
+ {
19
+ "extends": [
20
+ "stylelint-config-standard",
21
+ + "stylelint-config-alphabetical-order"
22
+ ]
23
+ }
24
+ ```
25
+
26
+ ## Details
27
+
28
+ The config bundles and configures the [stylelint-order](https://www.npmjs.com/package/stylelint-order) plugin so that:
29
+
30
+ - properties are ordered alphabetically
31
+ - the [`all`](https://drafts.csswg.org/css-cascade/#all-shorthand) property comes first regardless
32
+ - declarations come before nested rules
33
+ - custom properties come before properties
34
+ - nested style rules come before nested at-rules
35
+
36
+ The [standard Stylelint config](https://www.npmjs.com/package/stylelint-config-standard) includes [a rule](https://stylelint.io/user-guide/rules/declaration-block-no-shorthand-property-overrides) that'll flag any shorthand property overrides introduced by reordering.
37
+
38
+ ## [Changelog](CHANGELOG.md)
39
+
40
+ ## [License](LICENSE)
package/index.js ADDED
@@ -0,0 +1,7 @@
1
+ export default {
2
+ plugins: ["stylelint-order"],
3
+ rules: {
4
+ "order/order": [["custom-properties", "declarations", "rules", "at-rules"]],
5
+ "order/properties-order": [["all"], { unspecified: "bottomAlphabetical" }],
6
+ },
7
+ };
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "stylelint-config-alphabetical-order",
3
+ "version": "1.0.0",
4
+ "description": "A shareable config for Stylelint that alphabetically orders properties",
5
+ "keywords": [
6
+ "stylelint",
7
+ "stylelint-config",
8
+ "alphabetical",
9
+ "order"
10
+ ],
11
+ "repository": "jeddy3/stylelint-config-alphabetical-order",
12
+ "license": "MIT",
13
+ "author": "jeddy3",
14
+ "exports": "./index.js",
15
+ "type": "module",
16
+ "files": [
17
+ "index.js"
18
+ ],
19
+ "scripts": {
20
+ "test": "node --test",
21
+ "check": "npm-run-all --parallel check:*",
22
+ "check:js": "eslint \"**/*.js\"",
23
+ "check:formating": "prettier \"**/*.{js,md,yml}\" --check",
24
+ "fix": "npm-run-all --sequential fix:*",
25
+ "fix:js": "eslint \"**/*.js\" --fix",
26
+ "fix:formating": "prettier \"**/*.{js,md,yml}\" --write",
27
+ "release": "np"
28
+ },
29
+ "devDependencies": {
30
+ "eslint": "^9.17.0",
31
+ "np": "^10.1.0",
32
+ "npm-run-all2": "^7.0.2",
33
+ "prettier": "^3.4.2",
34
+ "stylelint": "^16.12.0"
35
+ },
36
+ "dependencies": {
37
+ "stylelint-order": "^6.0.4"
38
+ }
39
+ }