@milkenjoyer/toolchain 0.0.0-stage → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,268 @@
1
+ import * as Arr from "effect/Array";
2
+ import { dual } from "effect/Function";
3
+ import * as HashSet from "effect/HashSet";
4
+ import * as Option from "effect/Option";
5
+ import * as Schema from "effect/Schema";
6
+ import * as Str from "effect/String";
7
+ import { Comment, Diagnostic, Plugin, Rule, RuleContext } from "effect-oxlint";
8
+ import * as Effect from "effect/Effect";
9
+ import * as HashMap from "effect/HashMap";
10
+ // src/rules/no-comments.ts
11
+ const noCommentsRule = Rule.define({
12
+ *create() {
13
+ const context = yield* RuleContext;
14
+ return { Program: () => Effect.forEach(Arr.filter(context.sourceCode.getAllComments(), (comment) => !Comment.isShebang(comment) && !/^\s*@vite-ignore\s*$/u.test(Comment.text(comment))), (comment) => context.report(Diagnostic.fromId({
15
+ messageId: "comment",
16
+ node: comment
17
+ })), {
18
+ concurrency: 1,
19
+ discard: true
20
+ }) };
21
+ },
22
+ meta: Rule.meta({
23
+ description: "No comments except shebangs and exact @vite-ignore directives: meaning lives in names, types and test names",
24
+ messages: { comment: "Delete this comment. Put its meaning in a name, a type or a test name. Only shebangs and exact @vite-ignore directives are allowed." },
25
+ type: "problem"
26
+ }),
27
+ name: "no-comments"
28
+ });
29
+ // src/shared/syntax.ts
30
+ const unwrapExpression = (node) => {
31
+ if (node.type === "ParenthesizedExpression" || node.type === "ChainExpression" || node.type === "TSAsExpression" || node.type === "TSTypeAssertion" || node.type === "TSNonNullExpression" || node.type === "TSSatisfiesExpression") return unwrapExpression(node.expression);
32
+ return node;
33
+ };
34
+ const isStringLiteral = (node) => node.type === "Literal" && Schema.is(Schema.String)(node.value);
35
+ const memberPropertyName = (node) => {
36
+ if (!node.computed && node.property.type === "Identifier") return Option.some(node.property.name);
37
+ return node.computed && isStringLiteral(node.property) ? Option.some(node.property.value) : Option.none();
38
+ };
39
+ const propertyName = (property) => {
40
+ if (!property.computed && property.key.type === "Identifier") return Option.some(property.key.name);
41
+ return isStringLiteral(property.key) ? Option.some(property.key.value) : Option.none();
42
+ };
43
+ // src/shared/member-path.ts
44
+ const resolveBinding = (sourceCode, node) => {
45
+ const findBinding = (scope) => Option.flatMap(scope, (current) => Option.orElse(Option.fromUndefinedOr(current.set.get(node.name)), () => findBinding(Option.fromNullishOr(current.upper))));
46
+ return findBinding(Option.fromNullishOr(sourceCode.getScope(node)));
47
+ };
48
+ const memberPath = (node) => {
49
+ const current = unwrapExpression(node);
50
+ if (current.type === "Identifier") return Option.some({
51
+ root: current,
52
+ members: []
53
+ });
54
+ if (current.type !== "MemberExpression") return Option.none();
55
+ return Option.flatMap(memberPath(current.object), (path) => Option.map(memberPropertyName(current), (name) => ({
56
+ root: path.root,
57
+ members: [...path.members, name]
58
+ })));
59
+ };
60
+ const lastName = (node) => Option.map(memberPath(node), (path) => Option.getOrElse(Arr.last(path.members), () => path.root.name));
61
+ const importedPath = dual(2, (sourceCode, node) => Option.gen(function* () {
62
+ const path = yield* memberPath(node);
63
+ const variable = yield* resolveBinding(sourceCode, path.root);
64
+ const definition = yield* Arr.findFirst(variable.defs, (candidate) => candidate.type === "ImportBinding");
65
+ const declaration = definition.parent;
66
+ const specifier = definition.node;
67
+ if (declaration?.type !== "ImportDeclaration") return yield* Option.none();
68
+ if (specifier.type === "ImportNamespaceSpecifier") return {
69
+ source: declaration.source.value,
70
+ members: path.members
71
+ };
72
+ if (specifier.type !== "ImportSpecifier") return yield* Option.none();
73
+ const imported = specifier.imported.type === "Identifier" ? specifier.imported.name : specifier.imported.value;
74
+ return {
75
+ source: declaration.source.value,
76
+ members: [imported, ...path.members]
77
+ };
78
+ }));
79
+ // src/shared/foldkit-api.ts
80
+ const NAMESPACES = HashMap.make(["foldkit", []], ["foldkit/command", ["Command"]], ["foldkit/html", ["Html"]], ["foldkit/message", ["Message"]], ["foldkit/scene", ["Scene"]], ["foldkit/schema", ["Schema"]], ["foldkit/test", []]);
81
+ const isFoldkitCall = (sourceCode, node, ...wanted) => Option.exists(importedPath(sourceCode, node.callee), (path) => Option.exists(HashMap.get(NAMESPACES, path.source), (prefix) => {
82
+ const full = Arr.join([...prefix, ...path.members], ".");
83
+ return Arr.some(wanted, (candidate) => Arr.join(candidate, ".") === full);
84
+ }));
85
+ const textWithHoles = dual(2, (node, hole) => {
86
+ if (isStringLiteral(node)) return Option.some(node.value);
87
+ return node.type === "TemplateLiteral" ? Option.some(Arr.join(Arr.map(node.quasis, (quasi) => quasi.value.raw), hole)) : Option.none();
88
+ });
89
+ // src/rules/prefer-accessible-scene-locators.ts
90
+ const ROLE_TAGS = HashSet.make("a", "article", "aside", "button", "datalist", "dd", "details", "dialog", "dt", "fieldset", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hr", "img", "input", "li", "main", "menu", "meter", "nav", "ol", "option", "output", "progress", "select", "summary", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "tr", "ul");
91
+ const ACCESSIBLE_ATTRIBUTES = /\[\s*(?:role|aria-label|aria-labelledby|alt|placeholder|title)\s*(?:[~|^$*]?=|\])/iu;
92
+ const QUOTED = /"[^"]*"|'[^']*'/gu;
93
+ const COMBINATOR = /[\s>+~]/u;
94
+ const TAG = /^[a-z][a-z0-9-]*/iu;
95
+ const SUBJECT_PSEUDO = /^(?:is|where|matches)\(/u;
96
+ const splitTopLevel = (text, isSeparator) => Arr.reduce(Arr.filter(Str.split(text, ""), Str.isNonEmpty), {
97
+ depth: 0,
98
+ parts: [""]
99
+ }, ({ depth, parts }, char) => {
100
+ if (depth === 0 && isSeparator(char)) return {
101
+ depth,
102
+ parts: [...parts, ""]
103
+ };
104
+ const opened = char === "(" || char === "[" ? 1 : 0;
105
+ const closed = char === ")" || char === "]" ? 1 : 0;
106
+ return {
107
+ depth: depth + opened - closed,
108
+ parts: [...parts.slice(0, -1), `${parts.at(-1) ?? ""}${char}`]
109
+ };
110
+ }).parts;
111
+ const fitsAccessibleLocator = (selector) => Arr.some(splitTopLevel(selector, (char) => char === ","), (part) => {
112
+ const compound = Option.getOrElse(Arr.last(Arr.filter(splitTopLevel(Str.trim(part), (char) => COMBINATOR.test(char)), (piece) => piece !== "")), () => "");
113
+ const [tag = ""] = TAG.exec(compound) ?? [];
114
+ return HashSet.has(ROLE_TAGS, Str.toLowerCase(tag)) || Arr.some(splitTopLevel(compound, (char) => char === ":"), (piece) => {
115
+ const open = Str.indexOf("(")(piece);
116
+ if (Option.isNone(open)) return ACCESSIBLE_ATTRIBUTES.test(piece);
117
+ const close = Str.lastIndexOf(")")(piece).pipe(Option.getOrElse(() => -1));
118
+ return ACCESSIBLE_ATTRIBUTES.test(`${Str.slice(0, open.value)(piece)}${Str.slice(close + 1)(piece)}`) || SUBJECT_PSEUDO.test(piece) && fitsAccessibleLocator(Str.slice(open.value + 1, close)(piece));
119
+ });
120
+ });
121
+ const preferAccessibleSceneLocatorsRule = Rule.define({
122
+ *create() {
123
+ const context = yield* RuleContext;
124
+ return { CallExpression: (node) => {
125
+ if (node.type !== "CallExpression" || !isFoldkitCall(context.sourceCode, node, ["Scene", "selector"], ["Scene", "allSelector"], [
126
+ "Scene",
127
+ "all",
128
+ "selector"
129
+ ])) return Effect.void;
130
+ const [css] = node.arguments;
131
+ if (css === void 0) return Effect.void;
132
+ return Option.match(Option.filter(textWithHoles(css, "x"), (text) => fitsAccessibleLocator(Str.replaceAll(QUOTED, "\"\"")(text))), {
133
+ onNone: () => Effect.void,
134
+ onSome: () => context.report(Diagnostic.fromId({
135
+ data: { target: context.sourceCode.getText(css) },
136
+ messageId: "accessibleLocator",
137
+ node
138
+ }))
139
+ });
140
+ } };
141
+ },
142
+ meta: Rule.meta({
143
+ description: "Scene tests find elements by role, label or text, keeping selector() for targets no accessible locator fits",
144
+ messages: { accessibleLocator: "{{target}} targets an element with an accessible name or role. Find it with Scene.role, Scene.label, Scene.text, Scene.altText or Scene.title instead of a CSS selector." },
145
+ type: "suggestion"
146
+ }),
147
+ name: "prefer-accessible-scene-locators"
148
+ });
149
+ // src/rules/require-command-answer-names.ts
150
+ const OUTCOMES = [
151
+ "Completed",
152
+ "Succeeded",
153
+ "Failed"
154
+ ];
155
+ const answersOf = (call) => {
156
+ const [name] = call.arguments;
157
+ const list = Option.flatMap(Option.map(Arr.get(call.arguments, 1), unwrapExpression), (settings) => Arr.findFirst(settings.type === "ObjectExpression" ? settings.properties : [], (property) => {
158
+ const value = property.type === "Property" && Option.contains(propertyName(property), "messages") ? unwrapExpression(property.value) : property;
159
+ return value.type === "ArrayExpression" ? Option.some(value) : Option.none();
160
+ }));
161
+ const command = name !== void 0 && isStringLiteral(name) ? Option.some(name.value) : Option.none();
162
+ return Option.map(Option.all([command, list]), ([text, array]) => ({
163
+ command: text,
164
+ list: array,
165
+ answers: Arr.flatMap(array.elements, (element) => element === null || element.type === "SpreadElement" ? [] : Arr.fromOption(Option.map(lastName(element), (answer) => ({
166
+ name: answer,
167
+ node: element,
168
+ outcome: Arr.findFirst(OUTCOMES, (outcome) => answer === `${outcome}${text}`)
169
+ }))))
170
+ }));
171
+ };
172
+ const requireCommandAnswerNamesRule = Rule.define({
173
+ *create() {
174
+ const context = yield* RuleContext;
175
+ const check = ({ command, list, answers }) => {
176
+ const outcomes = HashSet.fromIterable(Arr.flatMap(answers, ({ outcome }) => Arr.fromOption(outcome)));
177
+ const mixed = HashSet.has(outcomes, "Completed") && (HashSet.has(outcomes, "Succeeded") || HashSet.has(outcomes, "Failed"));
178
+ return Effect.andThen(Effect.forEach(Arr.filter(answers, ({ outcome }) => Option.isNone(outcome)), ({ name, node }) => context.report(Diagnostic.fromId({
179
+ data: {
180
+ command,
181
+ name
182
+ },
183
+ messageId: "wrongAnswer",
184
+ node
185
+ })), {
186
+ concurrency: 1,
187
+ discard: true
188
+ }), mixed ? context.report(Diagnostic.fromId({
189
+ data: { command },
190
+ messageId: "mixedAnswers",
191
+ node: list
192
+ })) : Effect.void);
193
+ };
194
+ return { CallExpression: (node) => node.type === "CallExpression" && isFoldkitCall(context.sourceCode, node, ["Command", "define"]) ? Option.match(answersOf(node), {
195
+ onNone: () => Effect.void,
196
+ onSome: check
197
+ }) : Effect.void };
198
+ },
199
+ meta: Rule.meta({
200
+ description: "A Command X is answered only by CompletedX, or by SucceededX and FailedX",
201
+ messages: {
202
+ mixedAnswers: "Command `{{command}}` answers both Completed{{command}} and Succeeded{{command}} or Failed{{command}}. An infallible Command answers Completed{{command}}; a fallible one answers Succeeded{{command}} or Failed{{command}}.",
203
+ wrongAnswer: "Command `{{command}}` answers `{{name}}`. Name its result Completed{{command}} if it can't fail, or Succeeded{{command}} and Failed{{command}} if it can."
204
+ },
205
+ type: "suggestion"
206
+ }),
207
+ name: "require-command-answer-names"
208
+ });
209
+ // src/rules/require-past-tense-messages.ts
210
+ const IRREGULAR_PAST = HashSet.make("Ate", "Became", "Began", "Bought", "Broke", "Brought", "Built", "Came", "Caught", "Chose", "Did", "Drew", "Drove", "Fell", "Felt", "Fled", "Flew", "Forgot", "Found", "Froze", "Gave", "Got", "Grew", "Had", "Heard", "Held", "Hid", "Hung", "Kept", "Knew", "Laid", "Led", "Left", "Lent", "Lost", "Made", "Meant", "Met", "Paid", "Ran", "Rang", "Rode", "Rose", "Said", "Sang", "Sank", "Sat", "Saw", "Sent", "Shook", "Shot", "Slept", "Slid", "Sold", "Sought", "Spent", "Spoke", "Stole", "Stood", "Struck", "Stuck", "Swept", "Swung", "Taught", "Thought", "Threw", "Told", "Took", "Tore", "Understood", "Undid", "Went", "Withdrew", "Woke", "Won", "Wore", "Wrote");
211
+ const PRESENT_ENDING_IN_ED = HashSet.make("Bed", "Bleed", "Breed", "Embed", "Exceed", "Feed", "Heed", "Need", "Proceed", "Red", "Seed", "Shed", "Shred", "Speed", "Succeed", "Weed");
212
+ const IMPERATIVE = /^(?:Set|Mutate)(?![a-z])/u;
213
+ const FIRST_WORD = /^[A-Z][a-z]*/u;
214
+ const problemOf = (name) => {
215
+ if (IMPERATIVE.test(name)) return Option.some("imperative");
216
+ const [word = ""] = FIRST_WORD.exec(name) ?? [];
217
+ return HashSet.has(IRREGULAR_PAST, word) || Str.endsWith("ed")(word) && !HashSet.has(PRESENT_ENDING_IN_ED, word) ? Option.none() : Option.some("notPastTense");
218
+ };
219
+ const requirePastTenseMessagesRule = Rule.define({
220
+ *create() {
221
+ const context = yield* RuleContext;
222
+ const reportKey = (property) => {
223
+ if (property.type !== "Property") return Effect.void;
224
+ return Option.match(Option.flatMap(propertyName(property), (name) => Option.map(problemOf(name), (messageId) => ({
225
+ messageId,
226
+ name
227
+ }))), {
228
+ onNone: () => Effect.void,
229
+ onSome: ({ messageId, name }) => context.report(Diagnostic.fromId({
230
+ data: { name },
231
+ messageId,
232
+ node: property.key
233
+ }))
234
+ });
235
+ };
236
+ return { CallExpression: (node) => {
237
+ if (node.type !== "CallExpression" || !isFoldkitCall(context.sourceCode, node, ["Message", "defineMessageUnion"], ["Schema", "defineMessageUnion"])) return Effect.void;
238
+ return Option.match(Option.map(Arr.head(node.arguments), unwrapExpression), {
239
+ onNone: () => Effect.void,
240
+ onSome: (cases) => cases.type === "ObjectExpression" ? Effect.forEach(cases.properties, reportKey, {
241
+ concurrency: 1,
242
+ discard: true
243
+ }) : Effect.void
244
+ });
245
+ } };
246
+ },
247
+ meta: Rule.meta({
248
+ description: "Every Message union key is a past-tense fact with its source prefix, never Set* or Mutate*",
249
+ messages: {
250
+ imperative: "`{{name}}` is an imperative name. Name the Message for the fact that happened, with its source prefix: Clicked*, Updated*, Pressed*, Submitted*, Got*, Completed*, Succeeded* or Failed*.",
251
+ notPastTense: "`{{name}}` doesn't start with a past-tense source prefix. Name the Message for the fact that happened: Clicked*, Updated*, Pressed*, Submitted*, Got*, Completed*, Succeeded* or Failed*."
252
+ },
253
+ type: "suggestion"
254
+ }),
255
+ name: "require-past-tense-messages"
256
+ });
257
+ // src/plugin.ts
258
+ const plugin = Plugin.define({
259
+ name: "birbprophet",
260
+ rules: {
261
+ "no-comments": noCommentsRule,
262
+ "prefer-accessible-scene-locators": preferAccessibleSceneLocatorsRule,
263
+ "require-command-answer-names": requireCommandAnswerNamesRule,
264
+ "require-past-tense-messages": requirePastTenseMessagesRule
265
+ },
266
+ specifier: "@milkenjoyer/toolchain/plugin"
267
+ });
268
+ export { plugin as t };
@@ -0,0 +1,8 @@
1
+ import { Plugin } from "effect-oxlint";
2
+ declare const plugin: Plugin.DefinedPlugin<{
3
+ readonly "no-comments": import("effect-oxlint").CreateRule;
4
+ readonly "prefer-accessible-scene-locators": import("effect-oxlint").CreateRule;
5
+ readonly "require-command-answer-names": import("effect-oxlint").CreateRule;
6
+ readonly "require-past-tense-messages": import("effect-oxlint").CreateRule;
7
+ }>;
8
+ export { plugin as default };
@@ -0,0 +1 @@
1
+ export { t as default } from "./plugin-C3DDlAbr.mjs";
@@ -0,0 +1,106 @@
1
+ export declare const staticRules: {
2
+ "effecttsgo/strict-effect-provide": "off";
3
+ "eslint/array-callback-return": "error";
4
+ "eslint/constructor-super": "off";
5
+ "eslint/eqeqeq": ["error", "always"];
6
+ "eslint/getter-return": "off";
7
+ "eslint/no-case-declarations": "error";
8
+ "eslint/no-class-assign": "off";
9
+ "eslint/no-console": "error";
10
+ "eslint/no-const-assign": "off";
11
+ "eslint/no-constructor-return": "error";
12
+ "eslint/no-delete-var": "off";
13
+ "eslint/no-dupe-class-members": "off";
14
+ "eslint/no-dupe-keys": "off";
15
+ "eslint/no-empty": "error";
16
+ "eslint/no-fallthrough": "error";
17
+ "eslint/no-func-assign": "off";
18
+ "eslint/no-implied-eval": "off";
19
+ "eslint/no-import-assign": "off";
20
+ "eslint/no-new-func": "error";
21
+ "eslint/no-new-native-nonconstructor": "off";
22
+ "eslint/no-new-wrappers": "error";
23
+ "eslint/no-obj-calls": "off";
24
+ "eslint/no-promise-executor-return": "error";
25
+ "eslint/no-proto": "error";
26
+ "eslint/no-prototype-builtins": "error";
27
+ "eslint/no-restricted-globals": ["error", "__dirname", "__filename"];
28
+ "eslint/no-restricted-imports": ["error", {
29
+ paths: {
30
+ name: string;
31
+ message: string;
32
+ }[];
33
+ }];
34
+ "eslint/no-return-assign": "error";
35
+ "eslint/no-script-url": "error";
36
+ "eslint/no-self-compare": "error";
37
+ "eslint/no-sequences": "error";
38
+ "eslint/no-setter-return": "off";
39
+ "eslint/no-shadow": "off";
40
+ "eslint/no-template-curly-in-string": "error";
41
+ "eslint/no-this-before-super": "off";
42
+ "eslint/no-underscore-dangle": "off";
43
+ "eslint/no-unneeded-ternary": "off";
44
+ "eslint/no-unreachable-loop": "error";
45
+ "eslint/no-unsafe-negation": "off";
46
+ "eslint/no-useless-call": "error";
47
+ "eslint/no-useless-concat": "off";
48
+ "eslint/no-var": "error";
49
+ "eslint/no-with": "off";
50
+ "eslint/valid-typeof": "off";
51
+ "import/default": "off";
52
+ "import/namespace": "off";
53
+ "import/no-cycle": "error";
54
+ "import/no-mutable-exports": "error";
55
+ "import/no-unassigned-import": "off";
56
+ "node/no-process-env": "error";
57
+ "oxc/bad-bitwise-operator": "error";
58
+ "oxc/no-accumulating-spread": "error";
59
+ "promise/always-return": "off";
60
+ "promise/no-return-in-finally": "error";
61
+ "typescript/ban-ts-comment": "error";
62
+ "typescript/method-signature-style": "error";
63
+ "typescript/no-deprecated": "error";
64
+ "typescript/no-empty-object-type": "error";
65
+ "typescript/no-explicit-any": "error";
66
+ "typescript/no-extraneous-class": "off";
67
+ "typescript/no-import-type-side-effects": "error";
68
+ "typescript/no-invalid-void-type": "error";
69
+ "typescript/no-misused-promises": "error";
70
+ "typescript/no-non-null-assertion": "error";
71
+ "typescript/no-unnecessary-boolean-literal-compare": "off";
72
+ "typescript/no-unnecessary-condition": "error";
73
+ "typescript/no-unnecessary-template-expression": "off";
74
+ "typescript/no-unnecessary-type-arguments": "off";
75
+ "typescript/no-unnecessary-type-constraint": "off";
76
+ "typescript/no-unnecessary-type-conversion": "off";
77
+ "typescript/no-unsafe-argument": "error";
78
+ "typescript/no-unsafe-assignment": "error";
79
+ "typescript/no-unsafe-call": "error";
80
+ "typescript/no-unsafe-function-type": "error";
81
+ "typescript/no-unsafe-member-access": "error";
82
+ "typescript/no-unsafe-return": "error";
83
+ "typescript/only-throw-error": "error";
84
+ "typescript/prefer-nullish-coalescing": "error";
85
+ "typescript/prefer-promise-reject-errors": "error";
86
+ "typescript/related-getter-setter-pairs": "error";
87
+ "typescript/require-await": "error";
88
+ "typescript/restrict-plus-operands": "error";
89
+ "typescript/strict-boolean-expressions": "error";
90
+ "typescript/switch-exhaustiveness-check": "error";
91
+ "typescript/use-unknown-in-catch-callback-variable": "error";
92
+ "unicorn/consistent-function-scoping": "off";
93
+ "unicorn/new-for-builtins": "error";
94
+ "unicorn/no-abusive-eslint-disable": "error";
95
+ "unicorn/no-document-cookie": "error";
96
+ "unicorn/no-negation-in-equality-check": "error";
97
+ "unicorn/no-new-buffer": "error";
98
+ "unicorn/no-object-as-default-parameter": "error";
99
+ "unicorn/no-unnecessary-await": "off";
100
+ "unicorn/prefer-module": "error";
101
+ "unicorn/prefer-number-properties": "error";
102
+ "vitest/expect-expect": "off";
103
+ "vitest/no-identical-title": "error";
104
+ "vitest/no-import-node-test": "error";
105
+ "vitest/no-standalone-expect": "off";
106
+ };
package/dist/rules.mjs ADDED
@@ -0,0 +1,112 @@
1
+ const staticRules = {
2
+ "effecttsgo/strict-effect-provide": "off",
3
+ "eslint/array-callback-return": "error",
4
+ "eslint/constructor-super": "off",
5
+ "eslint/eqeqeq": ["error", "always"],
6
+ "eslint/getter-return": "off",
7
+ "eslint/no-case-declarations": "error",
8
+ "eslint/no-class-assign": "off",
9
+ "eslint/no-console": "error",
10
+ "eslint/no-const-assign": "off",
11
+ "eslint/no-constructor-return": "error",
12
+ "eslint/no-delete-var": "off",
13
+ "eslint/no-dupe-class-members": "off",
14
+ "eslint/no-dupe-keys": "off",
15
+ "eslint/no-empty": "error",
16
+ "eslint/no-fallthrough": "error",
17
+ "eslint/no-func-assign": "off",
18
+ "eslint/no-implied-eval": "off",
19
+ "eslint/no-import-assign": "off",
20
+ "eslint/no-new-func": "error",
21
+ "eslint/no-new-native-nonconstructor": "off",
22
+ "eslint/no-new-wrappers": "error",
23
+ "eslint/no-obj-calls": "off",
24
+ "eslint/no-promise-executor-return": "error",
25
+ "eslint/no-proto": "error",
26
+ "eslint/no-prototype-builtins": "error",
27
+ "eslint/no-restricted-globals": [
28
+ "error",
29
+ "__dirname",
30
+ "__filename"
31
+ ],
32
+ "eslint/no-restricted-imports": ["error", { paths: [{
33
+ name: "vitest",
34
+ message: "Import test utilities from '@effect/vitest' instead of raw 'vitest'."
35
+ }, {
36
+ name: "vite-plus/test",
37
+ message: "Import test utilities from '@effect/vitest' instead of 'vite-plus/test'."
38
+ }] }],
39
+ "eslint/no-return-assign": "error",
40
+ "eslint/no-script-url": "error",
41
+ "eslint/no-self-compare": "error",
42
+ "eslint/no-sequences": "error",
43
+ "eslint/no-setter-return": "off",
44
+ "eslint/no-shadow": "off",
45
+ "eslint/no-template-curly-in-string": "error",
46
+ "eslint/no-this-before-super": "off",
47
+ "eslint/no-underscore-dangle": "off",
48
+ "eslint/no-unneeded-ternary": "off",
49
+ "eslint/no-unreachable-loop": "error",
50
+ "eslint/no-unsafe-negation": "off",
51
+ "eslint/no-useless-call": "error",
52
+ "eslint/no-useless-concat": "off",
53
+ "eslint/no-var": "error",
54
+ "eslint/no-with": "off",
55
+ "eslint/valid-typeof": "off",
56
+ "import/default": "off",
57
+ "import/namespace": "off",
58
+ "import/no-cycle": "error",
59
+ "import/no-mutable-exports": "error",
60
+ "import/no-unassigned-import": "off",
61
+ "node/no-process-env": "error",
62
+ "oxc/bad-bitwise-operator": "error",
63
+ "oxc/no-accumulating-spread": "error",
64
+ "promise/always-return": "off",
65
+ "promise/no-return-in-finally": "error",
66
+ "typescript/ban-ts-comment": "error",
67
+ "typescript/method-signature-style": "error",
68
+ "typescript/no-deprecated": "error",
69
+ "typescript/no-empty-object-type": "error",
70
+ "typescript/no-explicit-any": "error",
71
+ "typescript/no-extraneous-class": "off",
72
+ "typescript/no-import-type-side-effects": "error",
73
+ "typescript/no-invalid-void-type": "error",
74
+ "typescript/no-misused-promises": "error",
75
+ "typescript/no-non-null-assertion": "error",
76
+ "typescript/no-unnecessary-boolean-literal-compare": "off",
77
+ "typescript/no-unnecessary-condition": "error",
78
+ "typescript/no-unnecessary-template-expression": "off",
79
+ "typescript/no-unnecessary-type-arguments": "off",
80
+ "typescript/no-unnecessary-type-constraint": "off",
81
+ "typescript/no-unnecessary-type-conversion": "off",
82
+ "typescript/no-unsafe-argument": "error",
83
+ "typescript/no-unsafe-assignment": "error",
84
+ "typescript/no-unsafe-call": "error",
85
+ "typescript/no-unsafe-function-type": "error",
86
+ "typescript/no-unsafe-member-access": "error",
87
+ "typescript/no-unsafe-return": "error",
88
+ "typescript/only-throw-error": "error",
89
+ "typescript/prefer-nullish-coalescing": "error",
90
+ "typescript/prefer-promise-reject-errors": "error",
91
+ "typescript/related-getter-setter-pairs": "error",
92
+ "typescript/require-await": "error",
93
+ "typescript/restrict-plus-operands": "error",
94
+ "typescript/strict-boolean-expressions": "error",
95
+ "typescript/switch-exhaustiveness-check": "error",
96
+ "typescript/use-unknown-in-catch-callback-variable": "error",
97
+ "unicorn/consistent-function-scoping": "off",
98
+ "unicorn/new-for-builtins": "error",
99
+ "unicorn/no-abusive-eslint-disable": "error",
100
+ "unicorn/no-document-cookie": "error",
101
+ "unicorn/no-negation-in-equality-check": "error",
102
+ "unicorn/no-new-buffer": "error",
103
+ "unicorn/no-object-as-default-parameter": "error",
104
+ "unicorn/no-unnecessary-await": "off",
105
+ "unicorn/prefer-module": "error",
106
+ "unicorn/prefer-number-properties": "error",
107
+ "vitest/expect-expect": "off",
108
+ "vitest/no-identical-title": "error",
109
+ "vitest/no-import-node-test": "error",
110
+ "vitest/no-standalone-expect": "off"
111
+ };
112
+ export { staticRules };
@@ -0,0 +1,46 @@
1
+ import * as Option from "effect/Option";
2
+ export type Family = {
3
+ readonly name: string;
4
+ readonly version: string;
5
+ readonly packages: ReadonlyArray<string>;
6
+ readonly scopes: ReadonlyArray<string>;
7
+ };
8
+ export type Fixed = {
9
+ readonly name: string;
10
+ readonly version: string;
11
+ readonly by: string;
12
+ };
13
+ export declare const nodeVersion = "26.13.0";
14
+ export declare const families: ReadonlyArray<Family>;
15
+ export declare const fixed: ReadonlyArray<Fixed>;
16
+ export type Catalog = {
17
+ readonly families: ReadonlyArray<Family>;
18
+ readonly fixed: ReadonlyArray<Fixed>;
19
+ };
20
+ export declare const catalog: Catalog;
21
+ export declare const lead: (family: Family) => string;
22
+ export declare const familyOf: {
23
+ (current?: Catalog): (name: string) => Option.Option<Family>;
24
+ (name: string, current?: Catalog): Option.Option<Family>;
25
+ };
26
+ type NamedLookup<A> = {
27
+ (current?: Catalog): (name: string) => Option.Option<A>;
28
+ (name: string, current?: Catalog): Option.Option<A>;
29
+ };
30
+ export declare const fixedOf: NamedLookup<Fixed>;
31
+ export declare const familyNamed: NamedLookup<Family>;
32
+ export declare const fixedBy: {
33
+ (current?: Catalog): (family: string) => ReadonlyArray<Fixed>;
34
+ (family: string, current?: Catalog): ReadonlyArray<Fixed>;
35
+ };
36
+ export declare const ownerOf: {
37
+ (current?: Catalog): (name: string) => Option.Option<Family>;
38
+ (name: string, current?: Catalog): Option.Option<Family>;
39
+ };
40
+ export declare const versionOf: {
41
+ (current?: Catalog): (name: string) => Option.Option<string>;
42
+ (name: string, current?: Catalog): Option.Option<string>;
43
+ };
44
+ export declare const pinned: (current: Catalog) => Readonly<Record<string, string>>;
45
+ export declare const versions: Readonly<Record<string, string>>;
46
+ export {};