@milkenjoyer/toolchain 0.6.5 → 0.7.1

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,264 @@
1
+ import { i as unwrapExpression, n as memberPropertyName, r as propertyName, t as isStringLiteral } from "./syntax-CGEOffZK.mjs";
2
+ import * as Arr from "effect/Array";
3
+ import { dual } from "effect/Function";
4
+ import * as HashSet from "effect/HashSet";
5
+ import * as Option from "effect/Option";
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/member-path.ts
30
+ const resolveBinding = (sourceCode, node) => {
31
+ const findBinding = (scope) => Option.flatMap(scope, (current) => Option.orElse(Option.fromUndefinedOr(current.set.get(node.name)), () => findBinding(Option.fromNullishOr(current.upper))));
32
+ return findBinding(Option.fromNullishOr(sourceCode.getScope(node)));
33
+ };
34
+ const memberPath = (node) => {
35
+ const current = unwrapExpression(node);
36
+ if (current.type === "Identifier") return Option.some({
37
+ root: current,
38
+ members: []
39
+ });
40
+ if (current.type !== "MemberExpression") return Option.none();
41
+ return Option.flatMap(memberPath(current.object), (path) => Option.map(memberPropertyName(current), (name) => ({
42
+ root: path.root,
43
+ members: [...path.members, name]
44
+ })));
45
+ };
46
+ const lastName = (node) => Option.map(memberPath(node), (path) => Option.getOrElse(Arr.last(path.members), () => path.root.name));
47
+ const importedPath = dual(2, (sourceCode, node) => Option.gen(function* () {
48
+ const path = yield* memberPath(node);
49
+ const variable = yield* resolveBinding(sourceCode, path.root);
50
+ const definition = yield* Arr.findFirst(variable.defs, (candidate) => candidate.type === "ImportBinding");
51
+ const declaration = definition.parent;
52
+ const specifier = definition.node;
53
+ if (declaration?.type !== "ImportDeclaration") return yield* Option.none();
54
+ if (specifier.type === "ImportNamespaceSpecifier") return {
55
+ source: declaration.source.value,
56
+ members: path.members
57
+ };
58
+ if (specifier.type !== "ImportSpecifier") return yield* Option.none();
59
+ const imported = specifier.imported.type === "Identifier" ? specifier.imported.name : specifier.imported.value;
60
+ return {
61
+ source: declaration.source.value,
62
+ members: [imported, ...path.members]
63
+ };
64
+ }));
65
+ // src/shared/foldkit-api.ts
66
+ const NAMESPACES = HashMap.make(["foldkit", []], ["foldkit/command", ["Command"]], ["foldkit/html", ["Html"]], ["foldkit/message", ["Message"]], ["foldkit/scene", ["Scene"]], ["foldkit/schema", ["Schema"]], ["foldkit/test", []]);
67
+ const isFoldkitCall = (sourceCode, node, ...wanted) => Option.exists(importedPath(sourceCode, node.callee), (path) => Option.exists(HashMap.get(NAMESPACES, path.source), (prefix) => {
68
+ const full = Arr.join([...prefix, ...path.members], ".");
69
+ return Arr.some(wanted, (candidate) => Arr.join(candidate, ".") === full);
70
+ }));
71
+ const textWithHoles = dual(2, (node, hole) => {
72
+ if (isStringLiteral(node)) return Option.some(node.value);
73
+ return node.type === "TemplateLiteral" ? Option.some(Arr.join(Arr.map(node.quasis, (quasi) => quasi.value.raw), hole)) : Option.none();
74
+ });
75
+ // src/rules/prefer-accessible-scene-locators.ts
76
+ 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");
77
+ const ACCESSIBLE_ATTRIBUTES = /\[\s*(?:role|aria-label|aria-labelledby|alt|placeholder|title)\s*(?:[~|^$*]?=|\])/iu;
78
+ const QUOTED = /"[^"]*"|'[^']*'/gu;
79
+ const COMBINATOR = /[\s>+~]/u;
80
+ const TAG = /^[a-z][a-z0-9-]*/iu;
81
+ const SUBJECT_PSEUDO = /^(?:is|where|matches)\(/u;
82
+ const splitTopLevel = (text, isSeparator) => Arr.reduce(Arr.filter(Str.split(text, ""), Str.isNonEmpty), {
83
+ depth: 0,
84
+ parts: [""]
85
+ }, ({ depth, parts }, char) => {
86
+ if (depth === 0 && isSeparator(char)) return {
87
+ depth,
88
+ parts: [...parts, ""]
89
+ };
90
+ const opened = char === "(" || char === "[" ? 1 : 0;
91
+ const closed = char === ")" || char === "]" ? 1 : 0;
92
+ return {
93
+ depth: depth + opened - closed,
94
+ parts: [...parts.slice(0, -1), `${parts.at(-1) ?? ""}${char}`]
95
+ };
96
+ }).parts;
97
+ const fitsAccessibleLocator = (selector) => Arr.some(splitTopLevel(selector, (char) => char === ","), (part) => {
98
+ const compound = Option.getOrElse(Arr.last(Arr.filter(splitTopLevel(Str.trim(part), (char) => COMBINATOR.test(char)), (piece) => piece !== "")), () => "");
99
+ const [tag = ""] = TAG.exec(compound) ?? [];
100
+ return HashSet.has(ROLE_TAGS, Str.toLowerCase(tag)) || Arr.some(splitTopLevel(compound, (char) => char === ":"), (piece) => {
101
+ const open = Str.indexOf("(")(piece);
102
+ if (Option.isNone(open)) return ACCESSIBLE_ATTRIBUTES.test(piece);
103
+ const close = Str.lastIndexOf(")")(piece).pipe(Option.getOrElse(() => -1));
104
+ 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));
105
+ });
106
+ });
107
+ const preferAccessibleSceneLocatorsRule = Rule.define({
108
+ *create() {
109
+ const context = yield* RuleContext;
110
+ return { CallExpression: (node) => {
111
+ if (node.type !== "CallExpression" || !isFoldkitCall(context.sourceCode, node, ["Scene", "selector"], ["Scene", "allSelector"], [
112
+ "Scene",
113
+ "all",
114
+ "selector"
115
+ ])) return Effect.void;
116
+ const assertion = node.parent;
117
+ if (assertion.type === "CallExpression" && assertion.arguments[0] === node && isFoldkitCall(context.sourceCode, assertion, ["Scene", "expect"])) {
118
+ const member = assertion.parent;
119
+ if (member.type === "MemberExpression" && member.object === assertion) {
120
+ const absent = Option.contains(memberPropertyName(member), "toBeAbsent") && member.parent.type === "CallExpression" && member.parent.callee === member;
121
+ const negated = member.parent;
122
+ const matcher = negated.parent;
123
+ if (absent || Option.contains(memberPropertyName(member), "not") && negated.type === "MemberExpression" && negated.object === member && Option.contains(memberPropertyName(negated), "toExist") && matcher?.type === "CallExpression" && matcher.callee === negated) return Effect.void;
124
+ }
125
+ }
126
+ const [css] = node.arguments;
127
+ if (css === void 0) return Effect.void;
128
+ return Option.match(Option.filter(textWithHoles(css, "x"), (text) => fitsAccessibleLocator(Str.replaceAll(QUOTED, "\"\"")(text))), {
129
+ onNone: () => Effect.void,
130
+ onSome: () => context.report(Diagnostic.fromId({
131
+ data: { target: context.sourceCode.getText(css) },
132
+ messageId: "accessibleLocator",
133
+ node
134
+ }))
135
+ });
136
+ } };
137
+ },
138
+ meta: Rule.meta({
139
+ description: "Scene tests find elements by role, label or text, keeping selector() for targets no accessible locator fits",
140
+ 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." },
141
+ type: "suggestion"
142
+ }),
143
+ name: "prefer-accessible-scene-locators"
144
+ });
145
+ // src/rules/require-command-answer-names.ts
146
+ const OUTCOMES = [
147
+ "Completed",
148
+ "Succeeded",
149
+ "Failed"
150
+ ];
151
+ const answersOf = (call) => {
152
+ const [name] = call.arguments;
153
+ const list = Option.flatMap(Option.map(Arr.get(call.arguments, 1), unwrapExpression), (settings) => Arr.findFirst(settings.type === "ObjectExpression" ? settings.properties : [], (property) => {
154
+ const value = property.type === "Property" && Option.contains(propertyName(property), "messages") ? unwrapExpression(property.value) : property;
155
+ return value.type === "ArrayExpression" ? Option.some(value) : Option.none();
156
+ }));
157
+ const command = name !== void 0 && isStringLiteral(name) ? Option.some(name.value) : Option.none();
158
+ return Option.map(Option.all([command, list]), ([text, array]) => ({
159
+ command: text,
160
+ list: array,
161
+ answers: Arr.flatMap(array.elements, (element) => element === null || element.type === "SpreadElement" ? [] : Arr.fromOption(Option.map(lastName(element), (answer) => ({
162
+ name: answer,
163
+ node: element,
164
+ outcome: Arr.findFirst(OUTCOMES, (outcome) => answer === `${outcome}${text}`)
165
+ }))))
166
+ }));
167
+ };
168
+ const requireCommandAnswerNamesRule = Rule.define({
169
+ *create() {
170
+ const context = yield* RuleContext;
171
+ const check = ({ command, list, answers }) => {
172
+ const outcomes = HashSet.fromIterable(Arr.flatMap(answers, ({ outcome }) => Arr.fromOption(outcome)));
173
+ const mixed = HashSet.has(outcomes, "Completed") && (HashSet.has(outcomes, "Succeeded") || HashSet.has(outcomes, "Failed"));
174
+ return Effect.andThen(Effect.forEach(Arr.filter(answers, ({ outcome }) => Option.isNone(outcome)), ({ name, node }) => context.report(Diagnostic.fromId({
175
+ data: {
176
+ command,
177
+ name
178
+ },
179
+ messageId: "wrongAnswer",
180
+ node
181
+ })), {
182
+ concurrency: 1,
183
+ discard: true
184
+ }), mixed ? context.report(Diagnostic.fromId({
185
+ data: { command },
186
+ messageId: "mixedAnswers",
187
+ node: list
188
+ })) : Effect.void);
189
+ };
190
+ return { CallExpression: (node) => node.type === "CallExpression" && isFoldkitCall(context.sourceCode, node, ["Command", "define"]) ? Option.match(answersOf(node), {
191
+ onNone: () => Effect.void,
192
+ onSome: check
193
+ }) : Effect.void };
194
+ },
195
+ meta: Rule.meta({
196
+ description: "A Command X is answered only by CompletedX, or by SucceededX and FailedX",
197
+ messages: {
198
+ 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}}.",
199
+ wrongAnswer: "Command `{{command}}` answers `{{name}}`. Name its result Completed{{command}} if it can't fail, or Succeeded{{command}} and Failed{{command}} if it can."
200
+ },
201
+ type: "suggestion"
202
+ }),
203
+ name: "require-command-answer-names"
204
+ });
205
+ // src/rules/require-past-tense-messages.ts
206
+ 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");
207
+ const PRESENT_ENDING_IN_ED = HashSet.make("Bed", "Bleed", "Breed", "Embed", "Exceed", "Feed", "Heed", "Need", "Proceed", "Red", "Seed", "Shed", "Shred", "Speed", "Succeed", "Weed");
208
+ const IMPERATIVE = /^(?:Set|Mutate)(?![a-z])/u;
209
+ const FIRST_WORD = /^[A-Z][a-z]*/u;
210
+ const problemOf = (name) => {
211
+ if (IMPERATIVE.test(name)) return Option.some("imperative");
212
+ const [word = ""] = FIRST_WORD.exec(name) ?? [];
213
+ return HashSet.has(IRREGULAR_PAST, word) || Str.endsWith("ed")(word) && !HashSet.has(PRESENT_ENDING_IN_ED, word) ? Option.none() : Option.some("notPastTense");
214
+ };
215
+ const requirePastTenseMessagesRule = Rule.define({
216
+ *create() {
217
+ const context = yield* RuleContext;
218
+ const reportKey = (property) => {
219
+ if (property.type !== "Property") return Effect.void;
220
+ return Option.match(Option.flatMap(propertyName(property), (name) => Option.map(problemOf(name), (messageId) => ({
221
+ messageId,
222
+ name
223
+ }))), {
224
+ onNone: () => Effect.void,
225
+ onSome: ({ messageId, name }) => context.report(Diagnostic.fromId({
226
+ data: { name },
227
+ messageId,
228
+ node: property.key
229
+ }))
230
+ });
231
+ };
232
+ return { CallExpression: (node) => {
233
+ if (node.type !== "CallExpression" || !isFoldkitCall(context.sourceCode, node, ["Message", "defineMessageUnion"], ["Schema", "defineMessageUnion"])) return Effect.void;
234
+ return Option.match(Option.map(Arr.head(node.arguments), unwrapExpression), {
235
+ onNone: () => Effect.void,
236
+ onSome: (cases) => cases.type === "ObjectExpression" ? Effect.forEach(cases.properties, reportKey, {
237
+ concurrency: 1,
238
+ discard: true
239
+ }) : Effect.void
240
+ });
241
+ } };
242
+ },
243
+ meta: Rule.meta({
244
+ description: "Every Message union key is a past-tense fact with its source prefix, never Set* or Mutate*",
245
+ messages: {
246
+ 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*.",
247
+ 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*."
248
+ },
249
+ type: "suggestion"
250
+ }),
251
+ name: "require-past-tense-messages"
252
+ });
253
+ // src/plugin.ts
254
+ const plugin = Plugin.define({
255
+ name: "birbprophet",
256
+ rules: {
257
+ "no-comments": noCommentsRule,
258
+ "prefer-accessible-scene-locators": preferAccessibleSceneLocatorsRule,
259
+ "require-command-answer-names": requireCommandAnswerNamesRule,
260
+ "require-past-tense-messages": requirePastTenseMessagesRule
261
+ },
262
+ specifier: "@milkenjoyer/toolchain/plugin"
263
+ });
264
+ export { plugin as t };
package/dist/plugin.d.mts CHANGED
@@ -1,19 +1,8 @@
1
1
  import { Plugin } from "effect-oxlint";
