eslint-plugin-yml 1.19.0 → 1.19.1

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 CHANGED
@@ -1,2 +1,2 @@
1
1
  export declare const name: "eslint-plugin-yml";
2
- export declare const version: "1.19.0";
2
+ export declare const version: "1.19.1";
package/lib/meta.js CHANGED
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = exports.name = void 0;
4
4
  exports.name = "eslint-plugin-yml";
5
- exports.version = "1.19.0";
5
+ exports.version = "1.19.1";
@@ -643,8 +643,26 @@ exports.default = (0, index_1.createRule)("sort-keys", {
643
643
  moveTargetLocs.range[1],
644
644
  ];
645
645
  const insertCode = sourceCode.text.slice(...removeRange);
646
+ const isAtFileStart = nodeLocs.loc.start.line === 1;
647
+ if (isAtFileStart) {
648
+ const removeRangeEnd = nodeLocs.range[1];
649
+ const len = sourceCode.text.length;
650
+ if (removeRangeEnd < len) {
651
+ const ch = sourceCode.text[removeRangeEnd];
652
+ if (isNewLine(ch)) {
653
+ if (ch === "\r" &&
654
+ removeRangeEnd + 1 < len &&
655
+ sourceCode.text[removeRangeEnd + 1] === "\n") {
656
+ removeRange[1] += 2;
657
+ }
658
+ else {
659
+ removeRange[1] += 1;
660
+ }
661
+ }
662
+ }
663
+ }
646
664
  yield fixer.removeRange(removeRange);
647
- yield fixer.insertTextAfterRange(moveTargetRange, insertCode);
665
+ yield fixer.insertTextAfterRange(moveTargetRange, `${isAtFileStart ? "\n" : ""}${insertCode}`);
648
666
  }
649
667
  else {
650
668
  const nextToken = sourceCode.getTokenAfter(data.node, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-yml",
3
- "version": "1.19.0",
3
+ "version": "1.19.1",
4
4
  "description": "This ESLint plugin provides linting rules for YAML.",
5
5
  "main": "lib/index.js",
6
6
  "files": [
@@ -73,7 +73,7 @@
73
73
  "@eslint-community/eslint-plugin-eslint-comments": "^4.3.0",
74
74
  "@eslint/eslintrc": "^3.1.0",
75
75
  "@eslint/js": "^9.5.0",
76
- "@eslint/json": "^0.13.0",
76
+ "@eslint/json": "^0.14.0",
77
77
  "@ota-meshi/eslint-plugin": "^0.18.0",
78
78
  "@ota-meshi/site-kit-eslint-editor-vue": "^0.2.0",
79
79
  "@types/debug": "^4.1.5",
@@ -83,19 +83,19 @@
83
83
  "@types/estree": "^1.0.0",
84
84
  "@types/mocha": "^10.0.0",
85
85
  "@types/natural-compare": "^1.4.0",
86
- "@types/node": "^22.0.0",
86
+ "@types/node": "^24.0.0",
87
87
  "@types/semver": "^7.3.1",
88
- "@typescript-eslint/eslint-plugin": "~8.45.0",
89
- "@typescript-eslint/parser": "~8.45.0",
88
+ "@typescript-eslint/eslint-plugin": "~8.49.0",
89
+ "@typescript-eslint/parser": "~8.49.0",
90
90
  "cross-env": "^10.0.0",
91
91
  "env-cmd": "^11.0.0",
92
- "esbuild": "^0.25.0",
92
+ "esbuild": "^0.27.0",
93
93
  "esbuild-register": "^3.2.0",
94
94
  "eslint": "^9.16.0",
95
95
  "eslint-config-prettier": "^10.0.0",
96
96
  "eslint-plugin-eslint-plugin": "^7.0.0",
97
97
  "eslint-plugin-eslint-rule-tester": "^0.6.0",
98
- "eslint-plugin-jsdoc": "^60.0.0",
98
+ "eslint-plugin-jsdoc": "^61.0.0",
99
99
  "eslint-plugin-json-schema-validator": "^5.0.0",
100
100
  "eslint-plugin-jsonc": "^2.0.0",
101
101
  "eslint-plugin-markdown": "^5.0.0",
@@ -107,7 +107,7 @@
107
107
  "eslint-plugin-yml": "^1.0.0",
108
108
  "events": "^3.3.0",
109
109
  "mocha": "^11.0.0",
110
- "monaco-editor": "^0.53.0",
110
+ "monaco-editor": "^0.55.0",
111
111
  "nyc": "^17.0.0",
112
112
  "pako": "^2.1.0",
113
113
  "prettier": "^3.0.3",
@@ -127,5 +127,5 @@
127
127
  "publishConfig": {
128
128
  "access": "public"
129
129
  },
130
- "packageManager": "npm@11.6.1"
130
+ "packageManager": "npm@11.7.0"
131
131
  }