@nice-move/stylelint-config 0.6.12 → 0.6.15

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
@@ -13,6 +13,15 @@ A [stylelint] config created by personal preferences.
13
13
  [github-badge]: https://img.shields.io/npm/l/@nice-move/stylelint-config.svg?style=flat-square&colorB=blue&logo=github
14
14
  [node-badge]: https://img.shields.io/node/v/@nice-move/stylelint-config.svg?style=flat-square&colorB=green&logo=node.js
15
15
 
16
+ ## Supports
17
+
18
+ - Stylesheet in \*.{vue,html,htm,svg,md}
19
+ - [SCSS syntax](https://sass-lang.com/documentation/syntax#scss) / [Less syntax](https://lesscss.org/#overview)
20
+ - [CSS Modules exceptions - :global / :local](https://github.com/css-modules/css-modules#exceptions) in \*.module.{css,scss,less}, \*.vue
21
+ - [Interoperable CSS (ICSS) - :export](https://github.com/css-modules/icss#export) in \*.module.{css,scss,less}, \*.vue
22
+ - [Tailwind CSS](https://tailwindcss.com/) at rules when `tailwindcss` installed
23
+ - Mini Progarm Stylesheet limitation when needed
24
+
16
25
  ## Installation
17
26
 
18
27
  ```bash
@@ -34,10 +43,10 @@ Add to package.json
34
43
 
35
44
  Then run
36
45
 
37
- ```bash
38
- stylelint --fix **/*.{vue,css,less,scss,html,htm,svg,md}
46
+ ```sh
47
+ stylelint --fix "**/*.{css,less,scss,vue,html,htm,md}"
39
48
  ```
40
49
 
41
50
  ## Tips
42
51
 
43
- Some rules that covering by [garou](https://github.com/nice-move/garou) are disabled.
52
+ Some rules that covering by [Prettier](https://prettier.io/) / [Garou](https://github.com/nice-move/garou) are disabled.
package/index.cjs CHANGED
@@ -17,6 +17,7 @@ module.exports = {
17
17
  ...isMiniApp({
18
18
  'selector-type-no-unknown': [true, { ignoreTypes: ['page'] }],
19
19
  'unit-no-unknown': [true, { ignoreUnits: ['rpx'] }],
20
+ 'selector-disallowed-list': ['*', /^(?!page)[A-Za-z]+$/, /[/:\\]/],
20
21
  }),
21
22
  },
22
23
  overrides: [
@@ -28,6 +29,7 @@ module.exports = {
28
29
  require.resolve('./lib/scss.cjs'),
29
30
  require.resolve('./lib/base.cjs'),
30
31
  require.resolve('stylelint-config-prettier'),
32
+ require.resolve('stylelint-config-prettier-scss'),
31
33
  ],
32
34
  rules: {
33
35
  'at-rule-no-unknown': null,
@@ -42,6 +44,7 @@ module.exports = {
42
44
  customSyntax: 'postcss-html',
43
45
  rules: {
44
46
  'at-rule-no-unknown': null,
47
+ 'no-empty-source': null,
45
48
  },
46
49
  },
47
50
  {
package/lib/base.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const { AT_RULE_NO_UNKNOWN } = require('./utils.cjs');
3
+ const { FUNCTION_NO_UNKNOWN, AT_RULE_NO_UNKNOWN } = require('./utils.cjs');
4
4
 
5
5
  module.exports = {
6
6
  rules: {
@@ -24,6 +24,7 @@ module.exports = {
24
24
  },
25
25
  ],
26
26
  'function-url-quotes': 'always',
27
+ 'function-no-unknown': FUNCTION_NO_UNKNOWN,
27
28
  'max-nesting-depth': [5, { severity: 'warning' }],
28
29
  'no-duplicate-selectors': [true, { severity: 'warning' }],
29
30
  'number-max-precision': [4, { severity: 'warning' }],
package/lib/ignore.cjs CHANGED
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  const { join } = require('path');
4
-
5
4
  const { readJson, getPkg } = require('settingz');
6
5
 
7
6
  function ignoreList() {
@@ -14,6 +13,7 @@ function BestShot() {
14
13
  const { git = [], stylelint = git } = readJson(
15
14
  '@best-shot/cli/config/ignore.json',
16
15
  );
16
+
17
17
  return stylelint;
18
18
  }
19
19
 
package/lib/scss.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const { AT_RULE_NO_UNKNOWN } = require('./utils.cjs');
3
+ const { AT_RULE_NO_UNKNOWN, FUNCTION_NO_UNKNOWN } = require('./utils.cjs');
4
4
 
5
5
  const loose = {
6
6
  severity: 'warning',
@@ -8,7 +8,6 @@ const loose = {
8
8
 
9
9
  module.exports = {
10
10
  rules: {
11
- 'scss/at-import-no-partial-leading-underscore': null,
12
11
  'scss/at-import-partial-extension': 'always',
13
12
  'scss/at-rule-no-unknown': AT_RULE_NO_UNKNOWN,
14
13
  'scss/declaration-nested-properties': 'never',
@@ -21,35 +20,10 @@ module.exports = {
21
20
  },
22
21
  ],
23
22
  'scss/selector-no-redundant-nesting-selector': true,
23
+ 'scss/function-no-unknown': FUNCTION_NO_UNKNOWN,
24
24
 
25
25
  // off -------------
26
- 'scss/at-function-pattern': null,
27
- 'scss/at-mixin-pattern': null,
28
- 'scss/dollar-variable-pattern': null,
29
- 'scss/percent-placeholder-pattern': null,
30
-
31
- 'scss/double-slash-comment-whitespace-inside': null,
26
+ 'scss/at-import-no-partial-leading-underscore': null,
32
27
  'scss/declaration-nested-properties-no-divided-groups': null,
33
-
34
- // prettier -----
35
- 'scss/at-else-closing-brace-space-after': null,
36
- 'scss/at-else-empty-line-before': null,
37
- 'scss/at-else-if-parentheses-space-before': null,
38
- 'scss/at-function-parentheses-space-before': null,
39
- 'scss/at-if-closing-brace-space-after': null,
40
- 'scss/at-mixin-parentheses-space-before': null,
41
- 'scss/dollar-variable-colon-space-after': null,
42
- 'scss/dollar-variable-colon-space-before': null,
43
- 'scss/operator-no-newline-after': null,
44
- 'scss/operator-no-newline-before': null,
45
- 'scss/operator-no-unspaced': null,
46
- 'scss/at-else-closing-brace-newline-after': null,
47
- 'scss/at-if-closing-brace-newline-after': null,
48
-
49
- // garou -------------
50
- 'scss/double-slash-comment-empty-line-before': null,
51
- 'scss/dollar-variable-empty-line-before': null,
52
- 'scss/at-rule-conditional-no-parentheses': null,
53
- 'scss/at-mixin-argumentless-call-parentheses': null,
54
28
  },
55
29
  };
package/lib/utils.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const { isReachable } = require('settingz');
3
+ const { isReachable, haveLocalDependencies } = require('settingz');
4
4
 
5
5
  // eslint-disable-next-line consistent-return
6
6
  function isMiniApp(value) {
@@ -13,11 +13,30 @@ function isMiniApp(value) {
13
13
  }
14
14
  }
15
15
 
16
- const AT_RULE_NO_UNKNOWN = isReachable('tailwindcss/package.json')
17
- ? [true, { ignoreAtRules: ['tailwind', 'layer', 'apply'] }]
16
+ const tailwind = haveLocalDependencies('tailwindcss');
17
+
18
+ const AT_RULE_NO_UNKNOWN = tailwind
19
+ ? [
20
+ true,
21
+ {
22
+ ignoreAtRules: [
23
+ 'tailwind',
24
+ 'apply',
25
+ 'layer',
26
+ 'variants',
27
+ 'responsive',
28
+ 'screen',
29
+ ],
30
+ },
31
+ ]
32
+ : true;
33
+
34
+ const FUNCTION_NO_UNKNOWN = tailwind
35
+ ? [true, { ignoreFunctions: ['theme'] }]
18
36
  : true;
19
37
 
20
38
  module.exports = {
21
39
  isMiniApp,
22
40
  AT_RULE_NO_UNKNOWN,
41
+ FUNCTION_NO_UNKNOWN,
23
42
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nice-move/stylelint-config",
3
- "version": "0.6.12",
3
+ "version": "0.6.15",
4
4
  "description": "A `stylelint` config created by personal preferences",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -29,17 +29,20 @@
29
29
  },
30
30
  "main": "index.cjs",
31
31
  "dependencies": {
32
+ "postcss": "^8.4.12",
32
33
  "postcss-html": "^1.3.0",
33
- "postcss-less": "^5.0.0",
34
+ "postcss-less": "^6.0.0",
34
35
  "postcss-markdown": "^1.2.0",
35
- "settingz": "^0.1.2",
36
+ "settingz": "^0.1.7",
36
37
  "stylelint-config-prettier": "^9.0.3",
37
- "stylelint-config-recommended-scss": "^5.0.2",
38
- "stylelint-config-standard": "^24.0.0",
39
- "stylelint-declaration-block-no-ignored-properties": "^2.5.0"
38
+ "stylelint-config-prettier-scss": "^0.0.1",
39
+ "stylelint-config-recommended-scss": "^6.0.0",
40
+ "stylelint-config-standard": "^25.0.0",
41
+ "stylelint-declaration-block-no-ignored-properties": "^2.5.0",
42
+ "stylelint-scss": "^4.2.0"
40
43
  },
41
44
  "peerDependencies": {
42
- "stylelint": "^14.1.0"
45
+ "stylelint": "^14.6.0"
43
46
  },
44
47
  "engines": {
45
48
  "node": "^12.22.0 || ^14.17.0 || >=16.13.0"