@vue-vine/eslint-parser 0.1.10 → 0.1.11
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/dist/index.js +40 -6
- package/dist/index.mjs +40 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -7959,7 +7959,7 @@ function isBasicParserObject(value) {
|
|
7959
7959
|
}
|
7960
7960
|
|
7961
7961
|
// src/script/scope-analyzer.ts
|
7962
|
-
var _scopemanager = require('@typescript-eslint/scope-manager'); var tsEscopeTypes = _interopRequireWildcard(_scopemanager);
|
7962
|
+
var _scopemanager = require('@typescript-eslint/scope-manager'); var tsEscopeTypes2 = _interopRequireWildcard(_scopemanager); var tsEscopeTypes = _interopRequireWildcard(_scopemanager);
|
7963
7963
|
|
7964
7964
|
// src/common/eslint-scope.ts
|
7965
7965
|
var _eslintscope = require('eslint-scope'); var escope = _interopRequireWildcard(_eslintscope);
|
@@ -7975,6 +7975,29 @@ function getEslintScope() {
|
|
7975
7975
|
return escopeCache;
|
7976
7976
|
}
|
7977
7977
|
|
7978
|
+
// src/common/vine-specific.ts
|
7979
|
+
|
7980
|
+
function createVirtualVineFnPropsReference({
|
7981
|
+
compFnPropsIdentifier,
|
7982
|
+
foundVCFScope
|
7983
|
+
}) {
|
7984
|
+
const virtualReference = new tsEscopeTypes.Reference(
|
7985
|
+
compFnPropsIdentifier,
|
7986
|
+
foundVCFScope,
|
7987
|
+
1 /* Read */,
|
7988
|
+
void 0,
|
7989
|
+
void 0,
|
7990
|
+
void 0,
|
7991
|
+
1 /* Value */
|
7992
|
+
);
|
7993
|
+
virtualReference.isWrite = () => false;
|
7994
|
+
virtualReference.isWriteOnly = () => false;
|
7995
|
+
virtualReference.isRead = () => true;
|
7996
|
+
virtualReference.isReadOnly = () => true;
|
7997
|
+
virtualReference.isReadWrite = () => false;
|
7998
|
+
return virtualReference;
|
7999
|
+
}
|
8000
|
+
|
7978
8001
|
// src/script/scope-analyzer.ts
|
7979
8002
|
var BUILTIN_COMPONENTS = /* @__PURE__ */ new Set([
|
7980
8003
|
"template",
|
@@ -8109,6 +8132,18 @@ function collectVariablesForVCF(tsFileScopeManager, templateRoot) {
|
|
8109
8132
|
for (const variable of foundVCFScope.variables) {
|
8110
8133
|
scriptVariables.set(variable.name, variable);
|
8111
8134
|
}
|
8135
|
+
const compFnPropsIdentifier = _optionalChain([foundVCF, 'access', _13 => _13.params, 'optionalAccess', _14 => _14[0], 'optionalAccess', _15 => _15.type]) === "Identifier" && _optionalChain([foundVCF, 'access', _16 => _16.params, 'access', _17 => _17[0], 'optionalAccess', _18 => _18.name]) === "props" ? foundVCF.params[0] : null;
|
8136
|
+
const propsVar = scriptVariables.get("props");
|
8137
|
+
if (compFnPropsIdentifier && propsVar) {
|
8138
|
+
;
|
8139
|
+
propsVar.eslintUsed = true;
|
8140
|
+
propsVar.references.push(
|
8141
|
+
createVirtualVineFnPropsReference({
|
8142
|
+
foundVCFScope,
|
8143
|
+
compFnPropsIdentifier
|
8144
|
+
})
|
8145
|
+
);
|
8146
|
+
}
|
8112
8147
|
}
|
8113
8148
|
}
|
8114
8149
|
}
|
@@ -8153,7 +8188,7 @@ function analyzeUsedInTemplateVariables(scopeManager, templateRoot) {
|
|
8153
8188
|
return;
|
8154
8189
|
}
|
8155
8190
|
markedVariables.add(name);
|
8156
|
-
const reference = new
|
8191
|
+
const reference = new tsEscopeTypes2.Reference(
|
8157
8192
|
variable.identifiers[0],
|
8158
8193
|
variable.scope,
|
8159
8194
|
1 /* Read */,
|
@@ -10011,12 +10046,11 @@ function prepareForTemplateRootAST(tsFileAST) {
|
|
10011
10046
|
return [];
|
10012
10047
|
}
|
10013
10048
|
return extractResults.map((extractResult) => {
|
10014
|
-
const { templateNode,
|
10049
|
+
const { templateNode, ...restOfExtractResult } = extractResult;
|
10015
10050
|
return {
|
10016
10051
|
templateNode,
|
10017
|
-
|
10018
|
-
|
10019
|
-
...prepareTemplate(templateNode)
|
10052
|
+
...prepareTemplate(templateNode),
|
10053
|
+
...restOfExtractResult
|
10020
10054
|
};
|
10021
10055
|
});
|
10022
10056
|
}
|
package/dist/index.mjs
CHANGED
@@ -7959,7 +7959,7 @@ function isBasicParserObject(value) {
|
|
7959
7959
|
}
|
7960
7960
|
|
7961
7961
|
// src/script/scope-analyzer.ts
|
7962
|
-
import * as
|
7962
|
+
import * as tsEscopeTypes2 from "@typescript-eslint/scope-manager";
|
7963
7963
|
|
7964
7964
|
// src/common/eslint-scope.ts
|
7965
7965
|
import * as escope from "eslint-scope";
|
@@ -7975,6 +7975,29 @@ function getEslintScope() {
|
|
7975
7975
|
return escopeCache;
|
7976
7976
|
}
|
7977
7977
|
|
7978
|
+
// src/common/vine-specific.ts
|
7979
|
+
import * as tsEscopeTypes from "@typescript-eslint/scope-manager";
|
7980
|
+
function createVirtualVineFnPropsReference({
|
7981
|
+
compFnPropsIdentifier,
|
7982
|
+
foundVCFScope
|
7983
|
+
}) {
|
7984
|
+
const virtualReference = new tsEscopeTypes.Reference(
|
7985
|
+
compFnPropsIdentifier,
|
7986
|
+
foundVCFScope,
|
7987
|
+
1 /* Read */,
|
7988
|
+
void 0,
|
7989
|
+
void 0,
|
7990
|
+
void 0,
|
7991
|
+
1 /* Value */
|
7992
|
+
);
|
7993
|
+
virtualReference.isWrite = () => false;
|
7994
|
+
virtualReference.isWriteOnly = () => false;
|
7995
|
+
virtualReference.isRead = () => true;
|
7996
|
+
virtualReference.isReadOnly = () => true;
|
7997
|
+
virtualReference.isReadWrite = () => false;
|
7998
|
+
return virtualReference;
|
7999
|
+
}
|
8000
|
+
|
7978
8001
|
// src/script/scope-analyzer.ts
|
7979
8002
|
var BUILTIN_COMPONENTS = /* @__PURE__ */ new Set([
|
7980
8003
|
"template",
|
@@ -8109,6 +8132,18 @@ function collectVariablesForVCF(tsFileScopeManager, templateRoot) {
|
|
8109
8132
|
for (const variable of foundVCFScope.variables) {
|
8110
8133
|
scriptVariables.set(variable.name, variable);
|
8111
8134
|
}
|
8135
|
+
const compFnPropsIdentifier = foundVCF.params?.[0]?.type === "Identifier" && foundVCF.params[0]?.name === "props" ? foundVCF.params[0] : null;
|
8136
|
+
const propsVar = scriptVariables.get("props");
|
8137
|
+
if (compFnPropsIdentifier && propsVar) {
|
8138
|
+
;
|
8139
|
+
propsVar.eslintUsed = true;
|
8140
|
+
propsVar.references.push(
|
8141
|
+
createVirtualVineFnPropsReference({
|
8142
|
+
foundVCFScope,
|
8143
|
+
compFnPropsIdentifier
|
8144
|
+
})
|
8145
|
+
);
|
8146
|
+
}
|
8112
8147
|
}
|
8113
8148
|
}
|
8114
8149
|
}
|
@@ -8153,7 +8188,7 @@ function analyzeUsedInTemplateVariables(scopeManager, templateRoot) {
|
|
8153
8188
|
return;
|
8154
8189
|
}
|
8155
8190
|
markedVariables.add(name);
|
8156
|
-
const reference = new
|
8191
|
+
const reference = new tsEscopeTypes2.Reference(
|
8157
8192
|
variable.identifiers[0],
|
8158
8193
|
variable.scope,
|
8159
8194
|
1 /* Read */,
|
@@ -10011,12 +10046,11 @@ function prepareForTemplateRootAST(tsFileAST) {
|
|
10011
10046
|
return [];
|
10012
10047
|
}
|
10013
10048
|
return extractResults.map((extractResult) => {
|
10014
|
-
const { templateNode,
|
10049
|
+
const { templateNode, ...restOfExtractResult } = extractResult;
|
10015
10050
|
return {
|
10016
10051
|
templateNode,
|
10017
|
-
|
10018
|
-
|
10019
|
-
...prepareTemplate(templateNode)
|
10052
|
+
...prepareTemplate(templateNode),
|
10053
|
+
...restOfExtractResult
|
10020
10054
|
};
|
10021
10055
|
});
|
10022
10056
|
}
|