@nice-move/stylelint-config 0.8.1 → 0.9.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.
package/index.cjs CHANGED
@@ -5,63 +5,41 @@ const { isMiniApp } = require('./lib/utils.cjs');
5
5
  module.exports = {
6
6
  reportNeedlessDisables: true,
7
7
  reportInvalidScopeDisables: true,
8
- extends: [
9
- require.resolve('stylelint-config-standard'),
10
- require.resolve('./lib/ignore.cjs'),
11
- require.resolve('./lib/base.cjs'),
12
- require.resolve('stylelint-config-prettier'),
13
- ],
14
- plugins: [
15
- 'stylelint-declaration-block-no-ignored-properties',
16
- 'stylelint-suitcss',
17
- ],
18
- rules: {
19
- 'suitcss/root-no-standard-properties': true,
20
- 'suitcss/selector-root-no-composition': true,
21
-
22
- 'plugin/declaration-block-no-ignored-properties': true,
23
-
24
- ...isMiniApp({
25
- 'selector-type-no-unknown': [true, { ignoreTypes: ['page'] }],
26
- 'unit-no-unknown': [true, { ignoreUnits: ['rpx'] }],
27
- 'selector-disallowed-list': ['*', /^(?!page)[A-Za-z]+$/, /[/:\\]/],
28
- }),
29
- },
30
8
  overrides: [
31
9
  {
32
- files: ['**/*.scss'],
10
+ files: ['**/*.*'],
33
11
  extends: [
34
- require.resolve('stylelint-config-recommended-scss'),
12
+ require.resolve('stylelint-config-standard'),
35
13
  require.resolve('./lib/ignore.cjs'),
36
- require.resolve('./lib/scss.cjs'),
37
14
  require.resolve('./lib/base.cjs'),
38
- require.resolve('stylelint-config-prettier'),
39
- require.resolve('stylelint-config-prettier-scss'),
15
+ ],
16
+ plugins: [
17
+ 'stylelint-declaration-block-no-ignored-properties',
18
+ 'stylelint-suitcss',
40
19
  ],
41
20
  rules: {
42
- 'at-rule-no-unknown': null,
43
- 'function-no-unknown': null,
21
+ 'suitcss/root-no-standard-properties': true,
22
+ 'suitcss/selector-root-no-composition': true,
23
+ 'plugin/declaration-block-no-ignored-properties': true,
44
24
  },
45
25
  },
26
+ {
27
+ files: ['**/*.scss'],
28
+ customSyntax: require('postcss-scss'),
29
+ plugins: ['stylelint-scss'],
30
+ extends: [require.resolve('./lib/scss.cjs')],
31
+ },
46
32
  {
47
33
  files: ['**/*.less'],
48
34
  customSyntax: 'postcss-less',
49
35
  rules: {
50
- 'function-no-unknown': [
51
- true,
52
- {
53
- ignoreFunctions: [
54
- /^(if|boolean|e|escape|%|replace|length|extract|range|each|ceil|floor|percentage|round|sqrt|abs|sin|asin|cos|acos|tan|atan|pi|pow|mod|min|max|isnumber|isstring|iscolor|iskeyword|isurl|ispixel|isem|ispercentage|isunit|isruleset|isdefined|color|image-size|image-width|image-height|convert|data-uri|default|unit|get-unit|svg-gradient|rgb|rgba|argb|hsl|hsla|hsv|hsva|hue|saturation|lightness|hsvhue|hsvsaturation|hsvvalue|red|green|blue|alpha|luma|luminance|saturate|desaturate|lighten|darken|fadein|fadeout|fade|spin|mix|tint|shade|greyscale|contrast|multiply|screen|overlay|softlight|hardlight|difference|exclusion|average|negation)$/,
55
- ],
56
- },
57
- ],
36
+ 'function-no-unknown': null,
58
37
  },
59
38
  },
60
39
  {
61
40
  files: ['**/*.{html,htm,svg,vue}'],
62
41
  customSyntax: 'postcss-html',
63
42
  rules: {
64
- 'at-rule-no-unknown': null,
65
43
  'no-empty-source': null,
66
44
  },
67
45
  },
@@ -83,5 +61,17 @@ module.exports = {
83
61
  ],
84
62
  },
85
63
  },
64
+ {
65
+ files: ['**/*.*'],
66
+ extends: [
67
+ require.resolve('./lib/prettier.cjs'),
68
+ require.resolve('./lib/garou.cjs'),
69
+ ],
70
+ rules: isMiniApp({
71
+ 'selector-type-no-unknown': [true, { ignoreTypes: ['page'] }],
72
+ 'unit-no-unknown': [true, { ignoreUnits: ['rpx'] }],
73
+ 'selector-disallowed-list': ['*', /^(?!page)[A-Za-z]+$/, /[/:\\]/],
74
+ }),
75
+ },
86
76
  ],
