@r_masseater/oxlint-typed-rules 0.4.1 → 0.4.3
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/README.md +77 -83
- package/dist/drizzle.d.mts +3 -3
- package/dist/drizzle.mjs +10 -10
- package/dist/drizzle.mjs.map +1 -1
- package/dist/{eslint-utils-BmbvsYwn.mjs → eslint-utils-ujGlgEMD.mjs} +9 -9
- package/dist/{eslint-utils-BmbvsYwn.mjs.map → eslint-utils-ujGlgEMD.mjs.map} +1 -1
- package/dist/{upstream-plugin-xn91RvOJ.d.mts → index-D1qDt581.d.mts} +4 -4
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +1 -1
- package/dist/react.d.mts +5 -5
- package/dist/react.mjs +171 -117
- package/dist/react.mjs.map +1 -1
- package/dist/remotion.d.mts +3 -3
- package/dist/remotion.mjs +4 -4
- package/dist/remotion.mjs.map +1 -1
- package/dist/tanstack-query.d.mts +3 -3
- package/dist/tanstack-query.mjs +6 -6
- package/dist/tanstack-query.mjs.map +1 -1
- package/dist/tanstack-router.d.mts +3 -3
- package/dist/tanstack-router.mjs +12 -12
- package/dist/tanstack-router.mjs.map +1 -1
- package/dist/tanstack-start.mjs +15 -15
- package/dist/tanstack-start.mjs.map +1 -1
- package/dist/{ts-compat-kqrVqnFj.mjs → ts-compat-CFDky9Ie.mjs} +3 -3
- package/dist/ts-compat-CFDky9Ie.mjs.map +1 -0
- package/dist/{typed-rule-DljA66d1.mjs → typed-rule-DFpV2XgE.mjs} +63 -63
- package/dist/typed-rule-DFpV2XgE.mjs.map +1 -0
- package/dist/{typescript-eslint-utils-DRyGbBR9.mjs → typescript-eslint-utils-C6OO2FjX.mjs} +3 -3
- package/dist/typescript-eslint-utils-C6OO2FjX.mjs.map +1 -0
- package/dist/{upstream-plugin-B_PNfSLV.mjs → upstream-plugin-D4Lz9A1H.mjs} +5 -4
- package/dist/upstream-plugin-D4Lz9A1H.mjs.map +1 -0
- package/package.json +19 -17
- package/skills/run-typed-eslint-rules/SKILL.md +85 -0
- package/dist/config-rules-CIyMUUvG.mjs +0 -6
- package/dist/config-rules-CIyMUUvG.mjs.map +0 -1
- package/dist/ts-compat-kqrVqnFj.mjs.map +0 -1
- package/dist/typed-rule-DljA66d1.mjs.map +0 -1
- package/dist/typescript-eslint-utils-DRyGbBR9.mjs.map +0 -1
- package/dist/upstream-plugin-B_PNfSLV.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -1,88 +1,82 @@
|
|
|
1
1
|
# oxlint-typed-rules
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
oxlint
|
|
5
|
-
TypeScript 7
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
##
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
##
|
|
13
|
-
|
|
14
|
-
|
|
|
15
|
-
| ------------------------------------------------- |
|
|
16
|
-
| `@r_masseater/oxlint-typed-rules/tanstack-start` | [@tanstack/eslint-plugin-start][tanstack]
|
|
17
|
-
| `@r_masseater/oxlint-typed-rules/tanstack-query` | [@tanstack/eslint-plugin-query][tanstack-query] 5.105.3
|
|
18
|
-
| `@r_masseater/oxlint-typed-rules/tanstack-router` | [@tanstack/eslint-plugin-router][tanstack-router] 1.162.0
|
|
19
|
-
| `@r_masseater/oxlint-typed-rules/drizzle` | [eslint-plugin-drizzle][drizzle] 0.2.3
|
|
20
|
-
| `@r_masseater/oxlint-typed-rules/remotion` | [@remotion/eslint-plugin][remotion] 4.0.541
|
|
21
|
-
| `@r_masseater/oxlint-typed-rules/react` | [@eslint-react/eslint-plugin][eslint-react] 5.30.1
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
3
|
+
Runs ESLint rules that need type information as oxlint JS plugins.
|
|
4
|
+
oxlint does not pass type information to JS plugins ([oxc#19596](https://github.com/oxc-project/oxc/issues/19596)),
|
|
5
|
+
so this package builds a Program and a type checker with the TypeScript 7 API and provides the `parserServices` the rules read.
|
|
6
|
+
Type-aware rules then run on oxlint alone, without installing ESLint.
|
|
7
|
+
|
|
8
|
+
## Published to
|
|
9
|
+
|
|
10
|
+
npm: [@r_masseater/oxlint-typed-rules](https://www.npmjs.com/package/@r_masseater/oxlint-typed-rules)
|
|
11
|
+
|
|
12
|
+
## Ported rules
|
|
13
|
+
|
|
14
|
+
| Entry point | Contents |
|
|
15
|
+
| ------------------------------------------------- | ---------------------------------------------------------------------------------- |
|
|
16
|
+
| `@r_masseater/oxlint-typed-rules/tanstack-start` | The 2 rules of [@tanstack/eslint-plugin-start][tanstack] |
|
|
17
|
+
| `@r_masseater/oxlint-typed-rules/tanstack-query` | All rules and configs of [@tanstack/eslint-plugin-query][tanstack-query] 5.105.3 |
|
|
18
|
+
| `@r_masseater/oxlint-typed-rules/tanstack-router` | All rules and configs of [@tanstack/eslint-plugin-router][tanstack-router] 1.162.0 |
|
|
19
|
+
| `@r_masseater/oxlint-typed-rules/drizzle` | All rules and configs of [eslint-plugin-drizzle][drizzle] 0.2.3 |
|
|
20
|
+
| `@r_masseater/oxlint-typed-rules/remotion` | All rules and configs of [@remotion/eslint-plugin][remotion] 4.0.541 |
|
|
21
|
+
| `@r_masseater/oxlint-typed-rules/react` | All rules and configs of [@eslint-react/eslint-plugin][eslint-react] 5.30.1 |
|
|
22
|
+
|
|
23
|
+
[tanstack]: https://www.npmjs.com/package/@tanstack/eslint-plugin-start
|
|
24
|
+
[tanstack-query]: https://www.npmjs.com/package/@tanstack/eslint-plugin-query
|
|
25
|
+
[tanstack-router]: https://www.npmjs.com/package/@tanstack/eslint-plugin-router
|
|
26
|
+
[drizzle]: https://www.npmjs.com/package/eslint-plugin-drizzle
|
|
27
|
+
[remotion]: https://www.npmjs.com/package/@remotion/eslint-plugin
|
|
28
|
+
[eslint-react]: https://www.npmjs.com/package/@eslint-react/eslint-plugin
|
|
29
|
+
|
|
30
|
+
## Performance
|
|
31
|
+
|
|
32
|
+
The same rules were compared against ESLint (typescript-eslint).
|
|
33
|
+
Measured on 2026-11-03 under these conditions.
|
|
34
|
+
|
|
35
|
+
The targets were `apps/portfolio/src` of [masseater.dev][masseater-dev] (238 files)
|
|
36
|
+
and a React slide app in the owner's private repository (1,434 files, 52,000 lines).
|
|
37
|
+
The oxlint side used oxlint 1.90.0, oxlint-tsgolint 7.0.2005 and TypeScript 7.1.0-beta.
|
|
38
|
+
The ESLint side used ESLint 9.39.5 and typescript-eslint 8.72.1 (`projectService`).
|
|
39
|
+
ESLint stayed on 9 because `@tanstack/eslint-plugin-start` 0.1.0 does not support ESLint 10.
|
|
40
|
+
The same patch was applied on the ESLint side, and both sides reported the same violations.
|
|
41
|
+
The machine ran Linux with Node.js 26.13.0, 4 cores and 16 GB of memory.
|
|
42
|
+
Cold is the median of 3 runs after dropping the OS page cache.
|
|
43
|
+
Warm is the median of 5 runs with the page cache filled, without ESLint's `--cache`.
|
|
44
|
+
Memory is the peak total RSS, including the tsgo and tsgolint child processes.
|
|
38
45
|
|
|
39
46
|
[masseater-dev]: https://github.com/masseater/masseater.dev
|
|
40
47
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
| TanStack
|
|
48
|
-
| TanStack
|
|
49
|
-
| `no-floating-promises
|
|
50
|
-
| `no-floating-promises
|
|
51
|
-
| 3
|
|
52
|
-
| 3
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
|
57
|
-
|
|
|
58
|
-
|
|
|
59
|
-
|
|
|
60
|
-
| TanStack
|
|
61
|
-
| TanStack
|
|
62
|
-
| `no-floating-promises
|
|
63
|
-
| `no-floating-promises
|
|
64
|
-
| 3
|
|
65
|
-
| 3
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
ESLint の `--cache` が当たると、どの組み合わせも 0.4〜0.5 秒、170〜210 MB で終わる。
|
|
77
|
-
ただし ESLint のキャッシュはファイルの中身だけを見る。
|
|
78
|
-
型の出どころのファイルが変わっても、型を使うルールを検査し直さない。
|
|
79
|
-
|
|
80
|
-
typescript-eslint のルールで oxlint に同じ名前のものがあれば、tsgolint で動かす。
|
|
81
|
-
tsgolint は Go で書かれた TypeScript 7 で並列に型を調べる。
|
|
82
|
-
ESLint の 6〜9 倍速く、メモリも 4〜6 割で済む。
|
|
83
|
-
このパッケージは、tsgolint に無いルールを ESLint 無しで動かすためのものである。
|
|
84
|
-
tsgolint と併せると、型の情報を tsgo と tsgolint で 2 度作り、メモリはそのぶん増える。
|
|
85
|
-
|
|
86
|
-
## ライセンス
|
|
87
|
-
|
|
88
|
-
MIT。同梱する元のプラグインのライセンスは `libs/oxlint-typed-rules/LICENSE` にある。
|
|
48
|
+
Results for `apps/portfolio/src` of masseater.dev:
|
|
49
|
+
|
|
50
|
+
| Rules and tool | Cold | Warm | Memory |
|
|
51
|
+
| ---------------------------------- | -----: | -----: | -------: |
|
|
52
|
+
| No rules, oxlint | 0.11 s | 0.06 s | 99 MB |
|
|
53
|
+
| No rules, ESLint | 6.29 s | 5.93 s | 1,288 MB |
|
|
54
|
+
| 2 TanStack rules, this package | 1.90 s | 1.61 s | 769 MB |
|
|
55
|
+
| 2 TanStack rules, ESLint | 6.76 s | 5.75 s | 1,324 MB |
|
|
56
|
+
| `no-floating-promises`, tsgolint | 1.22 s | 1.03 s | 796 MB |
|
|
57
|
+
| `no-floating-promises`, ESLint | 7.15 s | 6.35 s | 1,395 MB |
|
|
58
|
+
| 3 rules, this package and tsgolint | 2.84 s | 2.59 s | 1,449 MB |
|
|
59
|
+
| 3 rules, ESLint | 7.53 s | 6.64 s | 1,416 MB |
|
|
60
|
+
|
|
61
|
+
Results for the React slide app:
|
|
62
|
+
|
|
63
|
+
| Rules and tool | Cold | Warm | Memory |
|
|
64
|
+
| ---------------------------------- | ------: | ------: | -------: |
|
|
65
|
+
| No rules, oxlint | 0.17 s | 0.06 s | 107 MB |
|
|
66
|
+
| No rules, ESLint | 7.69 s | 6.95 s | 1,700 MB |
|
|
67
|
+
| 2 TanStack rules, this package | 3.83 s | 3.81 s | 911 MB |
|
|
68
|
+
| 2 TanStack rules, ESLint | 10.56 s | 9.70 s | 1,799 MB |
|
|
69
|
+
| `no-floating-promises`, tsgolint | 1.04 s | 0.91 s | 697 MB |
|
|
70
|
+
| `no-floating-promises`, ESLint | 8.96 s | 8.29 s | 1,737 MB |
|
|
71
|
+
| 3 rules, this package and tsgolint | 4.79 s | 4.57 s | 1,500 MB |
|
|
72
|
+
| 3 rules, ESLint | 11.00 s | 10.31 s | 1,763 MB |
|
|
73
|
+
|
|
74
|
+
The 2 TanStack rules run 2.5 to 3.6 times faster than on ESLint, with 50 to 60 percent of the memory.
|
|
75
|
+
|
|
76
|
+
When oxlint has a typescript-eslint rule of the same name, run it with tsgolint.
|
|
77
|
+
This package is for running the rules that tsgolint lacks, without ESLint.
|
|
78
|
+
Combined with tsgolint, type information is built twice, once by tsgo and once by tsgolint, and memory grows by that much.
|
|
79
|
+
|
|
80
|
+
## License
|
|
81
|
+
|
|
82
|
+
MIT. The licenses of the bundled original plugins are in `libs/oxlint-typed-rules/LICENSE`.
|
package/dist/drizzle.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as UpstreamPlugin } from "./
|
|
2
|
-
type ConfigName = "all" | "recommended";
|
|
1
|
+
import { t as UpstreamPlugin } from "./index-D1qDt581.mjs";
|
|
2
|
+
export type ConfigName = "all" | "recommended";
|
|
3
3
|
declare const plugin: UpstreamPlugin<ConfigName>;
|
|
4
|
-
export {
|
|
4
|
+
export { plugin as default };
|
|
5
5
|
//# sourceMappingURL=drizzle.d.mts.map
|
package/dist/drizzle.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as __toCommonJS, t as __commonJSMin } from "./rolldown-runtime-DQp2zzRu.mjs";
|
|
2
|
-
import { i as typescript_eslint_utils_exports, r as init_typescript_eslint_utils } from "./typescript-eslint-utils-
|
|
3
|
-
import { n as upstreamPlugin, t as plainRules } from "./upstream-plugin-
|
|
4
|
-
// ../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=
|
|
2
|
+
import { i as typescript_eslint_utils_exports, r as init_typescript_eslint_utils } from "./typescript-eslint-utils-C6OO2FjX.mjs";
|
|
3
|
+
import { n as upstreamPlugin, t as plainRules } from "./upstream-plugin-D4Lz9A1H.mjs";
|
|
4
|
+
// ../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=970a4ab095ef16d6b77ccac81c31e17b85e1423d06ec977b_3a3878621a35e057f79c9286946593fd/node_modules/eslint-plugin-drizzle/package.json
|
|
5
5
|
var require_package = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
6
6
|
module.exports = {
|
|
7
7
|
"name": "eslint-plugin-drizzle",
|
|
@@ -40,7 +40,7 @@ var require_package = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
40
40
|
"peerDependencies": { "eslint": ">=8.0.0" }
|
|
41
41
|
};
|
|
42
42
|
}));
|
|
43
|
-
// ../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=
|
|
43
|
+
// ../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=970a4ab095ef16d6b77ccac81c31e17b85e1423d06ec977b_3a3878621a35e057f79c9286946593fd/node_modules/eslint-plugin-drizzle/src/configs/all.js
|
|
44
44
|
var require_all = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
46
|
exports.default = {
|
|
@@ -56,7 +56,7 @@ var require_all = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
}));
|
|
59
|
-
// ../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=
|
|
59
|
+
// ../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=970a4ab095ef16d6b77ccac81c31e17b85e1423d06ec977b_3a3878621a35e057f79c9286946593fd/node_modules/eslint-plugin-drizzle/src/configs/recommended.js
|
|
60
60
|
var require_recommended = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
61
61
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
62
|
exports.default = {
|
|
@@ -72,7 +72,7 @@ var require_recommended = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
74
|
}));
|
|
75
|
-
// ../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=
|
|
75
|
+
// ../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=970a4ab095ef16d6b77ccac81c31e17b85e1423d06ec977b_3a3878621a35e057f79c9286946593fd/node_modules/eslint-plugin-drizzle/src/utils/ast.js
|
|
76
76
|
var require_ast = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
77
77
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
78
78
|
exports.resolveMemberExpressionPath = void 0;
|
|
@@ -102,7 +102,7 @@ var require_ast = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
102
102
|
};
|
|
103
103
|
exports.resolveMemberExpressionPath = resolveMemberExpressionPath;
|
|
104
104
|
}));
|
|
105
|
-
// ../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=
|
|
105
|
+
// ../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=970a4ab095ef16d6b77ccac81c31e17b85e1423d06ec977b_3a3878621a35e057f79c9286946593fd/node_modules/eslint-plugin-drizzle/src/utils/options.js
|
|
106
106
|
var require_options = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
107
107
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
108
108
|
exports.isDrizzleObj = void 0;
|
|
@@ -126,7 +126,7 @@ var require_options = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
126
126
|
};
|
|
127
127
|
exports.isDrizzleObj = isDrizzleObj;
|
|
128
128
|
}));
|
|
129
|
-
// ../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=
|
|
129
|
+
// ../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=970a4ab095ef16d6b77ccac81c31e17b85e1423d06ec977b_3a3878621a35e057f79c9286946593fd/node_modules/eslint-plugin-drizzle/src/enforce-delete-with-where.js
|
|
130
130
|
var require_enforce_delete_with_where = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
131
131
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
132
132
|
const utils_1 = (init_typescript_eslint_utils(), __toCommonJS(typescript_eslint_utils_exports));
|
|
@@ -162,7 +162,7 @@ var require_enforce_delete_with_where = /* @__PURE__ */ __commonJSMin(((exports)
|
|
|
162
162
|
}
|
|
163
163
|
});
|
|
164
164
|
}));
|
|
165
|
-
// ../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=
|
|
165
|
+
// ../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=970a4ab095ef16d6b77ccac81c31e17b85e1423d06ec977b_3a3878621a35e057f79c9286946593fd/node_modules/eslint-plugin-drizzle/src/enforce-update-with-where.js
|
|
166
166
|
var require_enforce_update_with_where = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
167
167
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
168
168
|
const utils_1 = (init_typescript_eslint_utils(), __toCommonJS(typescript_eslint_utils_exports));
|
|
@@ -198,7 +198,7 @@ var require_enforce_update_with_where = /* @__PURE__ */ __commonJSMin(((exports)
|
|
|
198
198
|
}
|
|
199
199
|
});
|
|
200
200
|
}));
|
|
201
|
-
// src/drizzle.ts
|
|
201
|
+
// src/app/drizzle.ts
|
|
202
202
|
var import_src = (/* @__PURE__ */ __commonJSMin(((exports, module, this$1) => {
|
|
203
203
|
var __importDefault = this$1 && this$1.__importDefault || function(mod) {
|
|
204
204
|
return mod && mod.__esModule ? mod : { "default": mod };
|
package/dist/drizzle.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drizzle.mjs","names":[],"sources":["../../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=970a4ab095ef16d6b77ccac81c31e17b85e1423d06ec977b_db324cd083eb061c53d9564a15258730/node_modules/eslint-plugin-drizzle/package.json","../../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=970a4ab095ef16d6b77ccac81c31e17b85e1423d06ec977b_db324cd083eb061c53d9564a15258730/node_modules/eslint-plugin-drizzle/src/configs/all.js","../../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=970a4ab095ef16d6b77ccac81c31e17b85e1423d06ec977b_db324cd083eb061c53d9564a15258730/node_modules/eslint-plugin-drizzle/src/configs/recommended.js","../../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=970a4ab095ef16d6b77ccac81c31e17b85e1423d06ec977b_db324cd083eb061c53d9564a15258730/node_modules/eslint-plugin-drizzle/src/utils/ast.js","../../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=970a4ab095ef16d6b77ccac81c31e17b85e1423d06ec977b_db324cd083eb061c53d9564a15258730/node_modules/eslint-plugin-drizzle/src/utils/options.js","../../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=970a4ab095ef16d6b77ccac81c31e17b85e1423d06ec977b_db324cd083eb061c53d9564a15258730/node_modules/eslint-plugin-drizzle/src/enforce-delete-with-where.js","../../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=970a4ab095ef16d6b77ccac81c31e17b85e1423d06ec977b_db324cd083eb061c53d9564a15258730/node_modules/eslint-plugin-drizzle/src/enforce-update-with-where.js","../../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=970a4ab095ef16d6b77ccac81c31e17b85e1423d06ec977b_db324cd083eb061c53d9564a15258730/node_modules/eslint-plugin-drizzle/src/index.js","../src/drizzle.ts"],"sourcesContent":["","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = {\n env: {\n es2024: true,\n },\n parserOptions: {\n ecmaVersion: 'latest',\n sourceType: 'module',\n },\n plugins: ['drizzle'],\n rules: {\n 'drizzle/enforce-delete-with-where': 'error',\n 'drizzle/enforce-update-with-where': 'error',\n },\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = {\n env: {\n es2024: true,\n },\n parserOptions: {\n ecmaVersion: 'latest',\n sourceType: 'module',\n },\n plugins: ['drizzle'],\n rules: {\n 'drizzle/enforce-delete-with-where': 'error',\n 'drizzle/enforce-update-with-where': 'error',\n },\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveMemberExpressionPath = void 0;\nconst resolveMemberExpressionPath = (node) => {\n let objectExpression = node.object;\n let fullName = '';\n const addToFullName = (name) => {\n const prefix = fullName ? '.' : '';\n fullName = `${name}${prefix}${fullName}`;\n };\n while (objectExpression) {\n if (objectExpression.type === 'MemberExpression') {\n if (objectExpression.property.type === 'Identifier') {\n addToFullName(objectExpression.property.name);\n }\n objectExpression = objectExpression.object;\n }\n else if (objectExpression.type === 'CallExpression' && objectExpression.callee.type === 'Identifier') {\n addToFullName(`${objectExpression.callee.name}(...)`);\n break;\n }\n else if (objectExpression.type === 'CallExpression' && objectExpression.callee.type === 'MemberExpression') {\n if (objectExpression.callee.property.type === 'Identifier') {\n addToFullName(`${objectExpression.callee.property.name}(...)`);\n }\n objectExpression = objectExpression.callee.object;\n }\n else if (objectExpression.type === 'Identifier') {\n addToFullName(objectExpression.name);\n break;\n }\n else if (objectExpression.type === 'ThisExpression') {\n addToFullName('this');\n break;\n }\n else {\n break;\n }\n }\n return fullName;\n};\nexports.resolveMemberExpressionPath = resolveMemberExpressionPath;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isDrizzleObj = void 0;\nconst isDrizzleObjName = (name, drizzleObjectName) => {\n if (typeof drizzleObjectName === 'string') {\n return name === drizzleObjectName;\n }\n if (Array.isArray(drizzleObjectName)) {\n if (drizzleObjectName.length === 0) {\n return true;\n }\n return drizzleObjectName.includes(name);\n }\n return false;\n};\nconst isDrizzleObj = (node, options) => {\n const drizzleObjectName = options[0].drizzleObjectName;\n if (node.object.type === 'Identifier') {\n return isDrizzleObjName(node.object.name, drizzleObjectName);\n }\n else if (node.object.type === 'MemberExpression' && node.object.property.type === 'Identifier') {\n return isDrizzleObjName(node.object.property.name, drizzleObjectName);\n }\n else if (node.object.type === 'CallExpression') {\n if (node.object.callee.type === 'Identifier') {\n return isDrizzleObjName(node.object.callee.name, drizzleObjectName);\n }\n else if (node.object.callee.type === 'MemberExpression' && node.object.callee.property.type === 'Identifier') {\n return isDrizzleObjName(node.object.callee.property.name, drizzleObjectName);\n }\n }\n return false;\n};\nexports.isDrizzleObj = isDrizzleObj;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utils_1 = require(\"@typescript-eslint/utils\");\nconst ast_1 = require(\"./utils/ast\");\nconst options_1 = require(\"./utils/options\");\nconst createRule = utils_1.ESLintUtils.RuleCreator(() => 'https://github.com/drizzle-team/eslint-plugin-drizzle');\nlet lastNodeName = '';\nconst deleteRule = createRule({\n defaultOptions: [{ drizzleObjectName: [] }],\n name: 'enforce-delete-with-where',\n meta: {\n type: 'problem',\n docs: {\n description: 'Enforce that `delete` method is used with `where` to avoid deleting all the rows in a table.',\n },\n fixable: 'code',\n messages: {\n enforceDeleteWithWhere: \"Without `.where(...)` you will delete all the rows in a table. If you didn't want to do it, please use `{{ drizzleObjName }}.delete(...).where(...)` instead. Otherwise you can ignore this rule here\",\n },\n schema: [{\n type: 'object',\n properties: {\n drizzleObjectName: {\n type: ['string', 'array'],\n },\n },\n additionalProperties: false,\n }],\n },\n create(context, options) {\n return {\n MemberExpression: (node) => {\n if (node.property.type === 'Identifier') {\n if (node.property.name === 'delete' && lastNodeName !== 'where' && (0, options_1.isDrizzleObj)(node, options)) {\n context.report({\n node,\n messageId: 'enforceDeleteWithWhere',\n data: {\n drizzleObjName: (0, ast_1.resolveMemberExpressionPath)(node),\n },\n });\n }\n lastNodeName = node.property.name;\n }\n return;\n },\n };\n },\n});\nexports.default = deleteRule;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utils_1 = require(\"@typescript-eslint/utils\");\nconst ast_1 = require(\"./utils/ast\");\nconst options_1 = require(\"./utils/options\");\nconst createRule = utils_1.ESLintUtils.RuleCreator(() => 'https://github.com/drizzle-team/eslint-plugin-drizzle');\nlet lastNodeName = '';\nconst updateRule = createRule({\n defaultOptions: [{ drizzleObjectName: [] }],\n name: 'enforce-update-with-where',\n meta: {\n type: 'problem',\n docs: {\n description: 'Enforce that `update` method is used with `where` to avoid deleting all the rows in a table.',\n },\n fixable: 'code',\n messages: {\n enforceUpdateWithWhere: \"Without `.where(...)` you will update all the rows in a table. If you didn't want to do it, please use `{{ drizzleObjName }}.update(...).set(...).where(...)` instead. Otherwise you can ignore this rule here\",\n },\n schema: [{\n type: 'object',\n properties: {\n drizzleObjectName: {\n type: ['string', 'array'],\n },\n },\n additionalProperties: false,\n }],\n },\n create(context, options) {\n return {\n MemberExpression: (node) => {\n if (node.property.type === 'Identifier') {\n if (lastNodeName !== 'where'\n && node.property.name === 'set'\n && node.object.type === 'CallExpression'\n && node.object.callee.type === 'MemberExpression'\n && node.object.callee.property.type === 'Identifier'\n && node.object.callee.property.name === 'update'\n && (0, options_1.isDrizzleObj)(node.object.callee, options)) {\n context.report({\n node,\n messageId: 'enforceUpdateWithWhere',\n data: {\n drizzleObjName: (0, ast_1.resolveMemberExpressionPath)(node.object.callee),\n },\n });\n }\n lastNodeName = node.property.name;\n }\n return;\n },\n };\n },\n});\nexports.default = updateRule;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.meta = exports.configs = exports.rules = void 0;\nconst package_json_1 = require(\"../package.json\");\nconst all_1 = __importDefault(require(\"./configs/all\"));\nconst recommended_1 = __importDefault(require(\"./configs/recommended\"));\nconst enforce_delete_with_where_1 = __importDefault(require(\"./enforce-delete-with-where\"));\nconst enforce_update_with_where_1 = __importDefault(require(\"./enforce-update-with-where\"));\nexports.rules = {\n 'enforce-delete-with-where': enforce_delete_with_where_1.default,\n 'enforce-update-with-where': enforce_update_with_where_1.default,\n};\nexports.configs = { all: all_1.default, recommended: recommended_1.default };\nexports.meta = { name: package_json_1.name, version: package_json_1.version };\n","import { configs, rules } from \"eslint-plugin-drizzle\";\n\nimport { plainRules, upstreamPlugin } from \"./upstream-plugin.ts\";\nimport type { UpstreamPlugin } from \"./upstream-plugin.ts\";\n\ntype ConfigName = \"all\" | \"recommended\";\n\nconst plugin: UpstreamPlugin<ConfigName> = upstreamPlugin(\n \"drizzle\",\n { configs, rules },\n plainRules,\n);\n\nexport type { ConfigName };\nexport default plugin;\n"],"ignoreList":[0,1,2,3,4,5,6,7],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CCCA,OAAO,eAAe,SAAS,cAAc,EAAE,OAAO,KAAK,CAAC;CAC5D,QAAQ,UAAU;EACd,KAAK,EACD,QAAQ,KACZ;EACA,eAAe;GACX,aAAa;GACb,YAAY;EAChB;EACA,SAAS,CAAC,SAAS;EACnB,OAAO;GACH,qCAAqC;GACrC,qCAAqC;EACzC;CACJ;;;;CCdA,OAAO,eAAe,SAAS,cAAc,EAAE,OAAO,KAAK,C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AiB,GAAG,MAAM,4BAAA,CAA6B,KAAK,OAAO,MAAM,EAC7E;KACJ,CAAC;KAEL,eAAe,KAAK,SAAS;IACjC;GAEJ,EACJ;EACJ;CACJ,CACkB;;;;CCtDlB,IAAI,kBAAA,UAAA,OAAgC,mBAAoB,SAAU,KAAK;EACnE,OAAQ,OAAO,IAAI,aAAc,MAAM,EAAE,WAAW,IAAI;CAC5D;CACA,OAAO,eAAe,SAAS,cAAc,EAAE,OAAO,KAAK,CAAC;CAC5D,QAAQ,OAAO,QAAQ,UAAU,QAAQ,QAAQ,KAAK;CACtD,MAAM,iBAAA,gBAAA;CACN,MAAM,QAAQ,gBAAA,YAAA,CAAwC;CACtD,MAAM,gBAAgB,gBAAA,oBAAA,CAAgD;CACtE,MAAM,8BAA8B,gBAAA,kCAAA,CAAsD;CAC1F,MAAM,8BAA8B,gBAAA,kCAAA,CAAsD;CAC1F,QAAQ,QAAQ;EACZ,6BAA6B,4BAA4B;EACzD,6BAA6B,4BAA4B;CAC7D;CACA,QAAQ,UAAU;EAAE,KAAK,MAAM;EAAS,aAAa,cAAc;CAAQ;CAC3E,QAAQ,OAAO;EAAE,MAAM,eAAe;EAAM,SAAS,eAAe;CAAQ;;ACT5E,MAAM,SAAqC,eACzC,WACA;CAAE,SAAA,WAAA;CAAS,OAAA,WAAA;AAAM,GACjB,UACF"}
|
|
1
|
+
{"version":3,"file":"drizzle.mjs","names":[],"sources":["../../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=970a4ab095ef16d6b77ccac81c31e17b85e1423d06ec977b_3a3878621a35e057f79c9286946593fd/node_modules/eslint-plugin-drizzle/package.json","../../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=970a4ab095ef16d6b77ccac81c31e17b85e1423d06ec977b_3a3878621a35e057f79c9286946593fd/node_modules/eslint-plugin-drizzle/src/configs/all.js","../../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=970a4ab095ef16d6b77ccac81c31e17b85e1423d06ec977b_3a3878621a35e057f79c9286946593fd/node_modules/eslint-plugin-drizzle/src/configs/recommended.js","../../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=970a4ab095ef16d6b77ccac81c31e17b85e1423d06ec977b_3a3878621a35e057f79c9286946593fd/node_modules/eslint-plugin-drizzle/src/utils/ast.js","../../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=970a4ab095ef16d6b77ccac81c31e17b85e1423d06ec977b_3a3878621a35e057f79c9286946593fd/node_modules/eslint-plugin-drizzle/src/utils/options.js","../../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=970a4ab095ef16d6b77ccac81c31e17b85e1423d06ec977b_3a3878621a35e057f79c9286946593fd/node_modules/eslint-plugin-drizzle/src/enforce-delete-with-where.js","../../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=970a4ab095ef16d6b77ccac81c31e17b85e1423d06ec977b_3a3878621a35e057f79c9286946593fd/node_modules/eslint-plugin-drizzle/src/enforce-update-with-where.js","../../../node_modules/.pnpm/eslint-plugin-drizzle@0.2.3_patch_hash=970a4ab095ef16d6b77ccac81c31e17b85e1423d06ec977b_3a3878621a35e057f79c9286946593fd/node_modules/eslint-plugin-drizzle/src/index.js","../src/app/drizzle.ts"],"sourcesContent":["","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = {\n env: {\n es2024: true,\n },\n parserOptions: {\n ecmaVersion: 'latest',\n sourceType: 'module',\n },\n plugins: ['drizzle'],\n rules: {\n 'drizzle/enforce-delete-with-where': 'error',\n 'drizzle/enforce-update-with-where': 'error',\n },\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = {\n env: {\n es2024: true,\n },\n parserOptions: {\n ecmaVersion: 'latest',\n sourceType: 'module',\n },\n plugins: ['drizzle'],\n rules: {\n 'drizzle/enforce-delete-with-where': 'error',\n 'drizzle/enforce-update-with-where': 'error',\n },\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveMemberExpressionPath = void 0;\nconst resolveMemberExpressionPath = (node) => {\n let objectExpression = node.object;\n let fullName = '';\n const addToFullName = (name) => {\n const prefix = fullName ? '.' : '';\n fullName = `${name}${prefix}${fullName}`;\n };\n while (objectExpression) {\n if (objectExpression.type === 'MemberExpression') {\n if (objectExpression.property.type === 'Identifier') {\n addToFullName(objectExpression.property.name);\n }\n objectExpression = objectExpression.object;\n }\n else if (objectExpression.type === 'CallExpression' && objectExpression.callee.type === 'Identifier') {\n addToFullName(`${objectExpression.callee.name}(...)`);\n break;\n }\n else if (objectExpression.type === 'CallExpression' && objectExpression.callee.type === 'MemberExpression') {\n if (objectExpression.callee.property.type === 'Identifier') {\n addToFullName(`${objectExpression.callee.property.name}(...)`);\n }\n objectExpression = objectExpression.callee.object;\n }\n else if (objectExpression.type === 'Identifier') {\n addToFullName(objectExpression.name);\n break;\n }\n else if (objectExpression.type === 'ThisExpression') {\n addToFullName('this');\n break;\n }\n else {\n break;\n }\n }\n return fullName;\n};\nexports.resolveMemberExpressionPath = resolveMemberExpressionPath;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isDrizzleObj = void 0;\nconst isDrizzleObjName = (name, drizzleObjectName) => {\n if (typeof drizzleObjectName === 'string') {\n return name === drizzleObjectName;\n }\n if (Array.isArray(drizzleObjectName)) {\n if (drizzleObjectName.length === 0) {\n return true;\n }\n return drizzleObjectName.includes(name);\n }\n return false;\n};\nconst isDrizzleObj = (node, options) => {\n const drizzleObjectName = options[0].drizzleObjectName;\n if (node.object.type === 'Identifier') {\n return isDrizzleObjName(node.object.name, drizzleObjectName);\n }\n else if (node.object.type === 'MemberExpression' && node.object.property.type === 'Identifier') {\n return isDrizzleObjName(node.object.property.name, drizzleObjectName);\n }\n else if (node.object.type === 'CallExpression') {\n if (node.object.callee.type === 'Identifier') {\n return isDrizzleObjName(node.object.callee.name, drizzleObjectName);\n }\n else if (node.object.callee.type === 'MemberExpression' && node.object.callee.property.type === 'Identifier') {\n return isDrizzleObjName(node.object.callee.property.name, drizzleObjectName);\n }\n }\n return false;\n};\nexports.isDrizzleObj = isDrizzleObj;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utils_1 = require(\"@typescript-eslint/utils\");\nconst ast_1 = require(\"./utils/ast\");\nconst options_1 = require(\"./utils/options\");\nconst createRule = utils_1.ESLintUtils.RuleCreator(() => 'https://github.com/drizzle-team/eslint-plugin-drizzle');\nlet lastNodeName = '';\nconst deleteRule = createRule({\n defaultOptions: [{ drizzleObjectName: [] }],\n name: 'enforce-delete-with-where',\n meta: {\n type: 'problem',\n docs: {\n description: 'Enforce that `delete` method is used with `where` to avoid deleting all the rows in a table.',\n },\n fixable: 'code',\n messages: {\n enforceDeleteWithWhere: \"Without `.where(...)` you will delete all the rows in a table. If you didn't want to do it, please use `{{ drizzleObjName }}.delete(...).where(...)` instead. Otherwise you can ignore this rule here\",\n },\n schema: [{\n type: 'object',\n properties: {\n drizzleObjectName: {\n type: ['string', 'array'],\n },\n },\n additionalProperties: false,\n }],\n },\n create(context, options) {\n return {\n MemberExpression: (node) => {\n if (node.property.type === 'Identifier') {\n if (node.property.name === 'delete' && lastNodeName !== 'where' && (0, options_1.isDrizzleObj)(node, options)) {\n context.report({\n node,\n messageId: 'enforceDeleteWithWhere',\n data: {\n drizzleObjName: (0, ast_1.resolveMemberExpressionPath)(node),\n },\n });\n }\n lastNodeName = node.property.name;\n }\n return;\n },\n };\n },\n});\nexports.default = deleteRule;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utils_1 = require(\"@typescript-eslint/utils\");\nconst ast_1 = require(\"./utils/ast\");\nconst options_1 = require(\"./utils/options\");\nconst createRule = utils_1.ESLintUtils.RuleCreator(() => 'https://github.com/drizzle-team/eslint-plugin-drizzle');\nlet lastNodeName = '';\nconst updateRule = createRule({\n defaultOptions: [{ drizzleObjectName: [] }],\n name: 'enforce-update-with-where',\n meta: {\n type: 'problem',\n docs: {\n description: 'Enforce that `update` method is used with `where` to avoid deleting all the rows in a table.',\n },\n fixable: 'code',\n messages: {\n enforceUpdateWithWhere: \"Without `.where(...)` you will update all the rows in a table. If you didn't want to do it, please use `{{ drizzleObjName }}.update(...).set(...).where(...)` instead. Otherwise you can ignore this rule here\",\n },\n schema: [{\n type: 'object',\n properties: {\n drizzleObjectName: {\n type: ['string', 'array'],\n },\n },\n additionalProperties: false,\n }],\n },\n create(context, options) {\n return {\n MemberExpression: (node) => {\n if (node.property.type === 'Identifier') {\n if (lastNodeName !== 'where'\n && node.property.name === 'set'\n && node.object.type === 'CallExpression'\n && node.object.callee.type === 'MemberExpression'\n && node.object.callee.property.type === 'Identifier'\n && node.object.callee.property.name === 'update'\n && (0, options_1.isDrizzleObj)(node.object.callee, options)) {\n context.report({\n node,\n messageId: 'enforceUpdateWithWhere',\n data: {\n drizzleObjName: (0, ast_1.resolveMemberExpressionPath)(node.object.callee),\n },\n });\n }\n lastNodeName = node.property.name;\n }\n return;\n },\n };\n },\n});\nexports.default = updateRule;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.meta = exports.configs = exports.rules = void 0;\nconst package_json_1 = require(\"../package.json\");\nconst all_1 = __importDefault(require(\"./configs/all\"));\nconst recommended_1 = __importDefault(require(\"./configs/recommended\"));\nconst enforce_delete_with_where_1 = __importDefault(require(\"./enforce-delete-with-where\"));\nconst enforce_update_with_where_1 = __importDefault(require(\"./enforce-update-with-where\"));\nexports.rules = {\n 'enforce-delete-with-where': enforce_delete_with_where_1.default,\n 'enforce-update-with-where': enforce_update_with_where_1.default,\n};\nexports.configs = { all: all_1.default, recommended: recommended_1.default };\nexports.meta = { name: package_json_1.name, version: package_json_1.version };\n","import { configs, rules } from \"eslint-plugin-drizzle\";\n\nimport { plainRules, upstreamPlugin } from \"#/entities/upstream-plugin/index.ts\";\nimport type { UpstreamPlugin } from \"#/entities/upstream-plugin/index.ts\";\n\nexport type ConfigName = \"all\" | \"recommended\";\n\nconst plugin: UpstreamPlugin<ConfigName> = upstreamPlugin(\n \"drizzle\",\n { configs, rules },\n plainRules,\n);\n\nexport default plugin;\n"],"ignoreList":[0,1,2,3,4,5,6,7],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CCCA,OAAO,eAAe,SAAS,cAAc,EAAE,OAAO,KAAK,CAAC;CAC5D,QAAQ,UAAU;EACd,KAAK,EACD,QAAQ,KACZ;EACA,eAAe;GACX,aAAa;GACb,YAAY;EAChB;EACA,SAAS,CAAC,SAAS;EACnB,OAAO;GACH,qCAAqC;GACrC,qCAAqC;EACzC;CACJ;;;;CCdA,OAAO,eAAe,SAAS,cAAc,EAAE,OAAO,KAAK,CAAC;CAC5D,QAAQ,UAAU;EACd,KAAK,EACD,QAAQ,KACZ;EACA,eAAe;GACX,aAAa;GACb,YAAY;EAChB;EACA,SAAS,CAAC,SAAS;EACnB,OAAO;GACH,qCAAqC;GACrC,qCAAqC;EACzC;CACJ;;;;CCdA,OAAO,eAAe,SAAS,cAAc,EAAE,OAAO,KAAK,CAAC;CAC5D,QAAQ,8BAA8B,KAAK;CAC3C,MAAM,+BAA+B,SAAS;EAC1C,IAAI,mBAAmB,KAAK;EAC5B,IAAI,WAAW;EACf,MAAM,iBAAiB,SAAS;GAE5B,WAAW,GAAG,OADC,WAAW,MAAM,KACF;EAClC;EACA,OAAO,kBACH,IAAI,iBAAiB,SAAS,oBAAoB;GAC9C,IAAI,iBAAiB,SAAS,SAAS,cACnC,cAAc,iBAAiB,SAAS,IAAI;GAEhD,mBAAmB,iBAAiB;EACxC,OACK,IAAI,iBAAiB,SAAS,oBAAoB,iBAAiB,OAAO,SAAS,cAAc;GAClG,cAAc,GAAG,iBAAiB,OAAO,KAAK,MAAM;GACpD;EAC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MAAM;EAAS,aAAa,cAAc;CAAQ;CAC3E,QAAQ,OAAO;EAAE,MAAM,eAAe;EAAM,SAAS,eAAe;CAAQ;;ACT5E,MAAM,SAAqC,eACzC,WACA;CAAE,SAAA,WAAA;CAAS,OAAA,WAAA;AAAM,GACjB,UACF"}
|
|
@@ -294,7 +294,7 @@ var require_dist = /* @__PURE__ */ __commonJSMin(((exports, module, this$2) => {
|
|
|
294
294
|
__exportStar(require_parser_options(), exports);
|
|
295
295
|
__exportStar(require_ts_estree(), exports);
|
|
296
296
|
}));
|
|
297
|
-
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.72.2_eslint@10.
|
|
297
|
+
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.72.2_eslint@10.15.0_jiti@2.7.0_supports-color@10.2.2__suppor_1179acb31aa1bc253083a3b2e55154db/node_modules/@typescript-eslint/utils/dist/eslint-utils/deepMerge.js
|
|
298
298
|
var require_deepMerge = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
299
299
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
300
300
|
exports.isObjectNotArray = isObjectNotArray;
|
|
@@ -330,7 +330,7 @@ var require_deepMerge = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
330
330
|
}));
|
|
331
331
|
}
|
|
332
332
|
}));
|
|
333
|
-
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.72.2_eslint@10.
|
|
333
|
+
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.72.2_eslint@10.15.0_jiti@2.7.0_supports-color@10.2.2__suppor_1179acb31aa1bc253083a3b2e55154db/node_modules/@typescript-eslint/utils/dist/eslint-utils/applyDefault.js
|
|
334
334
|
var require_applyDefault = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
335
335
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
336
336
|
exports.applyDefault = applyDefault;
|
|
@@ -355,7 +355,7 @@ var require_applyDefault = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
355
355
|
return options;
|
|
356
356
|
}
|
|
357
357
|
}));
|
|
358
|
-
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.72.2_eslint@10.
|
|
358
|
+
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.72.2_eslint@10.15.0_jiti@2.7.0_supports-color@10.2.2__suppor_1179acb31aa1bc253083a3b2e55154db/node_modules/@typescript-eslint/utils/dist/eslint-utils/parserSeemsToBeTSESLint.js
|
|
359
359
|
var require_parserSeemsToBeTSESLint = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
360
360
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
361
361
|
exports.parserSeemsToBeTSESLint = parserSeemsToBeTSESLint;
|
|
@@ -363,7 +363,7 @@ var require_parserSeemsToBeTSESLint = /* @__PURE__ */ __commonJSMin(((exports) =
|
|
|
363
363
|
return !!parser && /(?:typescript-eslint|\.\.)[\w/\\]*parser/.test(parser);
|
|
364
364
|
}
|
|
365
365
|
}));
|
|
366
|
-
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.72.2_eslint@10.
|
|
366
|
+
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.72.2_eslint@10.15.0_jiti@2.7.0_supports-color@10.2.2__suppor_1179acb31aa1bc253083a3b2e55154db/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js
|
|
367
367
|
var require_getParserServices = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
368
368
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
369
369
|
exports.getParserServices = getParserServices;
|
|
@@ -385,11 +385,11 @@ var require_getParserServices = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
385
385
|
throw new Error(messages.join("\n"));
|
|
386
386
|
}
|
|
387
387
|
}));
|
|
388
|
-
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.72.2_eslint@10.
|
|
388
|
+
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.72.2_eslint@10.15.0_jiti@2.7.0_supports-color@10.2.2__suppor_1179acb31aa1bc253083a3b2e55154db/node_modules/@typescript-eslint/utils/dist/eslint-utils/InferTypesFromRule.js
|
|
389
389
|
var require_InferTypesFromRule = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
390
390
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
391
391
|
}));
|
|
392
|
-
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.72.2_eslint@10.
|
|
392
|
+
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.72.2_eslint@10.15.0_jiti@2.7.0_supports-color@10.2.2__suppor_1179acb31aa1bc253083a3b2e55154db/node_modules/@typescript-eslint/utils/dist/eslint-utils/nullThrows.js
|
|
393
393
|
var require_nullThrows = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
394
394
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
395
395
|
exports.NullThrowsReasons = void 0;
|
|
@@ -410,7 +410,7 @@ var require_nullThrows = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
410
410
|
return value;
|
|
411
411
|
}
|
|
412
412
|
}));
|
|
413
|
-
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.72.2_eslint@10.
|
|
413
|
+
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.72.2_eslint@10.15.0_jiti@2.7.0_supports-color@10.2.2__suppor_1179acb31aa1bc253083a3b2e55154db/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js
|
|
414
414
|
var require_RuleCreator = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
415
415
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
416
416
|
exports.RuleCreator = RuleCreator;
|
|
@@ -457,7 +457,7 @@ var require_RuleCreator = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
457
457
|
return createRule(args);
|
|
458
458
|
};
|
|
459
459
|
}));
|
|
460
|
-
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.72.2_eslint@10.
|
|
460
|
+
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.72.2_eslint@10.15.0_jiti@2.7.0_supports-color@10.2.2__suppor_1179acb31aa1bc253083a3b2e55154db/node_modules/@typescript-eslint/utils/dist/eslint-utils/index.js
|
|
461
461
|
var require_eslint_utils = /* @__PURE__ */ __commonJSMin(((exports, module, this$1) => {
|
|
462
462
|
var __createBinding = this$1 && this$1.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
463
463
|
if (k2 === void 0) k2 = k;
|
|
@@ -486,4 +486,4 @@ var require_eslint_utils = /* @__PURE__ */ __commonJSMin(((exports, module, this
|
|
|
486
486
|
}));
|
|
487
487
|
export { require_dist as n, require_eslint_utils as t };
|
|
488
488
|
|
|
489
|
-
//# sourceMappingURL=eslint-utils-
|
|
489
|
+
//# sourceMappingURL=eslint-utils-ujGlgEMD.mjs.map
|