@nice-move/stylelint-config 0.10.18 → 0.10.20

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 (3) hide show
  1. package/index.cjs +38 -30
  2. package/lib/utils.cjs +5 -2
  3. package/package.json +1 -1
package/index.cjs CHANGED
@@ -1,35 +1,45 @@
1
1
  'use strict';
2
2
 
3
- const { isMiniApp } = require('./lib/utils.cjs');
3
+ const { isMiniApp, tailwind } = require('./lib/utils.cjs');
4
4
 
5
5
  module.exports = {
6
6
  reportNeedlessDisables: true,
7
7
  reportInvalidScopeDisables: true,
8
- overrides: [
9
- {
10
- files: ['**/*.*'],
11
- extends: [
12
- require.resolve('stylelint-config-standard'),
13
- require.resolve('./lib/ignore.cjs'),
14
- require.resolve('./lib/base.cjs'),
15
- ],
16
- plugins: [
17
- 'stylelint-declaration-block-no-ignored-properties',
18
- 'stylelint-suitcss',
19
- 'stylelint-no-unresolved-module',
20
- ],
21
- rules: {
22
- 'suitcss/root-no-standard-properties': true,
23
- 'suitcss/selector-root-no-composition': true,
24
- 'plugin/declaration-block-no-ignored-properties': [
25
- true,
26
- { severity: 'warning' },
27
- ],
28
- 'plugin/no-unresolved-module': {
29
- modules: ['node_modules'],
30
- },
31
- },
8
+ extends: [
9
+ require.resolve('stylelint-config-standard'),
10
+ require.resolve('./lib/ignore.cjs'),
11
+ require.resolve('./lib/base.cjs'),
12
+ ],
13
+ plugins: [
14
+ 'stylelint-declaration-block-no-ignored-properties',
15
+ 'stylelint-suitcss',
16
+ 'stylelint-no-unresolved-module',
17
+ ],
18
+ rules: {
19
+ 'suitcss/root-no-standard-properties': true,
20
+ 'suitcss/selector-root-no-composition': true,
21
+ 'plugin/declaration-block-no-ignored-properties': [
22
+ true,
23
+ { severity: 'warning' },
24
+ ],
25
+ 'plugin/no-unresolved-module': {
26
+ modules: ['node_modules'],
32
27
  },
28
+ ...(tailwind
29
+ ? {
30
+ 'at-rule-no-deprecated': [true, { ignoreAtRules: ['apply'] }],
31
+ 'declaration-property-value-no-unknown': [
32
+ true,
33
+ {
34
+ ignoreProperties: {
35
+ '/.+/': /theme\([.\w]+\)/.toString(),
36
+ },
37
+ },
38
+ ],
39
+ }
40
+ : undefined),
41
+ },
42
+ overrides: [
33
43
  {
34
44
  files: ['**/*.scss'],
35
45
  customSyntax: require('postcss-scss'),
@@ -86,14 +96,12 @@ module.exports = {
86
96
  true,
87
97
  {
88
98
  ignoreProperties: {
89
- '/.+/': String.raw`/\d+rpx/`,
99
+ '/.+/': tailwind
100
+ ? /\drpx|theme\([.\w]+\)/.toString()
101
+ : /\drpx/.toString(),
90
102
  },
91
103
  },
92
104
  ],
93
- 'at-rule-no-deprecated': [
94
- true,
95
- { ignoreAtRules: ['apply', 'custom-variant', 'source'] },
96
- ],
97
105
  'selector-type-no-unknown': [true, { ignoreTypes: ['page'] }],
98
106
  'unit-no-unknown': [true, { ignoreUnits: ['rpx'] }],
99
107
  'selector-disallowed-list': ['*', /^(?!page)[A-Za-z]+$/, /[/\\]/],
package/lib/utils.cjs CHANGED
@@ -16,12 +16,14 @@ const AT_RULE_NO_UNKNOWN = tailwind
16
16
  true,
17
17
  {
18
18
  ignoreAtRules: [
19
- 'tailwind',
20
19
  'apply',
20
+ 'custom-variant',
21
21
  'layer',
22
- 'variants',
23
22
  'responsive',
24
23
  'screen',
24
+ 'source',
25
+ 'tailwind',
26
+ 'variants',
25
27
  ],
26
28
  },
27
29
  ]
@@ -33,6 +35,7 @@ const FUNCTION_NO_UNKNOWN = tailwind
33
35
 
34
36
  module.exports = {
35
37
  isMiniApp,
38
+ tailwind,
36
39
  AT_RULE_NO_UNKNOWN,
37
40
  FUNCTION_NO_UNKNOWN,
38
41
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nice-move/stylelint-config",
3
- "version": "0.10.18",
3
+ "version": "0.10.20",
4
4
  "description": "A `stylelint` config created by personal preferences",
5
5
  "license": "MIT",
6
6
  "author": {