87
77
  };
package/lib/base.cjs CHANGED
@@ -5,12 +5,10 @@ const { FUNCTION_NO_UNKNOWN, AT_RULE_NO_UNKNOWN } = require('./utils.cjs');
5
5
  module.exports = {
6
6
  rules: {
7
7
  'selector-disallowed-list': [/,\s*?,/, /^\s*,\s*/],
8
- 'at-rule-no-unknown': AT_RULE_NO_UNKNOWN,
9
8
  'declaration-block-no-redundant-longhand-properties': [
10
9
  true,
11
10
  { severity: 'warning' },
12
11
  ],
13
- 'font-family-name-quotes': 'always-where-recommended',
14
12
  'font-family-no-missing-generic-family-keyword': [
15
13
  true,
16
14
  {
@@ -23,53 +21,25 @@ module.exports = {
23
21
  ],
24
22
  },
25
23
  ],
26
- 'function-url-quotes': 'always',
24
+ 'at-rule-no-unknown': AT_RULE_NO_UNKNOWN,
25
+ 'font-family-name-quotes': 'always-where-recommended',
27
26
  'function-no-unknown': FUNCTION_NO_UNKNOWN,
27
+ 'function-url-quotes': 'always',
28
+ 'import-notation': 'string',
28
29
  'max-nesting-depth': [5, { severity: 'warning' }],
29
30
  'no-duplicate-selectors': [true, { severity: 'warning' }],
30
31
  'number-max-precision': [4, { severity: 'warning' }],
31
32
  'selector-max-compound-selectors': [5, { severity: 'warning' }],
32
33
  'selector-max-universal': 1,
33
34
  'selector-no-qualifying-type': true,
34
- 'selector-type-no-unknown': true,
35
- 'time-min-milliseconds': 250,
35
+ 'time-min-milliseconds': 200,
36
36
 
37
37
  // ---- off --------------------
38
+ 'comment-no-empty': null,
38
39
  'custom-media-pattern': null,
39
40
  'custom-property-pattern': null,
40
- 'declaration-block-single-line-max-declarations': null,
41
41
  'keyframes-name-pattern': null,
42
42
  'selector-class-pattern': null,
43
- 'comment-no-empty': null,
44
43
  'selector-id-pattern': null,
45
-
46
- // ---- handle by prettier -----
47
- 'function-whitespace-after': null,
48
-
49
- // ---- handle by garou --------
50
- 'alpha-value-notation': null,
51
- 'at-rule-empty-line-before': null,
52
- 'at-rule-no-vendor-prefix': null,
53
- 'color-function-notation': null,
54
- 'color-hex-length': null,
55
- 'comment-empty-line-before': null,
56
- 'comment-whitespace-inside': null,
57
- 'custom-property-empty-line-before': null,
58
- 'declaration-empty-line-before': null,
59
- 'function-calc-no-unspaced-operator': null,
60
- 'function-name-case': null,
61
- 'hue-degree-notation': null,
62
- 'length-zero-no-unit': null,
63
- 'media-feature-name-no-vendor-prefix': null,
64
- 'media-feature-range-operator-space-after': null,
65
- 'media-feature-range-operator-space-before': null,
66
- 'property-no-vendor-prefix': null,
67
- 'rule-empty-line-before': null,
68
- 'selector-no-vendor-prefix': null,
69
- 'selector-pseudo-element-colon-notation': null,
70
- 'selector-type-case': null,
71
- 'shorthand-property-no-redundant-values': null,
72
- 'value-keyword-case': null,
73
- 'value-no-vendor-prefix': null,
74
44
  },
75
45
  };
