@wolfstar/eslint-plugin-http-framework 0.1.0-next-20260904160000

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/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2022 Wolfstar Project
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,84 @@
1
+ <div align="center">
2
+ <picture>
3
+ <img src="https://cdn.wolfstar.rocks/assets/stars-components/wordmark.webp" alt="Stars Components" width="440" />
4
+ </picture>
5
+
6
+ # @wolfstar/eslint-plugin-http-framework
7
+
8
+ **Custom lint rules for `@wolfstar/http-framework` and the `@wolfstar/plugin-*` ecosystem.**
9
+
10
+ [![version](https://npmx.dev/api/registry/badge/version/@wolfstar/eslint-plugin-http-framework)](https://npmx.dev/package/@wolfstar/eslint-plugin-http-framework)
11
+ [![downloads](https://npmx.dev/api/registry/badge/downloads/@wolfstar/eslint-plugin-http-framework)](https://npmx.dev/package/@wolfstar/eslint-plugin-http-framework)
12
+ [![license](https://img.shields.io/github/license/wolfstar-project/stars-components?style=flat-square&color=informational)](https://github.com/wolfstar-project/stars-components/blob/main/LICENSE)
13
+
14
+ </div>
15
+
16
+ ## Description
17
+
18
+ A plugin catching misuse of `@wolfstar/http-framework` decorators and the `@wolfstar/plugin-*` ecosystem that TypeScript can't catch on its own. Each rule is grounded in a real trap documented or found in this framework's own source — see the doc block of each rule under [`src/rules`](./src/rules).
19
+
20
+ The plugin object is the standard ESLint plugin shape (`{ meta, rules: { name: { meta, create(context) {...} } } }`), which oxlint's JS plugin API is compatible with. One implementation, usable from both tools.
21
+
22
+ ## Rules
23
+
24
+ | Rule | Description |
25
+ | -------------------------------------------- | --------------------------------------------------------------------------------------------------- |
26
+ | `wolfstar/apply-options-decorator-order` | `@ApplyOptions` must be the outermost decorator, above registration decorators |
27
+ | `wolfstar/require-subcommand-parent` | `@RegisterSubcommand`/`@RegisterSubcommandGroup` requires `@RegisterCommand` on the same class |
28
+ | `wolfstar/no-raw-discord-fetch` | ban calling the Discord API directly instead of `container.rest` |
29
+ | `wolfstar/no-dynamic-translation-key` | i18next translation keys must be string literals |
30
+ | `wolfstar/prefer-apply-localized-builder` | use `applyLocalizedBuilder` instead of raw `setName`/`setDescription` in i18n modules |
31
+ | `wolfstar/no-hoisted-plugin-register-import` | a static `@wolfstar/plugin-*/register` import must not be hoisted above the module's own hook setup |
32
+ | `wolfstar/no-deprecated-i18n-package` | ban imports of the deprecated `@wolfstar/http-framework-i18n` |
33
+
34
+ Not covered (would need cross-file/directory scanning, higher false-positive risk, left as future work): a piece registered via `container.stores.loadPiece(...)` that's never imported by its directory's `_load.ts`, and a piece class that's never registered at all.
35
+
36
+ ## Installation
37
+
38
+ ```bash
39
+ pnpm add -D @wolfstar/eslint-plugin-http-framework
40
+ ```
41
+
42
+ ## Usage
43
+
44
+ ### With `@wolfstar/eslint-config`
45
+
46
+ Already wired in — `createConfig()` enables every rule as `error`.
47
+
48
+ ### Standalone, with ESLint
49
+
50
+ ```typescript
51
+ import wolfstar, { recommendedRules } from '@wolfstar/eslint-plugin-http-framework';
52
+
53
+ export default [
54
+ {
55
+ plugins: { wolfstar },
56
+ rules: recommendedRules
57
+ }
58
+ ];
59
+ ```
60
+
61
+ ### Standalone, with oxlint
62
+
63
+ ```json
64
+ {
65
+ "jsPlugins": ["@wolfstar/eslint-plugin-http-framework"],
66
+ "rules": {
67
+ "wolfstar/apply-options-decorator-order": "error",
68
+ "wolfstar/require-subcommand-parent": "error",
69
+ "wolfstar/no-raw-discord-fetch": "error",
70
+ "wolfstar/no-dynamic-translation-key": "error",
71
+ "wolfstar/prefer-apply-localized-builder": "error",
72
+ "wolfstar/no-hoisted-plugin-register-import": "error",
73
+ "wolfstar/no-deprecated-i18n-package": "error"
74
+ }
75
+ }
76
+ ```
77
+
78
+ ## Buy us some doughnuts
79
+
80
+ Star Network is open source and always will be, even if we don't get donations. That being said, we know there are amazing people who may still want to donate just to show their appreciation. Thank you very much in advance!
81
+
82
+ ## License
83
+
84
+ Apache-2.0
@@ -0,0 +1,87 @@
1
+ import { Rule } from "eslint";
2
+ //#region src/rules/apply-options-decorator-order.d.ts
3
+ /**
4
+ * Requires `@ApplyOptions` to be the outermost decorator of a piece class.
5
+ *
6
+ * `ApplyOptions` wraps the class in a `Proxy`; a decorator applied above it (and therefore evaluated after it) receives
7
+ * that proxy instead of the class the framework constructs instances from, so the registration silently never resolves.
8
+ */
9
+ declare const rule: Rule.RuleModule;
10
+ //#endregion
11
+ //#region src/rules/no-deprecated-i18n-package.d.ts
12
+ /**
13
+ * Bans imports of the deprecated `@wolfstar/http-framework-i18n` package.
14
+ *
15
+ * `@wolfstar/plugin-i18next` is the supported i18n integration; the legacy package no longer receives snapshots and its
16
+ * helper set has drifted from the plugin's.
17
+ */
18
+ declare const rule$1: Rule.RuleModule;
19
+ //#endregion
20
+ //#region src/rules/no-dynamic-translation-key.d.ts
21
+ /**
22
+ * Requires translation keys to be written as string literals.
23
+ *
24
+ * Keys are typed through the `CustomTypeOptions` augmentation generated by `@wolfstar/i18next-type-generator`; a
25
+ * dynamically built key silently opts out of that type checking, so a typo or a removed key only surfaces at runtime.
26
+ */
27
+ declare const rule$2: Rule.RuleModule;
28
+ //#endregion
29
+ //#region src/rules/no-hoisted-plugin-register-import.d.ts
30
+ /**
31
+ * Bans statically importing a `@wolfstar/plugin-*` register entrypoint from a module that also registers its own plugin
32
+ * hooks.
33
+ *
34
+ * Static imports are hoisted above the hook registrations in the same module, so the plugin's own hook registers — and
35
+ * runs — before the module's, which silently loses whatever the module wanted to contribute (locale paths, options).
36
+ * Use a dynamic `await import(...)` of the plugin's register entrypoint after the hook registration instead.
37
+ */
38
+ declare const rule$3: Rule.RuleModule;
39
+ //#endregion
40
+ //#region src/rules/no-raw-discord-fetch.d.ts
41
+ /**
42
+ * Bans calling the Discord HTTP API directly instead of going through the framework's shared REST client.
43
+ *
44
+ * `@wolfstar/http-framework` routes every Discord request through `container.rest`, which carries the bot token,
45
+ * rate-limit handling and instrumentation. A hand-rolled `fetch` bypasses all of it.
46
+ */
47
+ declare const rule$4: Rule.RuleModule;
48
+ //#endregion
49
+ //#region src/rules/prefer-apply-localized-builder.d.ts
50
+ /**
51
+ * Requires localized command builders in i18n-enabled modules to go through `applyLocalizedBuilder`.
52
+ *
53
+ * Calling `setName`/`setDescription` by hand inside a registration decorator hardcodes English strings and skips the
54
+ * localization map the plugin would otherwise attach, so the command shows up untranslated for every locale.
55
+ */
56
+ declare const rule$5: Rule.RuleModule;
57
+ //#endregion
58
+ //#region src/rules/require-subcommand-parent.d.ts
59
+ /**
60
+ * Requires classes using `@RegisterSubcommand` or `@RegisterSubcommandGroup` to also carry `@RegisterCommand`.
61
+ *
62
+ * Subcommand decorators attach to the chat input command resolver of their own class; without a parent
63
+ * `@RegisterCommand` there is no command for them to attach to and the subcommands never get registered.
64
+ */
65
+ declare const rule$6: Rule.RuleModule;
66
+ //#endregion
67
+ //#region src/index.d.ts
68
+ interface WolfstarPlugin {
69
+ meta: {
70
+ name: string;
71
+ };
72
+ rules: Record<string, Rule.RuleModule>;
73
+ }
74
+ /**
75
+ * The `wolfstar` lint plugin: custom rules for `@wolfstar/http-framework` and the `@wolfstar/plugin-*` ecosystem.
76
+ *
77
+ * The shape is the ESLint plugin shape, which oxlint's JS plugin API is compatible with, so the same object works as an
78
+ * ESLint flat-config plugin and as an entry in oxlint's `jsPlugins`.
79
+ */
80
+ declare const plugin: WolfstarPlugin;
81
+ /**
82
+ * Every rule of the plugin set to `'error'`, ready to be spread into an ESLint or oxlint `rules` block.
83
+ */
84
+ declare const recommendedRules: Record<string, 'error'>;
85
+ //#endregion
86
+ export { WolfstarPlugin, rule as applyOptionsDecoratorOrder, plugin as default, rule$1 as noDeprecatedI18nPackage, rule$2 as noDynamicTranslationKey, rule$3 as noHoistedPluginRegisterImport, rule$4 as noRawDiscordFetch, rule$5 as preferApplyLocalizedBuilder, recommendedRules, rule$6 as requireSubcommandParent };
87
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/rules/apply-options-decorator-order.ts","../../src/rules/no-deprecated-i18n-package.ts","../../src/rules/no-dynamic-translation-key.ts","../../src/rules/no-hoisted-plugin-register-import.ts","../../src/rules/no-raw-discord-fetch.ts","../../src/rules/prefer-apply-localized-builder.ts","../../src/rules/require-subcommand-parent.ts","../../src/index.ts"],"mappings":";;;;;;;;cAsBM,MAAM,KAAK;;;;;;;;;cCXX,QAAM,KAAK;;;;;;;;;cCoBX,QAAM,KAAK;;;;;;;;;;;cCXX,QAAM,KAAK;;;;;;;;;cCWX,QAAM,KAAK;;;;;;;;;cClBX,QAAM,KAAK;;;;;;;;;cCDX,QAAM,KAAK;;;UCHA;EAChB;IAAQ;;EACR,OAAO,eAAe,KAAK;;;;;;;;cAStB,QAAQ;;;;cAgBD,kBAAkB"}
@@ -0,0 +1,493 @@
1
+ //#region src/utils.ts
2
+ /**
3
+ * Reads the decorator list of a class-like node, tolerating parsers that omit the property entirely.
4
+ *
5
+ * @param node - The class node to read the decorators from.
6
+ * @returns The decorators attached to the class, or an empty array when there are none.
7
+ *
8
+ * @internal
9
+ */
10
+ function getDecorators(node) {
11
+ const decorators = node.decorators;
12
+ return Array.isArray(decorators) ? decorators : [];
13
+ }
14
+ /**
15
+ * Resolves the name of the function a decorator refers to, whether it is called (`@Foo()`) or bare (`@Foo`).
16
+ *
17
+ * @param decorator - The decorator node to read.
18
+ * @returns The decorator name, or `null` when it cannot be determined statically.
19
+ *
20
+ * @internal
21
+ */
22
+ function getDecoratorName(decorator) {
23
+ const { expression } = decorator;
24
+ if (expression.type === "CallExpression") return expression.callee?.type === "Identifier" ? expression.callee.name ?? null : null;
25
+ return expression.type === "Identifier" ? expression.name ?? null : null;
26
+ }
27
+ /**
28
+ * Finds the index of the first decorator whose name is part of {@link names}.
29
+ *
30
+ * @param decorators - The decorator list to search.
31
+ * @param names - The decorator names to look for.
32
+ * @returns The index of the matching decorator, or `-1` when none matches.
33
+ *
34
+ * @internal
35
+ */
36
+ function findDecoratorIndex(decorators, names) {
37
+ return decorators.findIndex((decorator) => {
38
+ const name = getDecoratorName(decorator);
39
+ return name !== null && names.includes(name);
40
+ });
41
+ }
42
+
43
+ //#endregion
44
+ //#region src/rules/apply-options-decorator-order.ts
45
+ /**
46
+ * Decorators that key their bookkeeping on the class identity, and therefore must run on the real class rather than on
47
+ * the `Proxy` returned by `ApplyOptions`.
48
+ */
49
+ const identityKeyedDecorators = [
50
+ "RegisterCommand",
51
+ "RegisterSubcommand",
52
+ "RegisterSubcommandGroup",
53
+ "RegisterUserCommand",
54
+ "RegisterMessageCommand",
55
+ "RestrictGuildIds"
56
+ ];
57
+ /**
58
+ * Requires `@ApplyOptions` to be the outermost decorator of a piece class.
59
+ *
60
+ * `ApplyOptions` wraps the class in a `Proxy`; a decorator applied above it (and therefore evaluated after it) receives
61
+ * that proxy instead of the class the framework constructs instances from, so the registration silently never resolves.
62
+ */
63
+ const rule = {
64
+ meta: {
65
+ type: "problem",
66
+ docs: {
67
+ description: "require `@ApplyOptions` to be the outermost decorator, above registration decorators",
68
+ recommended: true
69
+ },
70
+ messages: { wrongOrder: "`@ApplyOptions` must be the outermost decorator, above `@{{decorator}}`. `ApplyOptions` wraps the class in a Proxy, so `@{{decorator}}` would register the proxy instead of the class and the piece would never resolve at runtime." },
71
+ schema: []
72
+ },
73
+ create(context) {
74
+ function check(node) {
75
+ const decorators = getDecorators(node);
76
+ if (decorators.length < 2) return;
77
+ const applyOptionsIndex = findDecoratorIndex(decorators, ["ApplyOptions"]);
78
+ if (applyOptionsIndex <= 0) return;
79
+ const registrationIndex = findDecoratorIndex(decorators, identityKeyedDecorators);
80
+ if (registrationIndex === -1 || registrationIndex > applyOptionsIndex) return;
81
+ const registration = decorators[registrationIndex];
82
+ context.report({
83
+ node: registration,
84
+ messageId: "wrongOrder",
85
+ data: { decorator: getDecoratorName(registration) ?? "RegisterCommand" }
86
+ });
87
+ }
88
+ return {
89
+ ClassDeclaration: check,
90
+ ClassExpression: check
91
+ };
92
+ }
93
+ };
94
+
95
+ //#endregion
96
+ //#region src/rules/no-deprecated-i18n-package.ts
97
+ const deprecated = "@wolfstar/http-framework-i18n";
98
+ const replacement = "@wolfstar/plugin-i18next";
99
+ /**
100
+ * Bans imports of the deprecated `@wolfstar/http-framework-i18n` package.
101
+ *
102
+ * `@wolfstar/plugin-i18next` is the supported i18n integration; the legacy package no longer receives snapshots and its
103
+ * helper set has drifted from the plugin's.
104
+ */
105
+ const rule$1 = {
106
+ meta: {
107
+ type: "problem",
108
+ docs: {
109
+ description: "ban imports of the deprecated `@wolfstar/http-framework-i18n` package",
110
+ recommended: true
111
+ },
112
+ messages: { deprecatedPackage: "`{{deprecated}}` is deprecated; use `{{replacement}}` instead." },
113
+ schema: []
114
+ },
115
+ create(context) {
116
+ function report(node, source) {
117
+ if (typeof source !== "string") return;
118
+ if (source !== deprecated && !source.startsWith(`${deprecated}/`)) return;
119
+ context.report({
120
+ node,
121
+ messageId: "deprecatedPackage",
122
+ data: {
123
+ deprecated,
124
+ replacement
125
+ }
126
+ });
127
+ }
128
+ return {
129
+ ImportDeclaration(node) {
130
+ report(node, node.source.value);
131
+ },
132
+ ImportExpression(node) {
133
+ report(node, node.source.value);
134
+ }
135
+ };
136
+ }
137
+ };
138
+
139
+ //#endregion
140
+ //#region src/rules/no-dynamic-translation-key.ts
141
+ const i18nextPackages = ["@wolfstar/plugin-i18next", "@wolfstar/http-framework-i18n"];
142
+ const translateFactories = [
143
+ "getSupportedUserLanguageT",
144
+ "getSupportedLanguageT",
145
+ "fetchT"
146
+ ];
147
+ /**
148
+ * Determines whether a node is a statically known string, i.e. a string literal or a template literal without
149
+ * interpolation.
150
+ *
151
+ * @param node - The node to inspect.
152
+ * @returns Whether the key can be resolved statically.
153
+ */
154
+ function isStaticKey(node) {
155
+ if (!node) return true;
156
+ if (node.type === "Literal") return typeof node.value === "string";
157
+ if (node.type === "TemplateLiteral") return (node.expressions ?? []).length === 0;
158
+ return false;
159
+ }
160
+ /**
161
+ * Requires translation keys to be written as string literals.
162
+ *
163
+ * Keys are typed through the `CustomTypeOptions` augmentation generated by `@wolfstar/i18next-type-generator`; a
164
+ * dynamically built key silently opts out of that type checking, so a typo or a removed key only surfaces at runtime.
165
+ */
166
+ const rule$2 = {
167
+ meta: {
168
+ type: "problem",
169
+ docs: {
170
+ description: "require i18next translation keys to be string literals so generated key types apply",
171
+ recommended: true
172
+ },
173
+ messages: { dynamicKey: "Translation keys must be string literals; a computed key bypasses the generated i18next key types, so typos and removed keys are only caught at runtime." },
174
+ schema: []
175
+ },
176
+ create(context) {
177
+ let importsI18next = false;
178
+ const factoryBindings = /* @__PURE__ */ new Set();
179
+ const translateBindings = /* @__PURE__ */ new Set();
180
+ let localizedBuilderName = null;
181
+ return {
182
+ ImportDeclaration(node) {
183
+ const source = node.source.value;
184
+ if (typeof source !== "string" || !i18nextPackages.includes(source)) return;
185
+ importsI18next = true;
186
+ for (const specifier of node.specifiers) {
187
+ if (specifier.type !== "ImportSpecifier") continue;
188
+ const imported = specifier.imported.name;
189
+ if (imported === "applyLocalizedBuilder") localizedBuilderName = specifier.local.name;
190
+ if (imported !== void 0 && translateFactories.includes(imported)) factoryBindings.add(specifier.local.name);
191
+ }
192
+ },
193
+ VariableDeclarator(node) {
194
+ if (!node.init || node.init.type !== "CallExpression") return;
195
+ const callee = node.init.callee;
196
+ if (callee.type !== "Identifier" || callee.name === void 0) return;
197
+ if (!factoryBindings.has(callee.name)) return;
198
+ if (node.id.type !== "Identifier") return;
199
+ translateBindings.add(node.id.name);
200
+ },
201
+ CallExpression(node) {
202
+ if (!importsI18next) return;
203
+ const callee = node.callee;
204
+ if (callee.type !== "Identifier" || callee.name === void 0) return;
205
+ if (callee.name === localizedBuilderName) {
206
+ for (const argument of node.arguments.slice(1, 3)) if (!isStaticKey(argument)) context.report({
207
+ node: argument,
208
+ messageId: "dynamicKey"
209
+ });
210
+ return;
211
+ }
212
+ if (!translateBindings.has(callee.name)) return;
213
+ const [key] = node.arguments;
214
+ if (key && !isStaticKey(key)) context.report({
215
+ node: key,
216
+ messageId: "dynamicKey"
217
+ });
218
+ }
219
+ };
220
+ }
221
+ };
222
+
223
+ //#endregion
224
+ //#region src/rules/no-hoisted-plugin-register-import.ts
225
+ const registerSuffix = "/register";
226
+ const pluginScope = "@wolfstar/plugin-";
227
+ const hookMethods = [
228
+ "registerPreGenericsInitializationHook",
229
+ "registerPreInitializationHook",
230
+ "registerPostInitializationHook",
231
+ "registerPreLoadHook",
232
+ "registerPostListenHook"
233
+ ];
234
+ /**
235
+ * Bans statically importing a `@wolfstar/plugin-*` register entrypoint from a module that also registers its own plugin
236
+ * hooks.
237
+ *
238
+ * Static imports are hoisted above the hook registrations in the same module, so the plugin's own hook registers — and
239
+ * runs — before the module's, which silently loses whatever the module wanted to contribute (locale paths, options).
240
+ * Use a dynamic `await import(...)` of the plugin's register entrypoint after the hook registration instead.
241
+ */
242
+ const rule$3 = {
243
+ meta: {
244
+ type: "problem",
245
+ docs: {
246
+ description: "ban hoisted `@wolfstar/plugin-*/register` imports in modules that register plugin hooks",
247
+ recommended: true
248
+ },
249
+ messages: { hoistedRegister: "`import '{{source}}'` is hoisted above the hook registration in this module, so the plugin hook runs first and this module's contribution is lost. Use `await import('{{source}}')` after registering the hook." },
250
+ schema: []
251
+ },
252
+ create(context) {
253
+ const staticRegisterImports = [];
254
+ let registersHook = false;
255
+ return {
256
+ ImportDeclaration(node) {
257
+ const source = node.source.value;
258
+ if (typeof source !== "string") return;
259
+ if (!source.startsWith(pluginScope) || !source.endsWith(registerSuffix)) return;
260
+ staticRegisterImports.push({
261
+ node,
262
+ source
263
+ });
264
+ },
265
+ CallExpression(node) {
266
+ const callee = node.callee;
267
+ if (callee.type !== "MemberExpression" || callee.property?.type !== "Identifier") return;
268
+ const name = callee.property.name;
269
+ if (name !== void 0 && hookMethods.includes(name)) registersHook = true;
270
+ },
271
+ "Program:exit"() {
272
+ if (!registersHook) return;
273
+ for (const { node, source } of staticRegisterImports) context.report({
274
+ node,
275
+ messageId: "hoistedRegister",
276
+ data: { source }
277
+ });
278
+ }
279
+ };
280
+ }
281
+ };
282
+
283
+ //#endregion
284
+ //#region src/rules/no-raw-discord-fetch.ts
285
+ const discordHosts = [
286
+ "discord.com/api",
287
+ "discordapp.com/api",
288
+ "ptb.discord.com/api",
289
+ "canary.discord.com/api"
290
+ ];
291
+ /**
292
+ * Reads a static string out of a node, supporting plain literals and template literals without expressions.
293
+ *
294
+ * @param node - The AST node to read.
295
+ * @returns The static string value, or `null` when the node is not statically known.
296
+ */
297
+ function getStaticString(node) {
298
+ if (node.type === "Literal") return typeof node.value === "string" ? node.value : null;
299
+ if (node.type === "TemplateLiteral") return (node.quasis ?? []).map((quasi) => quasi.value.cooked ?? "").join("");
300
+ return null;
301
+ }
302
+ /**
303
+ * Bans calling the Discord HTTP API directly instead of going through the framework's shared REST client.
304
+ *
305
+ * `@wolfstar/http-framework` routes every Discord request through `container.rest`, which carries the bot token,
306
+ * rate-limit handling and instrumentation. A hand-rolled `fetch` bypasses all of it.
307
+ */
308
+ const rule$4 = {
309
+ meta: {
310
+ type: "problem",
311
+ docs: {
312
+ description: "ban direct calls to the Discord HTTP API, use `container.rest` instead",
313
+ recommended: true
314
+ },
315
+ messages: {
316
+ rawFetch: "Do not call the Discord API directly; use `container.rest` so the request keeps the bot token, rate limiting and instrumentation.",
317
+ rawUrl: "Do not hardcode Discord API URLs; use `container.rest` with `Routes` from `discord-api-types/v10`."
318
+ },
319
+ schema: []
320
+ },
321
+ create(context) {
322
+ function isDiscordUrl(value) {
323
+ return discordHosts.some((host) => value.includes(host));
324
+ }
325
+ return {
326
+ CallExpression(node) {
327
+ const callee = node.callee;
328
+ if (callee.type !== "Identifier" || callee.name !== "fetch") return;
329
+ const [first] = node.arguments;
330
+ if (!first) return;
331
+ const value = getStaticString(first);
332
+ if (value !== null && isDiscordUrl(value)) context.report({
333
+ node,
334
+ messageId: "rawFetch"
335
+ });
336
+ },
337
+ Literal(node) {
338
+ const { value } = node;
339
+ if (typeof value === "string" && isDiscordUrl(value)) context.report({
340
+ node,
341
+ messageId: "rawUrl"
342
+ });
343
+ }
344
+ };
345
+ }
346
+ };
347
+
348
+ //#endregion
349
+ //#region src/rules/prefer-apply-localized-builder.ts
350
+ const i18nextPackage = "@wolfstar/plugin-i18next";
351
+ const rawBuilderMethods = [
352
+ "setName",
353
+ "setDescription",
354
+ "setNameLocalizations",
355
+ "setDescriptionLocalizations"
356
+ ];
357
+ const registrationDecorators = [
358
+ "RegisterCommand",
359
+ "RegisterSubcommand",
360
+ "RegisterSubcommandGroup",
361
+ "RegisterUserCommand",
362
+ "RegisterMessageCommand"
363
+ ];
364
+ /**
365
+ * Requires localized command builders in i18n-enabled modules to go through `applyLocalizedBuilder`.
366
+ *
367
+ * Calling `setName`/`setDescription` by hand inside a registration decorator hardcodes English strings and skips the
368
+ * localization map the plugin would otherwise attach, so the command shows up untranslated for every locale.
369
+ */
370
+ const rule$5 = {
371
+ meta: {
372
+ type: "suggestion",
373
+ docs: {
374
+ description: "require `applyLocalizedBuilder` instead of raw `setName`/`setDescription` in i18n modules",
375
+ recommended: true
376
+ },
377
+ messages: { rawBuilder: "Use `applyLocalizedBuilder(builder, key)` instead of `{{method}}` inside `@{{decorator}}`; a raw call hardcodes one language and skips the localization map." },
378
+ schema: []
379
+ },
380
+ create(context) {
381
+ let importsI18next = false;
382
+ const decoratorRanges = [];
383
+ function collectDecoratorRanges(node) {
384
+ for (const decorator of getDecorators(node)) {
385
+ const name = getDecoratorName(decorator);
386
+ if (name === null || !registrationDecorators.includes(name)) continue;
387
+ const range = decorator.range;
388
+ if (!range) continue;
389
+ decoratorRanges.push({
390
+ start: range[0],
391
+ end: range[1],
392
+ decorator: name
393
+ });
394
+ }
395
+ }
396
+ return {
397
+ ImportDeclaration(node) {
398
+ if (node.source.value === i18nextPackage) importsI18next = true;
399
+ },
400
+ ClassDeclaration: collectDecoratorRanges,
401
+ ClassExpression: collectDecoratorRanges,
402
+ "CallExpression:exit"(node) {
403
+ if (!importsI18next) return;
404
+ const callee = node.callee;
405
+ if (callee.type !== "MemberExpression" || callee.property?.type !== "Identifier") return;
406
+ const method = callee.property.name;
407
+ if (method === void 0 || !rawBuilderMethods.includes(method)) return;
408
+ const range = node.range;
409
+ if (!range) return;
410
+ const enclosing = decoratorRanges.find((decorator) => decorator.start <= range[0] && decorator.end >= range[1]);
411
+ if (!enclosing) return;
412
+ context.report({
413
+ node,
414
+ messageId: "rawBuilder",
415
+ data: {
416
+ method,
417
+ decorator: enclosing.decorator
418
+ }
419
+ });
420
+ }
421
+ };
422
+ }
423
+ };
424
+
425
+ //#endregion
426
+ //#region src/rules/require-subcommand-parent.ts
427
+ const subcommandDecorators = ["RegisterSubcommand", "RegisterSubcommandGroup"];
428
+ const parentDecorators = ["RegisterCommand"];
429
+ /**
430
+ * Requires classes using `@RegisterSubcommand` or `@RegisterSubcommandGroup` to also carry `@RegisterCommand`.
431
+ *
432
+ * Subcommand decorators attach to the chat input command resolver of their own class; without a parent
433
+ * `@RegisterCommand` there is no command for them to attach to and the subcommands never get registered.
434
+ */
435
+ const rule$6 = {
436
+ meta: {
437
+ type: "problem",
438
+ docs: {
439
+ description: "require `@RegisterCommand` on classes that declare subcommands",
440
+ recommended: true
441
+ },
442
+ messages: { missingParent: "`@{{decorator}}` requires the class to also be decorated with `@RegisterCommand`; without a parent command the subcommand is never registered." },
443
+ schema: []
444
+ },
445
+ create(context) {
446
+ function check(node) {
447
+ const decorators = getDecorators(node);
448
+ if (decorators.length === 0) return;
449
+ const subcommandIndex = findDecoratorIndex(decorators, subcommandDecorators);
450
+ if (subcommandIndex === -1) return;
451
+ if (findDecoratorIndex(decorators, parentDecorators) !== -1) return;
452
+ const subcommand = decorators[subcommandIndex];
453
+ context.report({
454
+ node: subcommand,
455
+ messageId: "missingParent",
456
+ data: { decorator: getDecoratorName(subcommand) ?? "RegisterSubcommand" }
457
+ });
458
+ }
459
+ return {
460
+ ClassDeclaration: check,
461
+ ClassExpression: check
462
+ };
463
+ }
464
+ };
465
+
466
+ //#endregion
467
+ //#region src/index.ts
468
+ /**
469
+ * The `wolfstar` lint plugin: custom rules for `@wolfstar/http-framework` and the `@wolfstar/plugin-*` ecosystem.
470
+ *
471
+ * The shape is the ESLint plugin shape, which oxlint's JS plugin API is compatible with, so the same object works as an
472
+ * ESLint flat-config plugin and as an entry in oxlint's `jsPlugins`.
473
+ */
474
+ const plugin = {
475
+ meta: { name: "wolfstar" },
476
+ rules: {
477
+ "apply-options-decorator-order": rule,
478
+ "require-subcommand-parent": rule$6,
479
+ "no-raw-discord-fetch": rule$4,
480
+ "no-dynamic-translation-key": rule$2,
481
+ "prefer-apply-localized-builder": rule$5,
482
+ "no-hoisted-plugin-register-import": rule$3,
483
+ "no-deprecated-i18n-package": rule$1
484
+ }
485
+ };
486
+ /**
487
+ * Every rule of the plugin set to `'error'`, ready to be spread into an ESLint or oxlint `rules` block.
488
+ */
489
+ const recommendedRules = Object.fromEntries(Object.keys(plugin.rules).map((name) => [`wolfstar/${name}`, "error"]));
490
+
491
+ //#endregion
492
+ export { rule as applyOptionsDecoratorOrder, plugin as default, rule$1 as noDeprecatedI18nPackage, rule$2 as noDynamicTranslationKey, rule$3 as noHoistedPluginRegisterImport, rule$4 as noRawDiscordFetch, rule$5 as preferApplyLocalizedBuilder, recommendedRules, rule$6 as requireSubcommandParent };
493
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["rule","rule","rule","rule","rule","rule","applyOptionsDecoratorOrder","requireSubcommandParent","noRawDiscordFetch","noDynamicTranslationKey","preferApplyLocalizedBuilder","noHoistedPluginRegisterImport","noDeprecatedI18nPackage"],"sources":["../../src/utils.ts","../../src/rules/apply-options-decorator-order.ts","../../src/rules/no-deprecated-i18n-package.ts","../../src/rules/no-dynamic-translation-key.ts","../../src/rules/no-hoisted-plugin-register-import.ts","../../src/rules/no-raw-discord-fetch.ts","../../src/rules/prefer-apply-localized-builder.ts","../../src/rules/require-subcommand-parent.ts","../../src/index.ts"],"sourcesContent":["import type { Rule } from 'eslint';\n\n/**\n * Minimal shape of a decorator node, matching the ESTree extension emitted by both `typescript-eslint` and `oxc`.\n *\n * @internal\n */\nexport interface DecoratorNode {\n\ttype: 'Decorator';\n\texpression: { type: string; callee?: { type: string; name?: string }; name?: string };\n\trange?: [number, number];\n\tloc?: Rule.Node['loc'];\n}\n\n/**\n * Reads the decorator list of a class-like node, tolerating parsers that omit the property entirely.\n *\n * @param node - The class node to read the decorators from.\n * @returns The decorators attached to the class, or an empty array when there are none.\n *\n * @internal\n */\nexport function getDecorators(node: unknown): DecoratorNode[] {\n\tconst decorators = (node as { decorators?: unknown }).decorators;\n\treturn Array.isArray(decorators) ? (decorators as DecoratorNode[]) : [];\n}\n\n/**\n * Resolves the name of the function a decorator refers to, whether it is called (`@Foo()`) or bare (`@Foo`).\n *\n * @param decorator - The decorator node to read.\n * @returns The decorator name, or `null` when it cannot be determined statically.\n *\n * @internal\n */\nexport function getDecoratorName(decorator: DecoratorNode): string | null {\n\tconst { expression } = decorator;\n\tif (expression.type === 'CallExpression') {\n\t\treturn expression.callee?.type === 'Identifier' ? (expression.callee.name ?? null) : null;\n\t}\n\n\treturn expression.type === 'Identifier' ? (expression.name ?? null) : null;\n}\n\n/**\n * Finds the index of the first decorator whose name is part of {@link names}.\n *\n * @param decorators - The decorator list to search.\n * @param names - The decorator names to look for.\n * @returns The index of the matching decorator, or `-1` when none matches.\n *\n * @internal\n */\nexport function findDecoratorIndex(decorators: DecoratorNode[], names: readonly string[]): number {\n\treturn decorators.findIndex((decorator) => {\n\t\tconst name = getDecoratorName(decorator);\n\t\treturn name !== null && names.includes(name);\n\t});\n}\n","import type { Rule } from 'eslint';\nimport { findDecoratorIndex, getDecoratorName, getDecorators } from '../utils.js';\n\n/**\n * Decorators that key their bookkeeping on the class identity, and therefore must run on the real class rather than on\n * the `Proxy` returned by `ApplyOptions`.\n */\nconst identityKeyedDecorators = [\n\t'RegisterCommand',\n\t'RegisterSubcommand',\n\t'RegisterSubcommandGroup',\n\t'RegisterUserCommand',\n\t'RegisterMessageCommand',\n\t'RestrictGuildIds'\n] as const;\n\n/**\n * Requires `@ApplyOptions` to be the outermost decorator of a piece class.\n *\n * `ApplyOptions` wraps the class in a `Proxy`; a decorator applied above it (and therefore evaluated after it) receives\n * that proxy instead of the class the framework constructs instances from, so the registration silently never resolves.\n */\nconst rule: Rule.RuleModule = {\n\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription: 'require `@ApplyOptions` to be the outermost decorator, above registration decorators',\n\t\t\trecommended: true\n\t\t},\n\t\tmessages: {\n\t\t\twrongOrder:\n\t\t\t\t'`@ApplyOptions` must be the outermost decorator, above `@{{decorator}}`. `ApplyOptions` wraps the class in a Proxy, so `@{{decorator}}` would register the proxy instead of the class and the piece would never resolve at runtime.'\n\t\t},\n\t\tschema: []\n\t},\n\tcreate(context) {\n\t\tfunction check(node: Rule.Node) {\n\t\t\tconst decorators = getDecorators(node);\n\t\t\tif (decorators.length < 2) return;\n\n\t\t\tconst applyOptionsIndex = findDecoratorIndex(decorators, ['ApplyOptions']);\n\t\t\tif (applyOptionsIndex <= 0) return;\n\n\t\t\tconst registrationIndex = findDecoratorIndex(decorators, identityKeyedDecorators);\n\t\t\tif (registrationIndex === -1 || registrationIndex > applyOptionsIndex) return;\n\n\t\t\tconst registration = decorators[registrationIndex]!;\n\t\t\tcontext.report({\n\t\t\t\tnode: registration as unknown as Rule.Node,\n\t\t\t\tmessageId: 'wrongOrder',\n\t\t\t\tdata: { decorator: getDecoratorName(registration) ?? 'RegisterCommand' }\n\t\t\t});\n\t\t}\n\n\t\treturn {\n\t\t\tClassDeclaration: check,\n\t\t\tClassExpression: check\n\t\t};\n\t}\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\n\nconst deprecated = '@wolfstar/http-framework-i18n';\nconst replacement = '@wolfstar/plugin-i18next';\n\n/**\n * Bans imports of the deprecated `@wolfstar/http-framework-i18n` package.\n *\n * `@wolfstar/plugin-i18next` is the supported i18n integration; the legacy package no longer receives snapshots and its\n * helper set has drifted from the plugin's.\n */\nconst rule: Rule.RuleModule = {\n\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription: 'ban imports of the deprecated `@wolfstar/http-framework-i18n` package',\n\t\t\trecommended: true\n\t\t},\n\t\tmessages: {\n\t\t\tdeprecatedPackage: '`{{deprecated}}` is deprecated; use `{{replacement}}` instead.'\n\t\t},\n\t\tschema: []\n\t},\n\tcreate(context) {\n\t\tfunction report(node: Rule.Node, source: unknown) {\n\t\t\tif (typeof source !== 'string') return;\n\t\t\tif (source !== deprecated && !source.startsWith(`${deprecated}/`)) return;\n\n\t\t\tcontext.report({ node, messageId: 'deprecatedPackage', data: { deprecated, replacement } });\n\t\t}\n\n\t\treturn {\n\t\t\tImportDeclaration(node) {\n\t\t\t\treport(node as never, (node.source as { value?: unknown }).value);\n\t\t\t},\n\t\t\tImportExpression(node) {\n\t\t\t\treport(node as never, (node.source as { value?: unknown }).value);\n\t\t\t}\n\t\t};\n\t}\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\n\nconst i18nextPackages = ['@wolfstar/plugin-i18next', '@wolfstar/http-framework-i18n'];\nconst translateFactories = ['getSupportedUserLanguageT', 'getSupportedLanguageT', 'fetchT'];\n\ninterface MaybeNode {\n\ttype: string;\n\tvalue?: unknown;\n\texpressions?: unknown[];\n}\n\n/**\n * Determines whether a node is a statically known string, i.e. a string literal or a template literal without\n * interpolation.\n *\n * @param node - The node to inspect.\n * @returns Whether the key can be resolved statically.\n */\nfunction isStaticKey(node: MaybeNode | undefined): boolean {\n\tif (!node) return true;\n\tif (node.type === 'Literal') return typeof node.value === 'string';\n\tif (node.type === 'TemplateLiteral') return (node.expressions ?? []).length === 0;\n\treturn false;\n}\n\n/**\n * Requires translation keys to be written as string literals.\n *\n * Keys are typed through the `CustomTypeOptions` augmentation generated by `@wolfstar/i18next-type-generator`; a\n * dynamically built key silently opts out of that type checking, so a typo or a removed key only surfaces at runtime.\n */\nconst rule: Rule.RuleModule = {\n\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription: 'require i18next translation keys to be string literals so generated key types apply',\n\t\t\trecommended: true\n\t\t},\n\t\tmessages: {\n\t\t\tdynamicKey:\n\t\t\t\t'Translation keys must be string literals; a computed key bypasses the generated i18next key types, so typos and removed keys are only caught at runtime.'\n\t\t},\n\t\tschema: []\n\t},\n\tcreate(context) {\n\t\tlet importsI18next = false;\n\t\tconst factoryBindings = new Set<string>();\n\t\tconst translateBindings = new Set<string>();\n\t\tlet localizedBuilderName: string | null = null;\n\n\t\treturn {\n\t\t\tImportDeclaration(node) {\n\t\t\t\tconst source = (node.source as { value?: unknown }).value;\n\t\t\t\tif (typeof source !== 'string' || !i18nextPackages.includes(source)) return;\n\n\t\t\t\timportsI18next = true;\n\t\t\t\tfor (const specifier of node.specifiers) {\n\t\t\t\t\tif (specifier.type !== 'ImportSpecifier') continue;\n\n\t\t\t\t\tconst imported = (specifier.imported as { name?: string }).name;\n\t\t\t\t\tif (imported === 'applyLocalizedBuilder') localizedBuilderName = specifier.local.name;\n\t\t\t\t\tif (imported !== undefined && translateFactories.includes(imported)) factoryBindings.add(specifier.local.name);\n\t\t\t\t}\n\t\t\t},\n\t\t\tVariableDeclarator(node) {\n\t\t\t\tif (!node.init || node.init.type !== 'CallExpression') return;\n\n\t\t\t\tconst callee = node.init.callee as { type: string; name?: string };\n\t\t\t\tif (callee.type !== 'Identifier' || callee.name === undefined) return;\n\t\t\t\tif (!factoryBindings.has(callee.name)) return;\n\t\t\t\tif (node.id.type !== 'Identifier') return;\n\n\t\t\t\ttranslateBindings.add(node.id.name);\n\t\t\t},\n\t\t\tCallExpression(node) {\n\t\t\t\tif (!importsI18next) return;\n\n\t\t\t\tconst callee = node.callee as { type: string; name?: string };\n\t\t\t\tif (callee.type !== 'Identifier' || callee.name === undefined) return;\n\n\t\t\t\tif (callee.name === localizedBuilderName) {\n\t\t\t\t\tfor (const argument of node.arguments.slice(1, 3)) {\n\t\t\t\t\t\tif (!isStaticKey(argument as MaybeNode)) {\n\t\t\t\t\t\t\tcontext.report({ node: argument as never, messageId: 'dynamicKey' });\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (!translateBindings.has(callee.name)) return;\n\n\t\t\t\tconst [key] = node.arguments;\n\t\t\t\tif (key && !isStaticKey(key as MaybeNode)) {\n\t\t\t\t\tcontext.report({ node: key as never, messageId: 'dynamicKey' });\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\n\nconst registerSuffix = '/register';\nconst pluginScope = '@wolfstar/plugin-';\nconst hookMethods = [\n\t'registerPreGenericsInitializationHook',\n\t'registerPreInitializationHook',\n\t'registerPostInitializationHook',\n\t'registerPreLoadHook',\n\t'registerPostListenHook'\n];\n\n/**\n * Bans statically importing a `@wolfstar/plugin-*` register entrypoint from a module that also registers its own plugin\n * hooks.\n *\n * Static imports are hoisted above the hook registrations in the same module, so the plugin's own hook registers — and\n * runs — before the module's, which silently loses whatever the module wanted to contribute (locale paths, options).\n * Use a dynamic `await import(...)` of the plugin's register entrypoint after the hook registration instead.\n */\nconst rule: Rule.RuleModule = {\n\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription: 'ban hoisted `@wolfstar/plugin-*/register` imports in modules that register plugin hooks',\n\t\t\trecommended: true\n\t\t},\n\t\tmessages: {\n\t\t\thoistedRegister:\n\t\t\t\t\"`import '{{source}}'` is hoisted above the hook registration in this module, so the plugin hook runs first and this module's contribution is lost. Use `await import('{{source}}')` after registering the hook.\"\n\t\t},\n\t\tschema: []\n\t},\n\tcreate(context) {\n\t\tconst staticRegisterImports: { node: Rule.Node; source: string }[] = [];\n\t\tlet registersHook = false;\n\n\t\treturn {\n\t\t\tImportDeclaration(node) {\n\t\t\t\tconst source = (node.source as { value?: unknown }).value;\n\t\t\t\tif (typeof source !== 'string') return;\n\t\t\t\tif (!source.startsWith(pluginScope) || !source.endsWith(registerSuffix)) return;\n\n\t\t\t\tstaticRegisterImports.push({ node: node as never, source });\n\t\t\t},\n\t\t\tCallExpression(node) {\n\t\t\t\tconst callee = node.callee as { type: string; property?: { type: string; name?: string } };\n\t\t\t\tif (callee.type !== 'MemberExpression' || callee.property?.type !== 'Identifier') return;\n\n\t\t\t\tconst name = callee.property.name;\n\t\t\t\tif (name !== undefined && hookMethods.includes(name)) registersHook = true;\n\t\t\t},\n\t\t\t'Program:exit'() {\n\t\t\t\tif (!registersHook) return;\n\n\t\t\t\tfor (const { node, source } of staticRegisterImports) {\n\t\t\t\t\tcontext.report({ node, messageId: 'hoistedRegister', data: { source } });\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\n\nconst discordHosts = ['discord.com/api', 'discordapp.com/api', 'ptb.discord.com/api', 'canary.discord.com/api'];\n\n/**\n * Reads a static string out of a node, supporting plain literals and template literals without expressions.\n *\n * @param node - The AST node to read.\n * @returns The static string value, or `null` when the node is not statically known.\n */\nfunction getStaticString(node: {\n\ttype: string;\n\tvalue?: unknown;\n\tquasis?: { value: { cooked?: string | null } }[];\n\texpressions?: unknown[];\n}): string | null {\n\tif (node.type === 'Literal') return typeof node.value === 'string' ? node.value : null;\n\n\tif (node.type === 'TemplateLiteral') {\n\t\treturn (node.quasis ?? []).map((quasi) => quasi.value.cooked ?? '').join('');\n\t}\n\n\treturn null;\n}\n\n/**\n * Bans calling the Discord HTTP API directly instead of going through the framework's shared REST client.\n *\n * `@wolfstar/http-framework` routes every Discord request through `container.rest`, which carries the bot token,\n * rate-limit handling and instrumentation. A hand-rolled `fetch` bypasses all of it.\n */\nconst rule: Rule.RuleModule = {\n\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription: 'ban direct calls to the Discord HTTP API, use `container.rest` instead',\n\t\t\trecommended: true\n\t\t},\n\t\tmessages: {\n\t\t\trawFetch:\n\t\t\t\t'Do not call the Discord API directly; use `container.rest` so the request keeps the bot token, rate limiting and instrumentation.',\n\t\t\trawUrl: 'Do not hardcode Discord API URLs; use `container.rest` with `Routes` from `discord-api-types/v10`.'\n\t\t},\n\t\tschema: []\n\t},\n\tcreate(context) {\n\t\tfunction isDiscordUrl(value: string): boolean {\n\t\t\treturn discordHosts.some((host) => value.includes(host));\n\t\t}\n\n\t\treturn {\n\t\t\tCallExpression(node) {\n\t\t\t\tconst callee = node.callee as { type: string; name?: string };\n\t\t\t\tif (callee.type !== 'Identifier' || callee.name !== 'fetch') return;\n\n\t\t\t\tconst [first] = node.arguments;\n\t\t\t\tif (!first) return;\n\n\t\t\t\tconst value = getStaticString(first as never);\n\t\t\t\tif (value !== null && isDiscordUrl(value)) {\n\t\t\t\t\tcontext.report({ node, messageId: 'rawFetch' });\n\t\t\t\t}\n\t\t\t},\n\t\t\tLiteral(node) {\n\t\t\t\tconst { value } = node as { value?: unknown };\n\t\t\t\tif (typeof value === 'string' && isDiscordUrl(value)) {\n\t\t\t\t\tcontext.report({ node, messageId: 'rawUrl' });\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\nimport { getDecoratorName, getDecorators } from '../utils.js';\n\nconst i18nextPackage = '@wolfstar/plugin-i18next';\nconst rawBuilderMethods = ['setName', 'setDescription', 'setNameLocalizations', 'setDescriptionLocalizations'];\nconst registrationDecorators = ['RegisterCommand', 'RegisterSubcommand', 'RegisterSubcommandGroup', 'RegisterUserCommand', 'RegisterMessageCommand'];\n\n/**\n * Requires localized command builders in i18n-enabled modules to go through `applyLocalizedBuilder`.\n *\n * Calling `setName`/`setDescription` by hand inside a registration decorator hardcodes English strings and skips the\n * localization map the plugin would otherwise attach, so the command shows up untranslated for every locale.\n */\nconst rule: Rule.RuleModule = {\n\tmeta: {\n\t\ttype: 'suggestion',\n\t\tdocs: {\n\t\t\tdescription: 'require `applyLocalizedBuilder` instead of raw `setName`/`setDescription` in i18n modules',\n\t\t\trecommended: true\n\t\t},\n\t\tmessages: {\n\t\t\trawBuilder:\n\t\t\t\t'Use `applyLocalizedBuilder(builder, key)` instead of `{{method}}` inside `@{{decorator}}`; a raw call hardcodes one language and skips the localization map.'\n\t\t},\n\t\tschema: []\n\t},\n\tcreate(context) {\n\t\tlet importsI18next = false;\n\t\tconst decoratorRanges: { start: number; end: number; decorator: string }[] = [];\n\n\t\tfunction collectDecoratorRanges(node: Rule.Node) {\n\t\t\tfor (const decorator of getDecorators(node)) {\n\t\t\t\tconst name = getDecoratorName(decorator);\n\t\t\t\tif (name === null || !registrationDecorators.includes(name)) continue;\n\n\t\t\t\tconst range = decorator.range;\n\t\t\t\tif (!range) continue;\n\n\t\t\t\tdecoratorRanges.push({ start: range[0], end: range[1], decorator: name });\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tImportDeclaration(node) {\n\t\t\t\tif ((node.source as { value?: unknown }).value === i18nextPackage) importsI18next = true;\n\t\t\t},\n\t\t\tClassDeclaration: collectDecoratorRanges,\n\t\t\tClassExpression: collectDecoratorRanges,\n\t\t\t'CallExpression:exit'(node) {\n\t\t\t\tif (!importsI18next) return;\n\n\t\t\t\tconst callee = node.callee as { type: string; property?: { type: string; name?: string } };\n\t\t\t\tif (callee.type !== 'MemberExpression' || callee.property?.type !== 'Identifier') return;\n\n\t\t\t\tconst method = callee.property.name;\n\t\t\t\tif (method === undefined || !rawBuilderMethods.includes(method)) return;\n\n\t\t\t\tconst range = (node as { range?: [number, number] }).range;\n\t\t\t\tif (!range) return;\n\n\t\t\t\tconst enclosing = decoratorRanges.find((decorator) => decorator.start <= range[0] && decorator.end >= range[1]);\n\t\t\t\tif (!enclosing) return;\n\n\t\t\t\tcontext.report({ node, messageId: 'rawBuilder', data: { method, decorator: enclosing.decorator } });\n\t\t\t}\n\t\t};\n\t}\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\nimport { findDecoratorIndex, getDecoratorName, getDecorators } from '../utils.js';\n\nconst subcommandDecorators = ['RegisterSubcommand', 'RegisterSubcommandGroup'] as const;\nconst parentDecorators = ['RegisterCommand'] as const;\n\n/**\n * Requires classes using `@RegisterSubcommand` or `@RegisterSubcommandGroup` to also carry `@RegisterCommand`.\n *\n * Subcommand decorators attach to the chat input command resolver of their own class; without a parent\n * `@RegisterCommand` there is no command for them to attach to and the subcommands never get registered.\n */\nconst rule: Rule.RuleModule = {\n\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription: 'require `@RegisterCommand` on classes that declare subcommands',\n\t\t\trecommended: true\n\t\t},\n\t\tmessages: {\n\t\t\tmissingParent:\n\t\t\t\t'`@{{decorator}}` requires the class to also be decorated with `@RegisterCommand`; without a parent command the subcommand is never registered.'\n\t\t},\n\t\tschema: []\n\t},\n\tcreate(context) {\n\t\tfunction check(node: Rule.Node) {\n\t\t\tconst decorators = getDecorators(node);\n\t\t\tif (decorators.length === 0) return;\n\n\t\t\tconst subcommandIndex = findDecoratorIndex(decorators, subcommandDecorators);\n\t\t\tif (subcommandIndex === -1) return;\n\n\t\t\tif (findDecoratorIndex(decorators, parentDecorators) !== -1) return;\n\n\t\t\tconst subcommand = decorators[subcommandIndex]!;\n\t\t\tcontext.report({\n\t\t\t\tnode: subcommand as unknown as Rule.Node,\n\t\t\t\tmessageId: 'missingParent',\n\t\t\t\tdata: { decorator: getDecoratorName(subcommand) ?? 'RegisterSubcommand' }\n\t\t\t});\n\t\t}\n\n\t\treturn {\n\t\t\tClassDeclaration: check,\n\t\t\tClassExpression: check\n\t\t};\n\t}\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\nimport applyOptionsDecoratorOrder from './rules/apply-options-decorator-order.js';\nimport noDeprecatedI18nPackage from './rules/no-deprecated-i18n-package.js';\nimport noDynamicTranslationKey from './rules/no-dynamic-translation-key.js';\nimport noHoistedPluginRegisterImport from './rules/no-hoisted-plugin-register-import.js';\nimport noRawDiscordFetch from './rules/no-raw-discord-fetch.js';\nimport preferApplyLocalizedBuilder from './rules/prefer-apply-localized-builder.js';\nimport requireSubcommandParent from './rules/require-subcommand-parent.js';\n\nexport interface WolfstarPlugin {\n\tmeta: { name: string };\n\trules: Record<string, Rule.RuleModule>;\n}\n\n/**\n * The `wolfstar` lint plugin: custom rules for `@wolfstar/http-framework` and the `@wolfstar/plugin-*` ecosystem.\n *\n * The shape is the ESLint plugin shape, which oxlint's JS plugin API is compatible with, so the same object works as an\n * ESLint flat-config plugin and as an entry in oxlint's `jsPlugins`.\n */\nconst plugin: WolfstarPlugin = {\n\tmeta: { name: 'wolfstar' },\n\trules: {\n\t\t'apply-options-decorator-order': applyOptionsDecoratorOrder,\n\t\t'require-subcommand-parent': requireSubcommandParent,\n\t\t'no-raw-discord-fetch': noRawDiscordFetch,\n\t\t'no-dynamic-translation-key': noDynamicTranslationKey,\n\t\t'prefer-apply-localized-builder': preferApplyLocalizedBuilder,\n\t\t'no-hoisted-plugin-register-import': noHoistedPluginRegisterImport,\n\t\t'no-deprecated-i18n-package': noDeprecatedI18nPackage\n\t}\n};\n\n/**\n * Every rule of the plugin set to `'error'`, ready to be spread into an ESLint or oxlint `rules` block.\n */\nexport const recommendedRules: Record<string, 'error'> = Object.fromEntries(\n\tObject.keys(plugin.rules).map((name) => [`wolfstar/${name}`, 'error'] as const)\n);\n\nexport {\n\tapplyOptionsDecoratorOrder,\n\tnoDeprecatedI18nPackage,\n\tnoDynamicTranslationKey,\n\tnoHoistedPluginRegisterImport,\n\tnoRawDiscordFetch,\n\tpreferApplyLocalizedBuilder,\n\trequireSubcommandParent\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;AAsBA,SAAgB,cAAc,MAAgC;CAC7D,MAAM,aAAc,KAAkC;CACtD,O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C;CAC/B;AACD;;;;AAKA,MAAa,mBAA4C,OAAO,YAC/D,OAAO,KAAK,OAAO,KAAK,CAAC,CAAC,KAAK,SAAS,CAAC,YAAY,QAAQ,OAAO,CAAU,CAC/E"}
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@wolfstar/eslint-plugin-http-framework",
3
+ "version": "0.1.0-next-20260904160000",
4
+ "description": "Custom lint rules for @wolfstar/http-framework and the @wolfstar/plugin-* ecosystem, usable from both ESLint and oxlint",
5
+ "keywords": [
6
+ "eslint-plugin",
7
+ "lint",
8
+ "oxlint",
9
+ "rules",
10
+ "typescript",
11
+ "wolfstar"
12
+ ],
13
+ "homepage": "https://github.com/wolfstar-project/stars-components/tree/main/packages/eslint-plugin-http-framework#readme",
14
+ "bugs": {
15
+ "url": "https://github.com/wolfstar-project/stars-components/issues"
16
+ },
17
+ "license": "Apache-2.0",
18
+ "author": "@wolfstar",
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/wolfstar-project/stars-components.git",
22
+ "directory": "packages/eslint-plugin-http-framework"
23
+ },
24
+ "files": [
25
+ "dist/"
26
+ ],
27
+ "type": "module",
28
+ "sideEffects": false,
29
+ "main": "dist/esm/index.js",
30
+ "module": "dist/esm/index.js",
31
+ "types": "dist/esm/index.d.ts",
32
+ "exports": {
33
+ "import": {
34
+ "types": "./dist/esm/index.d.ts",
35
+ "default": "./dist/esm/index.js"
36
+ }
37
+ },
38
+ "publishConfig": {
39
+ "access": "public",
40
+ "provenance": true
41
+ },
42
+ "devDependencies": {
43
+ "@typescript-eslint/parser": "^8.69.0",
44
+ "@vitest/coverage-v8": "^4.1.11",
45
+ "eslint": "^10.9.1",
46
+ "golar": "^0.1.10",
47
+ "tsdown": "^0.22.14",
48
+ "typescript": "~5.8.3",
49
+ "vitest": "^4.1.11"
50
+ },
51
+ "engines": {
52
+ "node": ">=20"
53
+ },
54
+ "scripts": {
55
+ "test": "vitest run",
56
+ "build": "tsdown --config-loader unrun",
57
+ "watch": "tsdown --config-loader unrun --watch",
58
+ "typecheck": "golar tsc -p ../../tsconfig.json",
59
+ "lint": "oxlint src --fix"
60
+ }
61
+ }