eslint-plugin-yml 1.16.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/README.md +1 -1
- package/lib/configs/flat/base.js +17 -7
- package/lib/index.js +17 -7
- package/lib/meta.d.ts +2 -2
- package/lib/meta.js +1 -1
- package/lib/rules/indent.js +17 -3
- package/lib/rules/spaced-comment.js +2 -2
- package/lib/utils/index.js +17 -7
- package/package.json +12 -13
package/README.md
CHANGED
package/lib/configs/flat/base.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
const parser = __importStar(require("yaml-eslint-parser"));
|
|
27
37
|
exports.default = [
|
package/lib/index.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
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) {
|
|
@@ -3,11 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
6
|
+
const escape_string_regexp_1 = __importDefault(require("escape-string-regexp"));
|
|
7
7
|
const index_1 = require("../utils/index");
|
|
8
8
|
const compat_1 = require("../utils/compat");
|
|
9
9
|
function escapeText(s) {
|
|
10
|
-
return `(?:${
|
|
10
|
+
return `(?:${(0, escape_string_regexp_1.default)(s)})`;
|
|
11
11
|
}
|
|
12
12
|
function escapeAndRepeat(s) {
|
|
13
13
|
return `${escapeText(s)}+`;
|
package/lib/utils/index.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
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": [
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"homepage": "https://ota-meshi.github.io/eslint-plugin-yml/",
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"debug": "^4.3.2",
|
|
61
|
+
"escape-string-regexp": "4.0.0",
|
|
61
62
|
"eslint-compat-utils": "^0.6.0",
|
|
62
|
-
"lodash": "^4.17.21",
|
|
63
63
|
"natural-compare": "^1.4.0",
|
|
64
64
|
"yaml-eslint-parser": "^1.2.1"
|
|
65
65
|
},
|
|
@@ -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",
|
|
@@ -80,19 +80,18 @@
|
|
|
80
80
|
"@types/eslint-scope": "^3.7.0",
|
|
81
81
|
"@types/eslint-visitor-keys": "^3.0.0",
|
|
82
82
|
"@types/estree": "^1.0.0",
|
|
83
|
-
"@types/lodash": "^4.14.158",
|
|
84
83
|
"@types/mocha": "^10.0.0",
|
|
85
84
|
"@types/natural-compare": "^1.4.0",
|
|
86
85
|
"@types/node": "^22.0.0",
|
|
87
86
|
"@types/semver": "^7.3.1",
|
|
88
|
-
"@typescript-eslint/eslint-plugin": "~8.
|
|
89
|
-
"@typescript-eslint/parser": "~8.
|
|
87
|
+
"@typescript-eslint/eslint-plugin": "~8.31.0",
|
|
88
|
+
"@typescript-eslint/parser": "~8.31.0",
|
|
90
89
|
"cross-env": "^7.0.2",
|
|
91
90
|
"env-cmd": "^10.1.0",
|
|
92
|
-
"esbuild": "^0.
|
|
91
|
+
"esbuild": "^0.25.0",
|
|
93
92
|
"esbuild-register": "^3.2.0",
|
|
94
93
|
"eslint": "^9.16.0",
|
|
95
|
-
"eslint-config-prettier": "^
|
|
94
|
+
"eslint-config-prettier": "^10.0.0",
|
|
96
95
|
"eslint-plugin-eslint-plugin": "^6.0.0",
|
|
97
96
|
"eslint-plugin-eslint-rule-tester": "^0.6.0",
|
|
98
97
|
"eslint-plugin-jsdoc": "^50.0.0",
|
|
@@ -106,7 +105,7 @@
|
|
|
106
105
|
"eslint-plugin-vue": "^9.0.0",
|
|
107
106
|
"eslint-plugin-yml": "^1.0.0",
|
|
108
107
|
"events": "^3.3.0",
|
|
109
|
-
"mocha": "^
|
|
108
|
+
"mocha": "^11.0.0",
|
|
110
109
|
"monaco-editor": "^0.52.0",
|
|
111
110
|
"nyc": "^17.0.0",
|
|
112
111
|
"pako": "^2.1.0",
|
|
@@ -114,18 +113,18 @@
|
|
|
114
113
|
"semver": "^7.3.2",
|
|
115
114
|
"stylelint": "^16.0.0",
|
|
116
115
|
"stylelint-config-recommended-vue": "^1.0.0",
|
|
117
|
-
"stylelint-config-standard": "^
|
|
116
|
+
"stylelint-config-standard": "^38.0.0",
|
|
118
117
|
"stylelint-config-standard-vue": "^1.0.0",
|
|
119
118
|
"stylelint-stylus": "^1.0.0",
|
|
120
|
-
"typescript": "~5.
|
|
119
|
+
"typescript": "~5.8.0",
|
|
121
120
|
"typescript-eslint": "^8.0.0",
|
|
122
121
|
"vite-plugin-eslint4b": "^0.5.0",
|
|
123
122
|
"vitepress": "^1.0.0-rc.17",
|
|
124
|
-
"vue-eslint-parser": "^
|
|
123
|
+
"vue-eslint-parser": "^10.0.0",
|
|
125
124
|
"yaml": "^2.1.1"
|
|
126
125
|
},
|
|
127
126
|
"publishConfig": {
|
|
128
127
|
"access": "public"
|
|
129
128
|
},
|
|
130
|
-
"packageManager": "npm@
|
|
129
|
+
"packageManager": "npm@11.3.0"
|
|
131
130
|
}
|