@d-zero/markuplint-config 5.0.0-alpha.22 → 5.0.0-alpha.23

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/base.js ADDED
@@ -0,0 +1,14 @@
1
+ export default {
2
+ extends: ['markuplint:recommended'],
3
+ rules: {
4
+ 'character-reference': false,
5
+ },
6
+ nodeRules: [
7
+ {
8
+ selector: "script[src^='https://']",
9
+ rules: {
10
+ 'required-attr': false,
11
+ },
12
+ },
13
+ ],
14
+ };
package/index.js ADDED
@@ -0,0 +1,31 @@
1
+ import base from './base.js';
2
+ import name from './name.js';
3
+ import pug from './pug.js';
4
+
5
+ export default {
6
+ ...base,
7
+ ...pug,
8
+ ...name,
9
+ parser: {
10
+ ...base.parser,
11
+ ...pug.parser,
12
+ ...name.parser,
13
+ },
14
+ rules: {
15
+ ...base.rules,
16
+ ...pug.rules,
17
+ ...name.rules,
18
+ },
19
+ nodeRules: [
20
+ //
21
+ ...(base.nodeRules ?? []),
22
+ ...(pug.nodeRules ?? []),
23
+ ...(name.nodeRules ?? []),
24
+ ],
25
+ childNodeRules: [
26
+ //
27
+ ...(base.childNodeRules ?? []),
28
+ ...(pug.childNodeRules ?? []),
29
+ ...(name.childNodeRules ?? []),
30
+ ],
31
+ };
package/name.js ADDED
@@ -0,0 +1,43 @@
1
+ export default {
2
+ rules: {
3
+ 'class-naming': {
4
+ severity: 'error',
5
+ value: '/^c-(?<ComponentName>[a-z][a-z0-9]*(?:-[a-z0-9]+)*)$/',
6
+ reason:
7
+ 'クラス名の形式はディーゼロのコーディングガイドラインに則って命名する必要があります。 http://tmpl.d-zero.com/__guideline/coding-guideline/html.html#%F0%9F%92%8E-%E3%82%B3%E3%83%B3%E3%83%9B%E3%82%9A%E3%83%BC%E3%83%8D%E3%83%B3%E3%83%88',
8
+ },
9
+ },
10
+ childNodeRules: [
11
+ {
12
+ regexSelector: {
13
+ attrName: 'class',
14
+ attrValue: '/^c-(?<ComponentName>[a-z][a-z0-9]*(?:-[a-z0-9]+)*)$/',
15
+ },
16
+ inheritance: true,
17
+ rules: {
18
+ 'class-naming': {
19
+ severity: 'error',
20
+ value: [
21
+ '/^c-{{ ComponentName }}__[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/',
22
+ '/^c-(?!{{ ComponentName }})[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/',
23
+ '/^c-{{ ComponentName }}[a-z0-9]*(?:-[a-z0-9]+)*$/',
24
+ ],
25
+ reason:
26
+ 'ディーゼロのコーディングガイドラインではコンポーネントの中はそのコンポーネントのエレメントか、他のコンポーネントである必要があります。 http://tmpl.d-zero.com/__guideline/coding-guideline/html.html#%E3%82%B3%E3%83%B3%E3%83%9B%E3%82%9A%E3%83%BC%E3%83%8D%E3%83%B3%E3%83%88%E3%81%AE%E6%A7%8B%E6%88%90%E3%81%A8%E3%82%AF%E3%83%A9%E3%82%B9%E5%91%BD%E5%90%8D%E8%A6%8F%E5%89%87',
27
+ },
28
+ },
29
+ },
30
+ {
31
+ selector: "[class='c-content-main']",
32
+ inheritance: true,
33
+ rules: {
34
+ 'class-naming': {
35
+ severity: 'error',
36
+ value: '/^(?!c-).+$|^$/',
37
+ reason:
38
+ 'ディーゼロのコーディングガイドラインでは「c-content-main」の中は「c-」で始めないルールとなっています。 http://tmpl.d-zero.com/__guideline/coding-guideline/html.html#%E3%82%A8%E3%83%AC%E3%83%A1%E3%83%B3%E3%83%88%E3%81%AE%E3%82%AF%E3%83%A9%E3%82%B9%E3%81%AE%E4%BE%8B%E5%A4%96%E3%81%A8%E3%82%AF%E3%83%A9%E3%82%B9%E8%BF%BD%E5%8A%A0%E3%81%AE%E3%83%AB%E3%83%BC%E3%83%AB',
39
+ },
40
+ },
41
+ },
42
+ ],
43
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d-zero/markuplint-config",
3
- "version": "5.0.0-alpha.22",
3
+ "version": "5.0.0-alpha.23",
4
4
  "description": "Configurations of Markuplint",
5
5
  "repository": "https://github.com/d-zero-dev/linters.git",
6
6
  "author": "D-ZERO Co., Ltd.",
@@ -9,13 +9,22 @@
9
9
  "publishConfig": {
10
10
  "access": "public"
11
11
  },
12
+ "engines": {
13
+ "node": ">=22.0.0"
14
+ },
15
+ "type": "module",
16
+ "exports": {
17
+ ".": "./index.js",
18
+ "./base": "./base.js",
19
+ "./name": "./name.js",
20
+ "./pug": "./pug.js"
21
+ },
12
22
  "files": [
13
- ".markuplintrc.json"
23
+ "*.js"
14
24
  ],
15
- "main": ".markuplintrc.json",
16
25
  "dependencies": {
17
- "@markuplint/pug-parser": "4.3.0",
18
- "markuplint": "4.4.0"
26
+ "@markuplint/pug-parser": "4.5.1",
27
+ "markuplint": "4.6.1"
19
28
  },
20
- "gitHead": "a81285e8f7fd587266ad85afc9e54b5c7ade9f71"
29
+ "gitHead": "3ac336adfbd5bf064d98df6aba6e3efa532596af"
21
30
  }
