eslint-plugin-yml 2.0.0 → 2.0.2

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/index.d.mts CHANGED
@@ -115,6 +115,11 @@ declare class YAMLSourceCode extends TextSourceCodeBase<{
115
115
  * @deprecated YAML does not have scopes
116
116
  */
117
117
  getScope(node?: AST.YAMLNode): Scope.Scope | null;
118
+ /**
119
+ * Compatibility for ESLint's SourceCode API
120
+ * @deprecated YAML does not have scopes
121
+ */
122
+ get scopeManager(): Scope.ScopeManager | null;
118
123
  /**
119
124
  * Compatibility for ESLint's SourceCode API
120
125
  * @deprecated
package/lib/index.mjs CHANGED
@@ -3,7 +3,7 @@ import * as yamlESLintParser from "yaml-eslint-parser";
3
3
  import { VisitorKeys, getStaticYAMLValue, parseForESLint, parseYAML, traverseNodes } from "yaml-eslint-parser";
4
4
  import path from "path";
5
5
  import naturalCompare from "natural-compare";
6
- import diff from "diff-sequences";
6
+ import diffModule from "diff-sequences";
7
7
  import escapeStringRegexp from "escape-string-regexp";
8
8
  import { CallMethodStep, ConfigCommentParser, Directive, TextSourceCodeBase, VisitNodeStep } from "@eslint/plugin-kit";
9
9
 
@@ -3689,6 +3689,7 @@ var require_string_key_default = createRule("require-string-key", {
3689
3689
 
3690
3690
  //#endregion
3691
3691
  //#region src/utils/calc-shortest-edit-script.ts
3692
+ const diff = typeof diffModule === "function" ? diffModule : diffModule.default;
3692
3693
  /**
3693
3694
  * Given the contents of two sequences, returns diff information.
3694
3695
  * @param a The first sequence.
@@ -5253,7 +5254,7 @@ var prettier_default = [...base_default, { rules: {
5253
5254
  //#endregion
5254
5255
  //#region package.json
5255
5256
  var name$1 = "eslint-plugin-yml";
5256
- var version$1 = "2.0.0";
5257
+ var version$1 = "2.0.2";
5257
5258
 
5258
5259
  //#endregion
5259
5260
  //#region src/meta.ts
@@ -5773,25 +5774,22 @@ var YAMLSourceCode = class extends TextSourceCodeBase {
5773
5774
  */
5774
5775
  getScope(node) {
5775
5776
  if (node?.type !== "Program") return null;
5776
- const fakeGlobalScope = {
5777
- type: "global",
5778
- block: node,
5779
- set: /* @__PURE__ */ new Map(),
5780
- through: [],
5781
- childScopes: [],
5782
- variableScope: null,
5783
- variables: [],
5784
- references: [],
5785
- functionExpressionScope: false,
5786
- isStrict: false,
5787
- upper: null,
5788
- implicit: {
5789
- variables: [],
5790
- set: /* @__PURE__ */ new Map()
5791
- }
5777
+ return createFakeGlobalScope(this.ast);
5778
+ }
5779
+ /**
5780
+ * Compatibility for ESLint's SourceCode API
5781
+ * @deprecated YAML does not have scopes
5782
+ */
5783
+ get scopeManager() {
5784
+ return {
5785
+ scopes: [],
5786
+ globalScope: createFakeGlobalScope(this.ast),
5787
+ acquire: (node) => {
5788
+ if (node.type === "Program") return createFakeGlobalScope(this.ast);
5789
+ return null;
5790
+ },
5791
+ getDeclaredVariables: () => []
5792
5792
  };
5793
- fakeGlobalScope.variableScope = fakeGlobalScope;
5794
- return fakeGlobalScope;
5795
5793
  }
5796
5794
  /**
5797
5795
  * Compatibility for ESLint's SourceCode API
@@ -5824,6 +5822,31 @@ function isNode(value) {
5824
5822
  function nodesOrTokensOverlap(first, second) {
5825
5823
  return first.range[0] < second.range[1] && second.range[0] < first.range[1];
5826
5824
  }
5825
+ /**
5826
+ * Creates a fake global scope for YAML files.
5827
+ * @deprecated YAML does not have scopes
5828
+ */
5829
+ function createFakeGlobalScope(node) {
5830
+ const fakeGlobalScope = {
5831
+ type: "global",
5832
+ block: node,
5833
+ set: /* @__PURE__ */ new Map(),
5834
+ through: [],
5835
+ childScopes: [],
5836
+ variableScope: null,
5837
+ variables: [],
5838
+ references: [],
5839
+ functionExpressionScope: false,
5840
+ isStrict: false,
5841
+ upper: null,
5842
+ implicit: {
5843
+ variables: [],
5844
+ set: /* @__PURE__ */ new Map()
5845
+ }
5846
+ };
5847
+ fakeGlobalScope.variableScope = fakeGlobalScope;
5848
+ return fakeGlobalScope;
5849
+ }
5827
5850
 
5828
5851
  //#endregion
5829
5852
  //#region src/language/yaml-language.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-yml",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "This ESLint plugin provides linting rules for YAML.",
5
5
  "type": "module",
6
6
  "main": "lib/index.mjs",
@@ -110,7 +110,7 @@
110
110
  "eslint-plugin-prettier": "^5.0.0",
111
111
  "eslint-plugin-regexp": "^2.0.0",
112
112
  "eslint-plugin-vue": "^10.0.0",
113
- "eslint-plugin-yml": "^1.0.0",
113
+ "eslint-plugin-yml": "^2.0.0",
114
114
  "events": "^3.3.0",
115
115
  "mocha": "^11.0.0",
116
116
  "monaco-editor": "^0.55.0",