@enke.dev/lint 0.7.6 → 0.8.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 CHANGED
@@ -61,3 +61,17 @@ Like the experimental typescript config flag above, the VSCode Eslint plugin can
61
61
  "eslint.workingDirectories": ["./packages/foo", "./packages/bar"]
62
62
  }
63
63
  ```
64
+
65
+ ## Stylelint (experimental)
66
+
67
+ Using a shared Stylelint config with two major presets, `stylelint-config-standard-scss` and `stylelint-config-rational-order`.
68
+
69
+ For now, no TypeScript support is included.
70
+
71
+ Create a `stylelint.config.js` file in the root of your project and add the following content:
72
+
73
+ ```js
74
+ import { defineConfig } from '@enke.dev/lint/stylelint.config.js';
75
+
76
+ export default defineConfig('kvlm');
77
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enke.dev/lint",
3
- "version": "0.7.6",
3
+ "version": "0.8.0",
4
4
  "description": "Meta package to provide linting for web projects",
5
5
  "homepage": "https://github.com/enke-dev/lint",
6
6
  "repository": {
@@ -8,10 +8,10 @@
8
8
  "url": "git+https://github.com/enke-dev/lint.git"
9
9
  },
10
10
  "files": [
11
- ".stylelintrc.json",
12
11
  "eslint.config.js",
13
12
  "eslint.config.d.ts",
14
13
  "eslint-plugins.d.ts",
14
+ "stylelint.config.js",
15
15
  "README.md"
16
16
  ],
17
17
  "type": "module",
@@ -59,7 +59,7 @@
59
59
  "typescript-eslint": "^8.35.0"
60
60
  },
61
61
  "devDependencies": {
62
- "@types/node": "22.15.33",
62
+ "@types/node": "24.3.0",
63
63
  "jiti": "2.5.1",
64
64
  "typescript": "5.9.2"
65
65
  },
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @param {string} prefix
3
+ * @returns {import('stylelint').Config}
4
+ */
5
+ export const defineConfig = prefix => ({
6
+ extends: ['stylelint-config-standard-scss', 'stylelint-config-rational-order'],
7
+ rules: {
8
+ 'custom-property-pattern': [
9
+ `^-?${prefix}-[a-z0-9]*(-[a-z0-9]+)*$`,
10
+ {
11
+ message: `Custom properties should be written in lowercase with hyphens starting with \`--${prefix}-\` (or internals with a triple-slash \`---${prefix}-\`)`,
12
+ },
13
+ ],
14
+ 'declaration-empty-line-before': null,
15
+ 'rule-empty-line-before': [
16
+ 'always-multi-line',
17
+ { except: ['after-single-line-comment', 'first-nested'] },
18
+ ],
19
+ 'plugin/rational-order': [
20
+ true,
21
+ {
22
+ 'border-in-box-model': false,
23
+ 'empty-line-between-groups': true,
24
+ },
25
+ ],
26
+ },
27
+ });
package/.stylelintrc.json DELETED
@@ -1,23 +0,0 @@
1
- {
2
- "extends": ["stylelint-config-standard-scss", "stylelint-config-rational-order"],
3
- "rules": {
4
- "custom-property-pattern": [
5
- "^-?kvlm-[a-z0-9]*(-[a-z0-9]+)*$",
6
- {
7
- "message": "Custom properties should be written in lowercase with hyphens starting with `--kvlm-` (or internals with a triple-slash `---kvlm-`)"
8
- }
9
- ],
10
- "declaration-empty-line-before": null,
11
- "rule-empty-line-before": [
12
- "always-multi-line",
13
- { "except": ["after-single-line-comment", "first-nested"] }
14
- ],
15
- "plugin/rational-order": [
16
- true,
17
- {
18
- "border-in-box-model": false,
19
- "empty-line-between-groups": true
20
- }
21
- ]
22
- }
23
- }