eslint-plugin-yml 2.0.1 → 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 +5 -0
- package/lib/index.mjs +41 -19
- package/package.json +1 -1
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
|
@@ -5254,7 +5254,7 @@ var prettier_default = [...base_default, { rules: {
|
|
|
5254
5254
|
//#endregion
|
|
5255
5255
|
//#region package.json
|
|
5256
5256
|
var name$1 = "eslint-plugin-yml";
|
|
5257
|
-
var version$1 = "2.0.
|
|
5257
|
+
var version$1 = "2.0.2";
|
|
5258
5258
|
|
|
5259
5259
|
//#endregion
|
|
5260
5260
|
//#region src/meta.ts
|
|
@@ -5774,25 +5774,22 @@ var YAMLSourceCode = class extends TextSourceCodeBase {
|
|
|
5774
5774
|
*/
|
|
5775
5775
|
getScope(node) {
|
|
5776
5776
|
if (node?.type !== "Program") return null;
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
5780
|
-
|
|
5781
|
-
|
|
5782
|
-
|
|
5783
|
-
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
}
|
|
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: () => []
|
|
5793
5792
|
};
|
|
5794
|
-
fakeGlobalScope.variableScope = fakeGlobalScope;
|
|
5795
|
-
return fakeGlobalScope;
|
|
5796
5793
|
}
|
|
5797
5794
|
/**
|
|
5798
5795
|
* Compatibility for ESLint's SourceCode API
|
|
@@ -5825,6 +5822,31 @@ function isNode(value) {
|
|
|
5825
5822
|
function nodesOrTokensOverlap(first, second) {
|
|
5826
5823
|
return first.range[0] < second.range[1] && second.range[0] < first.range[1];
|
|
5827
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
|
+
}
|
|
5828
5850
|
|
|
5829
5851
|
//#endregion
|
|
5830
5852
|
//#region src/language/yaml-language.ts
|