eslint-plugin-yml 1.17.0 → 1.18.0
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/lib/meta.d.ts +2 -2
- package/lib/meta.js +1 -1
- package/lib/rules/indent.js +17 -3
- package/package.json +8 -8
package/lib/meta.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const name
|
|
2
|
-
export declare const version
|
|
1
|
+
export declare const name: "eslint-plugin-yml";
|
|
2
|
+
export declare const version: "1.18.0";
|
package/lib/meta.js
CHANGED
package/lib/rules/indent.js
CHANGED
|
@@ -12,6 +12,7 @@ function parseOptions(context) {
|
|
|
12
12
|
const numOfIndent = (0, yaml_1.getNumOfIndent)(context, indentOption);
|
|
13
13
|
let indentBlockSequences = true;
|
|
14
14
|
let indicatorValueIndent = numOfIndent;
|
|
15
|
+
let alignMultilineFlowScalars = false;
|
|
15
16
|
if (objectOptions) {
|
|
16
17
|
if (objectOptions.indentBlockSequences === false) {
|
|
17
18
|
indentBlockSequences = false;
|
|
@@ -19,11 +20,15 @@ function parseOptions(context) {
|
|
|
19
20
|
if (objectOptions.indicatorValueIndent != null) {
|
|
20
21
|
indicatorValueIndent = objectOptions.indicatorValueIndent;
|
|
21
22
|
}
|
|
23
|
+
if (objectOptions.alignMultilineFlowScalars != null) {
|
|
24
|
+
alignMultilineFlowScalars = objectOptions.alignMultilineFlowScalars;
|
|
25
|
+
}
|
|
22
26
|
}
|
|
23
27
|
return {
|
|
24
28
|
numOfIndent,
|
|
25
29
|
indentBlockSequences,
|
|
26
30
|
indicatorValueIndent,
|
|
31
|
+
alignMultilineFlowScalars,
|
|
27
32
|
};
|
|
28
33
|
}
|
|
29
34
|
exports.default = (0, index_1.createRule)("indent", {
|
|
@@ -48,6 +53,9 @@ exports.default = (0, index_1.createRule)("indent", {
|
|
|
48
53
|
type: "integer",
|
|
49
54
|
minimum: 2,
|
|
50
55
|
},
|
|
56
|
+
alignMultilineFlowScalars: {
|
|
57
|
+
type: "boolean",
|
|
58
|
+
},
|
|
51
59
|
},
|
|
52
60
|
additionalProperties: false,
|
|
53
61
|
},
|
|
@@ -66,7 +74,7 @@ exports.default = (0, index_1.createRule)("indent", {
|
|
|
66
74
|
if ((0, yaml_1.hasTabIndent)(context)) {
|
|
67
75
|
return {};
|
|
68
76
|
}
|
|
69
|
-
const { numOfIndent, indentBlockSequences, indicatorValueIndent } = parseOptions(context);
|
|
77
|
+
const { numOfIndent, indentBlockSequences, indicatorValueIndent, alignMultilineFlowScalars, } = parseOptions(context);
|
|
70
78
|
const indents = new Map();
|
|
71
79
|
const indicators = new Set();
|
|
72
80
|
const blockLiteralMarks = new Set();
|
|
@@ -451,7 +459,13 @@ exports.default = (0, index_1.createRule)("indent", {
|
|
|
451
459
|
processBlockLiteral(indent, scalarNode, lineIndent.lastScalar.expectedIndent);
|
|
452
460
|
}
|
|
453
461
|
else {
|
|
454
|
-
|
|
462
|
+
let expectedIndent = lineIndent.lastScalar.expectedIndent;
|
|
463
|
+
if (alignMultilineFlowScalars) {
|
|
464
|
+
if (!isBeginningToken(lineIndent.lastScalar.token)) {
|
|
465
|
+
expectedIndent = lineIndent.lastScalar.node.loc.start.column;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
processMultilineScalar(indent, scalarNode, expectedIndent);
|
|
455
469
|
}
|
|
456
470
|
}
|
|
457
471
|
}
|
|
@@ -568,7 +582,7 @@ exports.default = (0, index_1.createRule)("indent", {
|
|
|
568
582
|
};
|
|
569
583
|
}
|
|
570
584
|
}
|
|
571
|
-
function
|
|
585
|
+
function processMultilineScalar(lineIndent, scalarNode, expectedIndent) {
|
|
572
586
|
for (let scalarLine = lineIndent.line + 1; scalarLine <= scalarNode.loc.end.line; scalarLine++) {
|
|
573
587
|
const scalarActualIndent = getActualLineIndent(scalarLine);
|
|
574
588
|
if (scalarActualIndent == null) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-yml",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.18.0",
|
|
4
4
|
"description": "This ESLint plugin provides linting rules for YAML.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"files": [
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.3.0",
|
|
73
73
|
"@eslint/eslintrc": "^3.1.0",
|
|
74
74
|
"@eslint/js": "^9.5.0",
|
|
75
|
-
"@eslint/json": "^0.
|
|
75
|
+
"@eslint/json": "^0.12.0",
|
|
76
76
|
"@ota-meshi/eslint-plugin": "^0.17.3",
|
|
77
77
|
"@ota-meshi/site-kit-eslint-editor-vue": "^0.2.0",
|
|
78
78
|
"@types/debug": "^4.1.5",
|
|
@@ -84,8 +84,8 @@
|
|
|
84
84
|
"@types/natural-compare": "^1.4.0",
|
|
85
85
|
"@types/node": "^22.0.0",
|
|
86
86
|
"@types/semver": "^7.3.1",
|
|
87
|
-
"@typescript-eslint/eslint-plugin": "~8.
|
|
88
|
-
"@typescript-eslint/parser": "~8.
|
|
87
|
+
"@typescript-eslint/eslint-plugin": "~8.31.0",
|
|
88
|
+
"@typescript-eslint/parser": "~8.31.0",
|
|
89
89
|
"cross-env": "^7.0.2",
|
|
90
90
|
"env-cmd": "^10.1.0",
|
|
91
91
|
"esbuild": "^0.25.0",
|
|
@@ -113,18 +113,18 @@
|
|
|
113
113
|
"semver": "^7.3.2",
|
|
114
114
|
"stylelint": "^16.0.0",
|
|
115
115
|
"stylelint-config-recommended-vue": "^1.0.0",
|
|
116
|
-
"stylelint-config-standard": "^
|
|
116
|
+
"stylelint-config-standard": "^38.0.0",
|
|
117
117
|
"stylelint-config-standard-vue": "^1.0.0",
|
|
118
118
|
"stylelint-stylus": "^1.0.0",
|
|
119
|
-
"typescript": "~5.
|
|
119
|
+
"typescript": "~5.8.0",
|
|
120
120
|
"typescript-eslint": "^8.0.0",
|
|
121
121
|
"vite-plugin-eslint4b": "^0.5.0",
|
|
122
122
|
"vitepress": "^1.0.0-rc.17",
|
|
123
|
-
"vue-eslint-parser": "^
|
|
123
|
+
"vue-eslint-parser": "^10.0.0",
|
|
124
124
|
"yaml": "^2.1.1"
|
|
125
125
|
},
|
|
126
126
|
"publishConfig": {
|
|
127
127
|
"access": "public"
|
|
128
128
|
},
|
|
129
|
-
"packageManager": "npm@11.
|
|
129
|
+
"packageManager": "npm@11.3.0"
|
|
130
130
|
}
|