package/lib/garou.cjs ADDED
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ rules: {
5
+ 'alpha-value-notation': null,
6
+ 'at-rule-empty-line-before': null,
7
+ 'at-rule-no-vendor-prefix': null,
8
+ 'color-function-notation': null,
9
+ 'color-hex-length': null,
10
+ 'comment-empty-line-before': null,
11
+ 'comment-whitespace-inside': null,
12
+ 'custom-property-empty-line-before': null,
13
+ 'declaration-empty-line-before': null,
14
+ 'function-calc-no-unspaced-operator': null,
15
+ 'function-name-case': null,
16
+ 'hue-degree-notation': null,
17
+ 'length-zero-no-unit': null,
18
+ 'media-feature-name-no-vendor-prefix': null,
19
+ 'property-no-vendor-prefix': null,
20
+ 'rule-empty-line-before': null,
21
+ 'selector-no-vendor-prefix': null,
22
+ 'selector-pseudo-element-colon-notation': null,
23
+ 'selector-type-case': null,
24
+ 'shorthand-property-no-redundant-values': null,
25
+ 'value-keyword-case': null,
26
+ 'value-no-vendor-prefix': null,
27
+ },
28
+ };
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ rules: {
5
+ 'selector-attribute-quotes': null,
6
+ },
7
+ };
package/lib/scss.cjs CHANGED
@@ -8,22 +8,56 @@ const loose = {
8
8
 
9
9
  module.exports = {
10
10
  rules: {
11
+ 'annotation-no-unknown': null,
12
+ 'at-rule-no-unknown': null,
13
+ 'comment-no-empty': null,
14
+ 'function-no-unknown': null,
15
+ 'no-invalid-position-at-import-rule': [
16
+ true,
17
+ {
18
+ ignoreAtRules: ['use', 'forward'],
19
+ },
20
+ ],
21
+ 'scss/at-extend-no-missing-placeholder': true,
22
+ 'scss/at-if-no-null': true,
11
23
  'scss/at-import-partial-extension': 'always',
12
24
  'scss/at-rule-no-unknown': AT_RULE_NO_UNKNOWN,
25
+ 'scss/comment-no-empty': true,
13
26
  'scss/declaration-nested-properties': 'never',
14
27
  'scss/dimension-no-non-numeric-values': true,
15
28
  'scss/dollar-variable-default': [true, { ...loose, ignore: 'local' }],
29
+ 'scss/dollar-variable-no-missing-interpolation': true,
30
+ 'scss/function-quote-no-quoted-strings-inside': true,
31
+ 'scss/function-unquote-no-unquoted-strings-inside': true,
16
32
  'scss/no-duplicate-dollar-variables': [
17
33
  true,
18
34
  {
19
35
  ignoreInside: ['at-rule', 'nested-at-rule'],
20
36
  },
21
37
  ],
22
- 'scss/selector-no-redundant-nesting-selector': true,
38
+ 'scss/no-duplicate-mixins': true,
39
+ 'scss/no-global-function-names': true,
23
40
  'scss/function-no-unknown': FUNCTION_NO_UNKNOWN,
41
+ 'scss/selector-no-redundant-nesting-selector': true,
24
42
 
25
43
  // off -------------
26
44
  'scss/at-import-no-partial-leading-underscore': null,
27
45
  'scss/declaration-nested-properties-no-divided-groups': null,
46
+
47
+ // ---- handle by prettier -----
48
+ 'scss/at-else-closing-brace-newline-after': null,
49
+ 'scss/at-else-closing-brace-space-after': null,
50
+ 'scss/at-else-empty-line-before': null,
51
+ 'scss/at-else-if-parentheses-space-before': null,
52
+ 'scss/at-function-parentheses-space-before': null,
53
+ 'scss/at-if-closing-brace-newline-after': null,
54
+ 'scss/at-if-closing-brace-space-after': null,
55
+ 'scss/at-mixin-parentheses-space-before': null,
56
+ 'scss/dollar-variable-colon-newline-after': null,
57
+ 'scss/dollar-variable-colon-space-after': null,
58
+ 'scss/dollar-variable-colon-space-before': null,
59
+ 'scss/operator-no-newline-after': null,
60
+ 'scss/operator-no-newline-before': null,
61
+ 'scss/operator-no-unspaced': null,
28
62
  },
29
63
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nice-move/stylelint-config",
3
- "version": "0.8.1",
3
+ "version": "0.9.1",
4
4
  "description": "A `stylelint` config created by personal preferences",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -29,21 +29,19 @@
29
29
  },
30
30
  "main": "index.cjs",
31
31
  "dependencies": {
32
- "postcss": "^8.4.19",
32
+ "postcss": "^8.4.21",
33
33
  "postcss-html": "^1.5.0",
34
34
  "postcss-less": "^6.0.0",
35
35
  "postcss-markdown": "^1.2.0",
36
+ "postcss-scss": "^4.0.6",
36
37
  "settingz": "^0.2.0",
37
- "stylelint-config-prettier": "^9.0.4",
38
- "stylelint-config-prettier-scss": "^0.0.1",
39
- "stylelint-config-recommended-scss": "^8.0.0",
40
- "stylelint-config-standard": "^29.0.0",
41
- "stylelint-declaration-block-no-ignored-properties": "^2.6.0",
42
- "stylelint-scss": "^4.3.0",
38
+ "stylelint-config-standard": "^30.0.1",
39
+ "stylelint-declaration-block-no-ignored-properties": "^2.7.0",
40
+ "stylelint-scss": "^4.4.0",
43
41
  "stylelint-suitcss": "^5.0.0"
44
42
  },
45
43
  "peerDependencies": {
46
- "stylelint": "^14.14.0"
44
+ "stylelint": "^15.1.0"
47
45
  },
48
46
  "engines": {
49
47
  "node": "^16.15.0 || ^18.12.0"