@flint.fyi/vue 0.3.0 → 0.4.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/dist/index.d.mts CHANGED
@@ -1,11 +1,7 @@
1
1
  //#region src/plugin.d.ts
2
- declare const vue: import("@flint.fyi/core").Plugin<import("@flint.fyi/core").RuleAbout<string>, "all", [import("@flint.fyi/core").Rule<{
2
+ export declare const vue: import("@flint.fyi/core").Plugin<import("@flint.fyi/core").RuleAbout<string>, "all", [import("@flint.fyi/core").Rule<import("@flint.fyi/core").PluginRuleAbout<string> & {
3
3
  readonly description: "Reports v-for directives without a valid key binding.";
4
4
  readonly id: "vForKeys";
5
5
  readonly presets: readonly ["logical"];
6
- } & {
7
- readonly pluginId: string;
8
- readonly url: string;
9
6
  }, "invalidKey" | "missingKey" | "staticKey", undefined>]>;
10
- //#endregion
11
- export { vue };
7
+ //#endregion
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { RuleCreator, createPlugin } from "@flint.fyi/core";
2
2
  import { ts } from "@flint.fyi/ts";
3
3
  import * as vue$1 from "@vue/compiler-dom";
4
- import ts$1 from "typescript";
4
+ import { SyntaxKind } from "typescript";
5
5
  import { nullThrows } from "@flint.fyi/utils";
6
6
  import { reportSourceCode } from "@flint.fyi/volar-language";
7
7
  import { vueLanguage } from "@flint.fyi/vue-language";
@@ -84,7 +84,8 @@ var vForKeys_default = new RuleCreator({
84
84
  begin: keyProp.loc.start.offset,
85
85
  end: keyProp.loc.end.offset
86
86
  };
87
- const valueMapping = nullThrows(Array.from(map.toGeneratedLocation(nullThrows(keyProp.arg, "Expected keyProp.arg to be non-null").loc.start.offset)).filter(([, m]) => nullThrows(m.lengths[0], "Expected mapping to have at least one range") > 0)[1], "Expected :key two have two mappings")[1];
87
+ const generatedLocations = Array.from(map.toGeneratedLocation(nullThrows(keyProp.arg, "Expected keyProp.arg to be non-null").loc.start.offset)).filter(([, m]) => nullThrows(m.lengths[0], "Expected mapping to have at least one range") > 0);
88
+ const valueMapping = nullThrows(generatedLocations[1], "Expected :key two have two mappings")[1];
88
89
  const generatedBegin = nullThrows(valueMapping.generatedOffsets[0], "Expected mapping to have at least one range");
89
90
  valueRange = {
90
91
  begin: generatedBegin,
@@ -112,7 +113,7 @@ var vForKeys_default = new RuleCreator({
112
113
  const currentBegin = current.getStart(node);
113
114
  const currentEnd = current.getEnd();
114
115
  if (currentBegin > valueRange.end || currentEnd <= valueRange.begin) return false;
115
- if (currentBegin >= valueRange.begin && currentEnd <= valueRange.end && ts$1.isIdentifier(current)) {
116
+ if (currentBegin >= valueRange.begin && currentEnd <= valueRange.end && current.kind === SyntaxKind.Identifier) {
116
117
  const symbol = services.typeChecker.getSymbolAtLocation(current);
117
118
  if (symbol?.valueDeclaration == null) return false;
118
119
  const declStart = symbol.valueDeclaration.getStart(node);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flint.fyi/vue",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "[Experimental] Vue.js language plugin for Flint.",
5
5
  "homepage": "https://flint.fyi/rules/vue",
6
6
  "repository": {
@@ -22,21 +22,21 @@
22
22
  "dist/"
23
23
  ],
24
24
  "dependencies": {
25
- "@vue/compiler-dom": "^3.5.0",
26
- "typescript": "^5.9.0 || ^6.0.0",
27
- "@flint.fyi/ts": "^0.23.0",
28
- "@flint.fyi/core": "^0.25.0",
29
- "@flint.fyi/volar-language": "^0.3.0",
25
+ "@flint.fyi/core": "^0.27.0",
26
+ "@flint.fyi/ts": "^0.23.3",
30
27
  "@flint.fyi/utils": "^0.16.0",
31
- "@flint.fyi/vue-language": "^0.3.0"
28
+ "@flint.fyi/volar-language": "^0.4.0",
29
+ "@flint.fyi/vue-language": "^0.4.0",
30
+ "@vue/compiler-dom": "^3.5.0",
31
+ "typescript": "^6.0.3"
32
32
  },
33
33
  "devDependencies": {
34
- "tsdown": "0.22.3",
35
- "vitest": "4.1.0",
36
- "vue": "3.5.30",
37
34
  "@flint.fyi/build": "^0.1.0",
38
- "@flint.fyi/rule-tester": "^0.18.0",
39
- "@flint.fyi/typescript-language": "^0.20.0"
35
+ "@flint.fyi/rule-tester": "^0.20.0",
36
+ "@flint.fyi/typescript-language": "^0.21.0",
37
+ "tsdown": "0.23.0",
38
+ "vitest": "5.0.1",
39
+ "vue": "3.5.42"
40
40
  },
41
41
  "engines": {
42
42
  "node": ">=26.1.0"