2
2
  declare const plugin: Plugin.DefinedPlugin<{
3
- readonly "no-ambient-crypto": import("effect-oxlint").CreateRule;
4
- readonly "no-array-filter-map": import("effect-oxlint").CreateRule;
5
3
  readonly "no-comments": import("effect-oxlint").CreateRule;
6
- readonly "no-impure-update-file": import("effect-oxlint").CreateRule;
7
- readonly "no-impure-view-file": import("effect-oxlint").CreateRule;
8
- readonly "no-inline-exported-object-types": import("effect-oxlint").CreateRule;
9
- readonly "no-keyed-row-index": import("effect-oxlint").CreateRule;
10
- readonly "no-manual-tagged-construction": import("effect-oxlint").CreateRule;
11
- readonly "no-reexports": import("effect-oxlint").CreateRule;
12
- readonly "no-silent-error-swallow": import("effect-oxlint").CreateRule;
13
- readonly "no-single-use-trivial-helpers": import("effect-oxlint").CreateRule;
14
4
  readonly "prefer-accessible-scene-locators": import("effect-oxlint").CreateRule;
15
5
  readonly "require-command-answer-names": import("effect-oxlint").CreateRule;
16
6
  readonly "require-past-tense-messages": import("effect-oxlint").CreateRule;
17
- readonly "require-readable-spacing": import("effect-oxlint").CreateRule;
18
7
  }>;