package/pug.js ADDED
@@ -0,0 +1,5 @@
1
+ export default {
2
+ parser: {
3
+ '.pug$': '@markuplint/pug-parser',
4
+ },
5
+ };
@@ -1,53 +0,0 @@
1
- {
2
- "extends": ["markuplint:recommended"],
3
- "parser": {
4
- ".pug$": "@markuplint/pug-parser"
5
- },
6
- "rules": {
7
- "character-reference": false,
8
- "class-naming": {
9
- "severity": "error",
10
- "value": "/^c-(?<ComponentName>[a-z][a-z0-9]*(?:-[a-z0-9]+)*)$/",
11
- "reason": "クラス名の形式はディーゼロのコーディングガイドラインに則って命名する必要があります。 http://tmpl.d-zero.com/__guideline/coding-guideline/html.html#%F0%9F%92%8E-%E3%82%B3%E3%83%B3%E3%83%9B%E3%82%9A%E3%83%BC%E3%83%8D%E3%83%B3%E3%83%88"
12
- }
13
- },
14
- "nodeRules": [
15
- {
16
- "selector": "script[src^='https://']",
17
- "rules": {
18
- "required-attr": false
19
- }
20
- }
21
- ],
22
- "childNodeRules": [
23
- {
24
- "regexSelector": {
25
- "attrName": "class",
26
- "attrValue": "/^c-(?<ComponentName>[a-z][a-z0-9]*(?:-[a-z0-9]+)*)$/"
27
- },
28
- "inheritance": true,
29
- "rules": {
30
- "class-naming": {
31
- "severity": "error",
32
- "value": [
33
- "/^c-{{ ComponentName }}__[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/",
34
- "/^c-(?!{{ ComponentName }})[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/",
35
- "/^c-{{ ComponentName }}[a-z0-9]*(?:-[a-z0-9]+)*$/"
36
- ],
37
- "reason": "ディーゼロのコーディングガイドラインではコンポーネントの中はそのコンポーネントのエレメントか、他のコンポーネントである必要があります。 http://tmpl.d-zero.com/__guideline/coding-guideline/html.html#%E3%82%B3%E3%83%B3%E3%83%9B%E3%82%9A%E3%83%BC%E3%83%8D%E3%83%B3%E3%83%88%E3%81%AE%E6%A7%8B%E6%88%90%E3%81%A8%E3%82%AF%E3%83%A9%E3%82%B9%E5%91%BD%E5%90%8D%E8%A6%8F%E5%89%87"
38
- }
39
- }
40
- },
41
- {
42
- "selector": "[class='c-content-main']",
43
- "inheritance": true,
44
- "rules": {
45
- "class-naming": {
46
- "severity": "error",
47
- "value": "/^(?!c-).+$|^$/",
48
- "reason": "ディーゼロのコーディングガイドラインでは「c-content-main」の中は「c-」で始めないルールとなっています。 http://tmpl.d-zero.com/__guideline/coding-guideline/html.html#%E3%82%A8%E3%83%AC%E3%83%A1%E3%83%B3%E3%83%88%E3%81%AE%E3%82%AF%E3%83%A9%E3%82%B9%E3%81%AE%E4%BE%8B%E5%A4%96%E3%81%A8%E3%82%AF%E3%83%A9%E3%82%B9%E8%BF%BD%E5%8A%A0%E3%81%AE%E3%83%AB%E3%83%BC%E3%83%AB"
49
- }
50
- }
51
- }
52
- ]
53
- }