eslint-plugin-yml 0.14.0 → 0.15.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/rules/indent.js +6 -0
- package/lib/utils/index.js +5 -1
- package/package.json +7 -7
package/lib/rules/indent.js
CHANGED
|
@@ -37,6 +37,7 @@ exports.default = (0, utils_1.createRule)("indent", {
|
|
|
37
37
|
const sourceCode = context.getSourceCode();
|
|
38
38
|
const offsets = new Map();
|
|
39
39
|
const marks = new Set();
|
|
40
|
+
const blockLiteralMarks = new Set();
|
|
40
41
|
const scalars = new Map();
|
|
41
42
|
function setOffset(token, offset, baseToken, options) {
|
|
42
43
|
var _a;
|
|
@@ -224,6 +225,7 @@ exports.default = (0, utils_1.createRule)("indent", {
|
|
|
224
225
|
const literal = sourceCode.getLastToken(node);
|
|
225
226
|
setOffset(literal, 1, mark);
|
|
226
227
|
scalars.set(literal, node);
|
|
228
|
+
blockLiteralMarks.add(mark);
|
|
227
229
|
}
|
|
228
230
|
else {
|
|
229
231
|
scalars.set(sourceCode.getFirstToken(node), node);
|
|
@@ -283,6 +285,10 @@ exports.default = (0, utils_1.createRule)("indent", {
|
|
|
283
285
|
1,
|
|
284
286
|
actualOffset: nextToken.range[0] - token.range[1],
|
|
285
287
|
});
|
|
288
|
+
if (blockLiteralMarks.has(nextToken)) {
|
|
289
|
+
lineTokens.unshift(nextToken);
|
|
290
|
+
break;
|
|
291
|
+
}
|
|
286
292
|
token = nextToken;
|
|
287
293
|
expectedIndent = nextExpectedIndent;
|
|
288
294
|
cacheExpectedIndent = expectedIndent;
|
package/lib/utils/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-yml",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "This ESLint plugin provides linting rules for YAML.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"files": [
|
|
@@ -81,15 +81,15 @@
|
|
|
81
81
|
"eslint-plugin-jsonc": "^2.0.0",
|
|
82
82
|
"eslint-plugin-markdown": "^2.0.0-0",
|
|
83
83
|
"eslint-plugin-node": "^11.1.0",
|
|
84
|
-
"eslint-plugin-node-dependencies": "^0.
|
|
84
|
+
"eslint-plugin-node-dependencies": "^0.8.0",
|
|
85
85
|
"eslint-plugin-prettier": "^4.0.0",
|
|
86
86
|
"eslint-plugin-regexp": "^1.0.0",
|
|
87
87
|
"eslint-plugin-vue": "^8.0.0",
|
|
88
|
-
"eslint-plugin-yml": "^0.
|
|
88
|
+
"eslint-plugin-yml": "^0.14.0",
|
|
89
89
|
"eslint4b": "^7.3.1",
|
|
90
90
|
"espree": "^9.0.0",
|
|
91
|
-
"mocha": "^
|
|
92
|
-
"monaco-editor": "^0.
|
|
91
|
+
"mocha": "^10.0.0",
|
|
92
|
+
"monaco-editor": "^0.33.0",
|
|
93
93
|
"nyc": "^15.1.0",
|
|
94
94
|
"prettier": "^2.2.1",
|
|
95
95
|
"raw-loader": "^4.0.1",
|
|
@@ -99,9 +99,9 @@
|
|
|
99
99
|
"stylelint-config-standard": "^25.0.0",
|
|
100
100
|
"stylelint-plugin-stylus": "^0.13.0",
|
|
101
101
|
"ts-node": "^10.0.0",
|
|
102
|
-
"typescript": "~4.
|
|
102
|
+
"typescript": "~4.6.0",
|
|
103
103
|
"vue-eslint-editor": "^1.1.0",
|
|
104
|
-
"vue-eslint-parser": "^
|
|
104
|
+
"vue-eslint-parser": "^9.0.0",
|
|
105
105
|
"vuepress": "^1.5.2"
|
|
106
106
|
}
|
|
107
107
|
}
|