19
8
  export { plugin as default };
package/dist/plugin.mjs CHANGED
@@ -1 +1 @@
1
- export { t as default } from "./plugin-CBUJ7Tgd.mjs";
1
+ export { t as default } from "./plugin-DpJJbtFQ.mjs";
package/dist/rules.d.mts CHANGED
@@ -1,246 +1,110 @@
1
1
  export declare const staticRules: {
2
- "oxc/no-async-await": "off";
3
- "oxc/no-accumulating-spread": "error";
2
+ "effecttsgo/strict-effect-provide": "off";
3
+ "eslint/array-callback-return": "error";
4
+ "eslint/constructor-super": "off";
4
5
  "eslint/eqeqeq": ["error", "always"];
5
- "eslint/no-unused-expressions": "error";
6
- "eslint/no-sequences": "error";
7
- "eslint/no-unreachable": "error";
8
- "eslint/no-constant-condition": "error";
9
- "eslint/func-names": "off";
10
- "eslint/no-undefined": "off";
11
- "eslint/sort-imports": "off";
12
- "eslint/sort-keys": "off";
13
- "eslint/no-extend-native": "error";
14
- "eslint/no-global-assign": "error";
15
- "eslint/no-implicit-globals": "error";
16
- "eslint/use-isnan": "error";
17
- "eslint/no-compare-neg-zero": "error";
6
+ "eslint/getter-return": "off";
18
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";
19
16
  "eslint/no-fallthrough": "error";
20
- "eslint/default-case": "error";
21
- "eslint/no-unsafe-finally": "error";
22
- "eslint/no-void": "error";
23
- "eslint/no-script-url": "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";
24
26
  "eslint/no-prototype-builtins": "error";
25
- "unicorn/no-object-as-default-parameter": "error";
26
- "unicorn/no-useless-fallback-in-spread": "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";
27
53
  "import/no-cycle": "error";
28
- "import/no-self-import": "error";
29
- "import/no-duplicates": "error";
30
- "import/group-exports": "off";
31
- "import/no-default-export": "off";
32
- "import/no-named-export": "off";
33
- "import/no-relative-parent-imports": "off";
34
- "import/exports-last": "off";
35
- "import/prefer-default-export": "off";
36
- "import/consistent-type-specifier-style": "off";
37
- "typescript/prefer-readonly-parameter-types": "off";
38
- "typescript/no-meaningless-void-operator": "error";
39
- "typescript/no-duplicate-enum-values": "error";
40
- "typescript/prefer-optional-chain": "error";
41
- "typescript/no-misused-new": "error";
42
- "typescript/no-non-null-asserted-optional-chain": "error";
43
- "promise/no-callback-in-promise": "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";
44
60
  "promise/no-return-in-finally": "error";
45
- "promise/no-multiple-resolved": "error";
46
- "unicorn/consistent-function-scoping": "error";
47
- "unicorn/filename-case": ["error", {
48
- case: string;
49
- multipleFileExtensions: boolean;
50
- }];
51
- "unicorn/no-array-for-each": "off";
52
- "unicorn/no-null": "off";
53
- "unicorn/error-message": "error";
54
- "unicorn/catch-error-name": ["error", {
55
- name: string;
56
- }];
57
- "unicorn/throw-new-error": "off";
58
- "unicorn/prefer-node-protocol": "error";
59
- "unicorn/prefer-module": "error";
60
- "unicorn/numeric-separators-style": "error";
61
- "unicorn/prefer-structured-clone": "error";
62
- "unicorn/prefer-string-replace-all": "error";
63
- "unicorn/no-thenable": "error";
64
- "unicorn/no-useless-switch-case": "error";
65
- "unicorn/no-useless-undefined": "error";
66
- "unicorn/no-useless-spread": "error";
67
- "unicorn/no-document-cookie": "error";
68
- "unicorn/new-for-builtins": "error";
69
- "unicorn/no-instanceof-builtins": "error";
70
- "unicorn/no-invalid-remove-event-listener": "error";
61
+ "promise/valid-params": "off";
62
+ "typescript/ban-ts-comment": "error";
63
+ "typescript/method-signature-style": "error";
64
+ "typescript/no-deprecated": "error";
65
+ "typescript/no-empty-object-type": "error";
71
66
  "typescript/no-explicit-any": "error";
67
+ "typescript/no-extraneous-class": "off";
68
+ "typescript/no-import-type-side-effects": "error";
69
+ "typescript/no-invalid-void-type": "error";
70
+ "typescript/no-misused-promises": "error";
72
71
  "typescript/no-non-null-assertion": "error";
72
+ "typescript/no-unnecessary-boolean-literal-compare": "off";
73
+ "typescript/no-unnecessary-condition": "error";
74
+ "typescript/no-unnecessary-template-expression": "off";
75
+ "typescript/no-unnecessary-type-arguments": "off";
76
+ "typescript/no-unnecessary-type-constraint": "off";
77
+ "typescript/no-unnecessary-type-conversion": "off";
78
+ "typescript/no-unsafe-argument": "error";
73
79
  "typescript/no-unsafe-assignment": "error";
74
80
  "typescript/no-unsafe-call": "error";
81
+ "typescript/no-unsafe-function-type": "error";
75
82
  "typescript/no-unsafe-member-access": "error";
76
83
  "typescript/no-unsafe-return": "error";
77
- "typescript/no-unsafe-argument": "error";
78
- "typescript/no-unnecessary-type-assertion": "error";
79
- "typescript/strict-boolean-expressions": "error";
80
- "typescript/switch-exhaustiveness-check": "error";
81
- "typescript/explicit-function-return-type": "error";
82
- "typescript/explicit-module-boundary-types": "error";
83
- "typescript/no-import-type-side-effects": "error";
84
- "typescript/unbound-method": "error";
85
- "typescript/no-misused-spread": "error";
86
- "typescript/no-unnecessary-condition": "error";
84
+ "typescript/only-throw-error": "error";
87
85
  "typescript/prefer-nullish-coalescing": "error";
86
+ "typescript/prefer-promise-reject-errors": "error";
87
+ "typescript/related-getter-setter-pairs": "error";
88
88
  "typescript/require-await": "error";
89
- "typescript/no-unsafe-declaration-merging": "error";
90
- "typescript/no-unnecessary-qualifier": "error";
91
- "import/first": "error";
92
- "import/no-absolute-path": "error";
93
- "import/no-mutable-exports": "error";
94
- "import/no-commonjs": "error";
95
- "import/no-dynamic-require": "error";
96
- "import/max-dependencies": ["error", {
97
- max: number;
98
- }];
99
- "promise/no-nesting": "error";
100
- "promise/no-new-statics": "error";
101
- "promise/param-names": "error";
102
- "promise/valid-params": "error";
103
- "promise/catch-or-return": "error";
104
- "promise/always-return": "off";
105
- "typescript/no-floating-promises": "error";
106
- "typescript/promise-function-async": "off";
107
- "typescript/return-await": "off";
108
- "promise/prefer-await-to-then": "off";
109
- "typescript/consistent-type-imports": "error";
110
- "typescript/no-misused-promises": "error";
111
- "typescript/use-unknown-in-catch-callback-variable": "error";
112
- "typescript/no-unsafe-type-assertion": "error";
113
- "typescript/no-redundant-type-constituents": "error";
114
- "typescript/no-deprecated": "error";
115
89
  "typescript/restrict-plus-operands": "error";
116
- "typescript/no-confusing-void-expression": ["error", {
117
- ignoreArrowShorthand: true;
118
- }];
119
- "typescript/no-confusing-non-null-assertion": "error";
120
- "typescript/no-unnecessary-boolean-literal-compare": "off";
121
- "typescript/no-unnecessary-type-arguments": "error";
122
- "typescript/no-unnecessary-type-constraint": "error";
123
- "typescript/prefer-for-of": "error";
124
- "typescript/prefer-includes": "error";
125
- "typescript/consistent-type-assertions": ["error", {
126
- assertionStyle: "as";
127
- }];
128
- "typescript/no-empty-object-type": "error";
129
- "typescript/no-require-imports": "error";
130
- "typescript/no-namespace": "error";
131
- "typescript/array-type": ["error", {
132
- default: "generic";
133
- }];
134
- "import/no-anonymous-default-export": "error";
135
- "promise/no-return-wrap": "error";
136
- "eslint/array-callback-return": "error";
137
- "eslint/no-useless-return": "error";
138
- "eslint/no-await-in-loop": "off";
139
- "eslint/no-continue": "off";
140
- "eslint/no-negated-condition": "off";
141
- "eslint/no-param-reassign": "error";
142
- "eslint/no-empty": "error";
143
- "eslint/no-useless-catch": "error";
144
- "eslint/no-empty-function": "error";
145
- "eslint/no-ternary": "off";
146
- "eslint/no-console": "error";
147
- "eslint/no-shadow": ["error", {
148
- hoist: "functions";
149
- }];
150
- "eslint/no-return-assign": "error";
151
- "eslint/no-loop-func": "error";
152
- "eslint/no-self-compare": "error";
153
- "eslint/no-constructor-return": "error";
154
- "eslint/no-alert": "error";
155
- "eslint/no-new-func": "error";
156
- "eslint/curly": ["error", "all"];
157
- "eslint/no-else-return": "error";
158
- "eslint/no-implicit-coercion": ["error", {
159
- boolean: true;
160
- number: true;
161
- string: true;
162
- }];
163
- "eslint/no-multi-assign": "error";
164
- "eslint/no-template-curly-in-string": "error";
165
- "eslint/no-labels": "error";
166
- "eslint/no-lone-blocks": "error";
167
- "eslint/id-length": "off";
168
- "eslint/max-statements": "off";
169
- "eslint/new-cap": "off";
170
- "eslint/prefer-object-has-own": "error";
171
- "eslint/prefer-object-spread": "off";
172
- "eslint/prefer-template": "error";
173
- "eslint/max-params": "off";
174
- "eslint/max-lines-per-function": ["error", {
175
- max: number;
176
- skipBlankLines: true;
177
- skipComments: true;
178
- }];
179
- "eslint/max-classes-per-file": ["error", number];
180
- "eslint/max-lines": ["error", {
181
- max: number;
182
- skipBlankLines: true;
183
- skipComments: true;
184
- }];
185
- "eslint/complexity": "off";
186
- "eslint/no-magic-numbers": "off";
187
- "eslint/no-nested-ternary": "error";
188
- "eslint/no-debugger": "error";
189
- "eslint/no-eval": "error";
190
- "eslint/no-implied-eval": "error";
191
- "eslint/prefer-promise-reject-errors": "error";
192
- "eslint/max-nested-callbacks": ["error", number];
193
- "eslint/no-restricted-imports": ["error", {
194
- paths: {
195
- name: string;
196
- message: string;
197
- }[];
198
- }];
199
- "typescript/consistent-type-definitions": ["error", "type"];
200
- "typescript/dot-notation": ["error", {
201
- allowIndexSignaturePropertyAccess: true;
202
- }];
203
- "unicorn/no-static-only-class": "error";
204
- "unicorn/no-useless-promise-resolve-reject": "error";
205
- "oxc/no-optional-chaining": "off";
206
- "oxc/no-rest-spread-properties": "off";
207
- "oxc/no-map-spread": "off";
208
- "node/no-process-env": "error";
209
- "node/no-path-concat": "error";
210
- "node/handle-callback-err": "error";
211
- "vitest/no-conditional-tests": "error";
90
+ "typescript/strict-boolean-expressions": "error";
91
+ "typescript/switch-exhaustiveness-check": "error";
92
+ "typescript/use-unknown-in-catch-callback-variable": "error";
93
+ "unicorn/consistent-function-scoping": "off";
94
+ "unicorn/new-for-builtins": "error";
95
+ "unicorn/no-abusive-eslint-disable": "error";
96
+ "unicorn/no-document-cookie": "error";
97
+ "unicorn/no-negation-in-equality-check": "error";
98
+ "unicorn/no-new-buffer": "error";
99
+ "unicorn/no-object-as-default-parameter": "error";
100
+ "unicorn/no-unnecessary-await": "off";
101
+ "unicorn/prefer-module": "error";
102
+ "unicorn/prefer-number-properties": "error";
103
+ "vitest/expect-expect": "off";
104
+ "vitest/no-identical-title": "error";
212
105
  "vitest/no-import-node-test": "error";
213
106
  "vitest/no-standalone-expect": "off";
214
- "vitest/max-expects": "off";
215
- "vitest/require-hook": "off";
216
- "vitest/no-importing-vitest-globals": "off";
217
- "vitest/expect-expect": "off";
218
- "vitest/prefer-called-once": "error";
219
- "vitest/consistent-test-filename": "error";
220
- "vitest/prefer-called-times": "error";
221
- "vitest/prefer-to-be-falsy": "error";
222
- "vitest/prefer-to-be-truthy": "error";
223
- "vitest/prefer-to-be-object": "error";
224
- "jsdoc/check-tag-names": "error";
225
- "jsdoc/check-property-names": "error";
226
- "jsdoc/check-access": "error";
227
- "jsdoc/empty-tags": "error";
228
- "jsdoc/implements-on-classes": "error";
229
- "jsdoc/require-property": "error";
230
- "jsdoc/require-property-description": "error";
231
- "jsdoc/require-property-name": "error";
232
- "jsdoc/require-yields": "error";
233
- "jsdoc/require-param": "off";
234
- "jsdoc/require-param-type": "off";
235
- "jsdoc/require-returns": "off";
236
- "jsdoc/require-returns-type": "off";
237
- "eslint/prefer-const": "error";
238
- "unicorn/no-array-reduce": "error";
239
- "typescript/only-throw-error": "error";
240
- "unicorn/no-array-method-this-argument": "off";
241
- "eslint/no-redeclare": "off";
242
- "promise/prefer-await-to-callbacks": "off";
243
- "unicorn/max-nested-calls": "off";
244
- "eslint/one-var": "off";
245
- "typescript/consistent-indexed-object-style": "off";
107
+ "vitest/valid-title": ["error", {
108
+ allowArguments: boolean;
109
+ }];
246
110
  };