@d-zero/stylelint-config 5.0.0 → 6.0.0-alpha.2

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/name.js +11 -4
  2. package/package.json +13 -9
package/name.js CHANGED
@@ -3,7 +3,7 @@ module.exports = {
3
3
  'custom-media-pattern': '[a-z][a-z-]*',
4
4
  'custom-property-pattern': '[a-z][a-z-]*',
5
5
  'selector-class-pattern': [
6
- '^c-[a-z][a-z0-9]*(?:-[a-z0-9]+)*(?:__[a-z0-9]+(?:-[a-z0-9]+)*)?$',
6
+ '^[lpc]-[a-z][a-z0-9]*(?:-[a-z0-9]+)*(?:__[a-z0-9]+(?:-[a-z0-9]+)*)?$',
7
7
  {
8
8
  resolveNestedSelectors: true,
9
9
  /**
@@ -11,8 +11,12 @@ module.exports = {
11
11
  * @returns {string}
12
12
  */
13
13
  message: (selector) => {
14
- if (!selector.startsWith('.c-')) {
15
- return `クラス名は「c-」から始めてください: ${selector}`;
14
+ if (
15
+ !selector.startsWith('.c-') &&
16
+ !selector.startsWith('.l-') &&
17
+ !selector.startsWith('.p-')
18
+ ) {
19
+ return `クラス名は「l-」「p-」「c-」のいずれかから始めてください: ${selector}`;
16
20
  }
17
21
  if (selector.split('__').length > 2) {
18
22
  return `「__」はコンポーネント名とエレメント名の区切りを表します。エレメント名の文字区切りは「-」を使います: ${selector}`;
@@ -22,13 +26,16 @@ module.exports = {
22
26
  },
23
27
  ],
24
28
  'selector-nested-pattern': [
25
- '^[^.]+.*',
29
+ '^[^.&]+.*|^&(?:\\s|\\.|\\[|:|#)',
26
30
  {
27
31
  /**
28
32
  * @param {string} selector
29
33
  * @returns {string}
30
34
  */
31
35
  message: (selector) => {
36
+ if (selector.startsWith('&')) {
37
+ return `Stylelint v17以降「&」を使ったセレクタの文字列結合に対応しなくなったため、「&」の使用を禁止します: ${selector}`;
38
+ }
32
39
  return `コンポーネントのスタイル定義の中で別のコンポーネントを定義してはいけません: ${selector}`;
33
40
  },
34
41
  },
package/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "@d-zero/stylelint-config",
3
- "version": "5.0.0",
3
+ "version": "6.0.0-alpha.2",
4
4
  "description": "Configurations of Stylelint",
5
- "repository": "https://github.com/d-zero-dev/linters.git",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/d-zero-dev/linters.git",
8
+ "directory": "packages/@d-zero/stylelint-config"
9
+ },
6
10
  "author": "D-ZERO Co., Ltd.",
7
11
  "license": "MIT",
8
12
  "publishConfig": {
@@ -25,14 +29,14 @@
25
29
  ],
26
30
  "main": "index.js",
27
31
  "dependencies": {
28
- "@d-zero/stylelint-rules": "5.0.0",
32
+ "@d-zero/stylelint-rules": "6.0.0-alpha.2",
29
33
  "postcss-scss": "4.0.9",
30
- "stylelint": "16.26.1",
31
- "stylelint-config-recess-order": "7.4.0",
32
- "stylelint-config-standard": "39.0.1",
34
+ "stylelint": "17.4.0",
35
+ "stylelint-config-recess-order": "7.6.1",
36
+ "stylelint-config-standard": "40.0.0",
33
37
  "stylelint-order": "7.0.1",
34
- "stylelint-scss": "6.14.0",
35
- "stylelint-use-logical": "2.1.2"
38
+ "stylelint-scss": "7.0.0",
39
+ "stylelint-use-logical": "2.1.3"
36
40
  },
37
- "gitHead": "7f635ad8bbb1455d0d362fe00478a2f7bd216924"
41
+ "gitHead": "b2d753122349a8d4dd4b7d484276d03fec498f0d"
38
42
  }