@enke.dev/lint 0.8.0 → 0.8.1

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 (2) hide show
  1. package/package.json +1 -1
  2. package/stylelint.config.js +25 -24
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enke.dev/lint",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Meta package to provide linting for web projects",
5
5
  "homepage": "https://github.com/enke-dev/lint",
6
6
  "repository": {
@@ -1,27 +1,28 @@
1
1
  /**
2
- * @param {string} prefix
3
- * @returns {import('stylelint').Config}
2
+ * Prepares a Stylelint configuration
3
+ * @param options to configure options
4
+ * @returns an options object to be used for Stylelint
4
5
  */
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
- },
6
+ export const defineConfig = ({ cssCustomPropertyPrefix }) => ({
7
+ extends: ['stylelint-config-standard-scss', 'stylelint-config-rational-order'],
8
+ rules: {
9
+ 'custom-property-pattern': [
10
+ `^-?${cssCustomPropertyPrefix}-[a-z0-9]*(-[a-z0-9]+)*$`,
11
+ {
12
+ message: `Custom properties should be written in lowercase with hyphens starting with \`--${cssCustomPropertyPrefix}-\` (or internals with a triple-slash \`---${cssCustomPropertyPrefix}-\`)`,
13
+ },
14
+ ],
15
+ 'declaration-empty-line-before': null,
16
+ 'rule-empty-line-before': [
17
+ 'always-multi-line',
18
+ { except: ['after-single-line-comment', 'first-nested'] },
19
+ ],
20
+ 'plugin/rational-order': [
21
+ true,
22
+ {
23
+ 'border-in-box-model': false,
24
+ 'empty-line-between-groups': true,
25
+ },
26
+ ],
27
+ },
27
28
  });