@deslop/coding-standards 0.1.1062 → 0.1.1064

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.
@@ -5666,6 +5666,32 @@ const some = /*#__PURE__*/ dual(2, (self, predicate) => self.some(predicate));
5666
5666
  */
5667
5667
  const makeEquivalence = Array_;
5668
5668
  /**
5669
+ * Runs a side-effect for each element. The callback receives `(element, index)`.
5670
+ *
5671
+ * **When to use**
5672
+ *
5673
+ * Use to iterate over an array for side-effects only, when no transformed
5674
+ * result is needed.
5675
+ *
5676
+ * **Example** (Iterating with side-effects)
5677
+ *
5678
+ * ```ts import.meta.vitest
5679
+ * import { Array } from "effect"
5680
+ *
5681
+ * const visited: Array<number> = []
5682
+ * Array.forEach([1, 2, 3], (n) => visited.push(n))
5683
+ *
5684
+ * visited // => [1, 2, 3]
5685
+ * ```
5686
+ *
5687
+ * @see {@link map} for transforming each element into a new array
5688
+ *
5689
+ * @stability stable
5690
+ * @category traversing
5691
+ * @since 2.0.0
5692
+ */
5693
+ const forEach = /*#__PURE__*/ dual(2, (self, f) => fromIterable(self).forEach((a, i) => f(a, i)));
5694
+ /**
5669
5695
  * Removes duplicates using `Equal.equivalence()`, preserving the order of the
5670
5696
  * first occurrence.
5671
5697
  *
@@ -5912,6 +5938,23 @@ globalThis.String;
5912
5938
  */
5913
5939
  const Order = String$2;
5914
5940
  /**
5941
+ * Removes whitespace from both ends of a string.
5942
+ *
5943
+ * **Example** (Trimming whitespace)
5944
+ *
5945
+ * ```ts import.meta.vitest
5946
+ * import { String } from "effect"
5947
+ *
5948
+ * String.trim(" a ") // => "a"
5949
+ * String.trim(" hello world ") // => "hello world"
5950
+ * ```
5951
+ *
5952
+ * @stability stable
5953
+ * @category transforming
5954
+ * @since 2.0.0
5955
+ */
5956
+ const trim = (self) => self.trim();
5957
+ /**
5915
5958
  * Removes whitespace from the end of a string.
5916
5959
  *
5917
5960
  * **Example** (Trimming trailing whitespace)
@@ -6208,4 +6251,4 @@ const set = /*#__PURE__*/ dual(2, (self, value) => {
6208
6251
  */
6209
6252
  const update = /*#__PURE__*/ dual(2, (self, f) => set(self, f(get(self))));
6210
6253
  //#endregion
6211
- export { fromOption as $, isNotNull as $n, causeDie as $t, getSomes as A, format as An, isGreaterThanOrEqualTo as At, match$1 as B, combine as Bn, Done as Bt, findFirst as C, assignProperty as Cn, Prototype as Cr, some$1 as Ct, flatten as D, BaseProto as Dn, Number$1 as Dt, flatMap as E, setStackTraceLimit as En, Date$1 as Et, isReadonlyArrayNonEmpty as F, currentFiberTypeId as Fn, Tuple as Ft, sort as G, string as Gn, PipeInspectableProto as Gt, prepend as H, number as Hn, ExitTypeId as Ht, join as I, byReferenceUnsafe as In, make$2 as It, get$2 as J, hasProperty as Jn, TaggedError$1 as Jt, take as K, structure as Kn, ReasonBase as Kt, last as L, equals as Ln, strictEqual as Lt, isArrayEmpty as M, formatJson as Mn, isLessThanOrEqualTo as Mt, isArrayNonEmpty as N, formatPath as Nn, make$1 as Nt, fromIterable as O, NodeInspectSymbol as On, String$2 as Ot, isCanonicalArrayIndex as P, formatPropertyKey as Pn, mapInput as Pt, fail as Q, isIterable as Qn, causeCombine as Qt, makeEquivalence as R, symbol as Rn, CauseImpl as Rt, filterMap as S, withFiber as Sn, Class$1 as Sr, orElse as St, findLast as T, getStackTraceLimit as Tn, BigInt as Tt, reduce as U, optimize as Un, Fail as Ut, of as V, hash as Vn, Error$2 as Vt, some as W, random as Wn, InterruptorStackTrace as Wt, remove as X, isError as Xn, args as Xt, map$1 as Y, isBoolean as Yn, Yield as Yt, values as Z, isFunction as Zn, causeAnnotate as Zt, dropRight as _, isExit as _n, dual as _r, isSome as _t, includes as a, contAll as an, isObjectKeyword as ar, all as at, every as b, makePrimitive as bn, memoizeIdempotent as br, match$3 as bt, startsWith as c, evaluate as cn, isString as cr, filter$1 as ct, TaggedError as d, exitFailCause as dn, isUnknown as dr, flatten$1 as dt, causeEmpty as en, isNotNullish as er, getOrThrow as et, taggedEnum as f, exitSucceed as fn, constFalse as fr, fromNullishOr as ft, dedupe as g, isEffect as gn, constant as gr, isNone as gt, contains as h, isDone as hn, constVoid as hr, getOrUndefined as ht, Order as i, contA as in, isObject as ir, normalize as it, head as j, formatDate as jn, isLessThan as jt, get$1 as k, toStringUnknown as kn, isGreaterThan as kt, trimEnd as l, exitDie as ln, isTagged as lr, firstSomeOf as lt, appendAll as m, isDieReason as mn, constUndefined as mr, getOrElse as mt, make as n, causeFromReasons as nn, isNullish as nr, match$2 as nt, match as o, contE as on, isPropertyKey as or, contains$1 as ot, append as p, isCause as pn, constTrue as pr, fromUndefinedOr as pt, fromEntries as q, symbol$1 as qn, StackTraceKey as qt, update as r, constEmptyAnnotations as rn, isNumber as rr, succeed as rt, split as s, done as sn, isReadonlyObject as sr, exists as st, get as t, causeFail as tn, isNotUndefined as tr, isFailure as tt, Error$1 as u, exitFail as un, isUndefined as ur, flatMap$1 as ut, empty as v, isFailReason as vn, identity as vr, liftThrowable as vt, findFirstIndex as w, internalCall as wn, pipeArguments as wr, zipWith as wt, filter as x, makePrimitiveProto as xn, pipe as xr, none as xt, ensure as y, isInterruptReason as yn, memoize as yr, map$2 as yt, map as z, array as zn, Die as zt };
6254
+ export { values as $, isFunction as $n, causeAnnotate as $t, fromIterable as A, NodeInspectSymbol as An, String$2 as At, makeEquivalence as B, symbol as Bn, CauseImpl as Bt, filterMap as C, makePrimitiveProto as Cn, pipe as Cr, none as Ct, flatMap as D, getStackTraceLimit as Dn, BigInt as Dt, findLast as E, internalCall as En, pipeArguments as Er, zipWith as Et, isArrayNonEmpty as F, formatPath as Fn, make$1 as Ft, reduce as G, optimize as Gn, Fail as Gt, match$1 as H, combine as Hn, Done as Ht, isCanonicalArrayIndex as I, formatPropertyKey as In, mapInput as It, take as J, structure as Jn, ReasonBase as Jt, some as K, random as Kn, InterruptorStackTrace as Kt, isReadonlyArrayNonEmpty as L, currentFiberTypeId as Ln, Tuple as Lt, getSomes as M, format as Mn, isGreaterThanOrEqualTo as Mt, head as N, formatDate as Nn, isLessThan as Nt, flatten as O, setStackTraceLimit as On, Date$1 as Ot, isArrayEmpty as P, formatJson as Pn, isLessThanOrEqualTo as Pt, remove as Q, isError as Qn, args as Qt, join as R, byReferenceUnsafe as Rn, make$2 as Rt, filter as S, makePrimitive as Sn, memoizeIdempotent as Sr, match$3 as St, findFirstIndex as T, assignProperty as Tn, Prototype as Tr, some$1 as Tt, of as U, hash as Un, Error$2 as Ut, map as V, array as Vn, Die as Vt, prepend as W, number as Wn, ExitTypeId as Wt, get$2 as X, hasProperty as Xn, TaggedError$1 as Xt, fromEntries as Y, symbol$1 as Yn, StackTraceKey as Yt, map$1 as Z, isBoolean as Zn, Yield as Zt, dedupe as _, isDone as _n, constVoid as _r, getOrUndefined as _t, includes as a, constEmptyAnnotations as an, isNumber as ar, succeed as at, ensure as b, isFailReason as bn, identity as br, liftThrowable as bt, startsWith as c, contE as cn, isPropertyKey as cr, contains$1 as ct, Error$1 as d, exitDie as dn, isTagged as dr, firstSomeOf as dt, causeCombine as en, isIterable as er, fail as et, TaggedError as f, exitFail as fn, isUndefined as fr, flatMap$1 as ft, contains as g, isDieReason as gn, constUndefined as gr, getOrElse as gt, appendAll as h, isCause as hn, constTrue as hr, fromUndefinedOr as ht, Order as i, causeFromReasons as in, isNullish as ir, match$2 as it, get$1 as j, toStringUnknown as jn, isGreaterThan as jt, forEach as k, BaseProto as kn, Number$1 as kt, trim as l, done as ln, isReadonlyObject as lr, exists as lt, append as m, exitSucceed as mn, constFalse as mr, fromNullishOr as mt, make as n, causeEmpty as nn, isNotNullish as nr, getOrThrow as nt, match as o, contA as on, isObject as or, normalize as ot, taggedEnum as p, exitFailCause as pn, isUnknown as pr, flatten$1 as pt, sort as q, string as qn, PipeInspectableProto as qt, update as r, causeFail as rn, isNotUndefined as rr, isFailure as rt, split as s, contAll as sn, isObjectKeyword as sr, all as st, get as t, causeDie as tn, isNotNull as tr, fromOption as tt, trimEnd as u, evaluate as un, isString as ur, filter$1 as ut, dropRight as v, isEffect as vn, constant as vr, isNone as vt, findFirst as w, withFiber as wn, Class$1 as wr, orElse as wt, every as x, isInterruptReason as xn, memoize as xr, map$2 as xt, empty as y, isExit as yn, dual as yr, isSome as yt, last as z, equals as zn, strictEqual as zt };
package/dist/install.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { $n as isNotNull, $t as causeDie, An as format$1, B as match$5, Bn as combine$1, Bt as Done$1, C as findFirst, Cn as assignProperty, Cr as Prototype$1, Ct as some, Dn as BaseProto, Dt as Number$6, En as setStackTraceLimit, F as isReadonlyArrayNonEmpty, Fn as currentFiberTypeId, Gn as string$1, Gt as PipeInspectableProto, Hn as number$1, Ht as ExitTypeId, I as join$1, Jn as hasProperty, Jt as TaggedError$2, Kn as structure, Kt as ReasonBase, Ln as equals$1, Mn as formatJson, N as isArrayNonEmpty, Nn as formatPath, O as fromIterable$1, On as NodeInspectSymbol, Ot as String$6, P as isCanonicalArrayIndex, Pn as formatPropertyKey, Pt as mapInput, Q as fail$5, Qn as isIterable, Qt as causeCombine, Rn as symbol, Rt as CauseImpl, Sn as withFiber$1, Sr as Class, T as findLast, Tn as getStackTraceLimit, U as reduce, Ut as Fail, V as of, Vn as hash, Vt as Error$3, W as some$1, Wn as random, Wt as InterruptorStackTrace, Xn as isError, Xt as args, Yn as isBoolean$1, Yt as Yield, Zn as isFunction, Zt as causeAnnotate, _n as isExit, _r as dual, _t as isSome, an as contAll, ar as isObjectKeyword, bn as makePrimitive$1, br as memoizeIdempotent, bt as match$4, c as startsWith, cn as evaluate, cr as isString, d as TaggedError$1, dn as exitFailCause, dr as isUnknown, en as causeEmpty, er as isNotNullish, f as taggedEnum, fn as exitSucceed, fr as constFalse, ft as fromNullishOr, g as dedupe, gn as isEffect$1, gr as constant, gt as isNone, h as contains, hn as isDone$2, hr as constVoid, ht as getOrUndefined$1, in as contA, ir as isObject, it as normalize$1, kn as toStringUnknown, kt as isGreaterThan$1, l as trimEnd, ln as exitDie, lr as isTagged, mn as isDieReason$1, mr as constUndefined, mt as getOrElse, n as make$29, nn as causeFromReasons, nr as isNullish, nt as match$3, on as contE, p as append$1, pn as isCause, pr as constTrue, pt as fromUndefinedOr, qn as symbol$1, qt as StackTraceKey, rn as constEmptyAnnotations, rr as isNumber, rt as succeed$6, sn as done$1, st as exists, tn as causeFail, tr as isNotUndefined, tt as isFailure$1, u as Error$2, un as exitFail, ur as isUndefined, ut as flatMap$3, v as empty$3, vn as isFailReason$1, vr as identity, w as findFirstIndex, wn as internalCall, wr as pipeArguments, x as filter, xn as makePrimitiveProto, xr as pipe, xt as none, yn as isInterruptReason, yr as memoize, yt as map$10, z as map$9, zt as Die } from "./MutableRef-CzOzKHjT.mjs";
2
+ import { $n as isFunction, $t as causeAnnotate, A as fromIterable$1, An as NodeInspectSymbol, At as String$6, Bn as symbol, Bt as CauseImpl, Cn as makePrimitiveProto, Cr as pipe, Ct as none, Dn as getStackTraceLimit, E as findLast, En as internalCall, Er as pipeArguments, F as isArrayNonEmpty, Fn as formatPath, G as reduce, Gt as Fail, H as match$5, Hn as combine$1, Ht as Done$1, I as isCanonicalArrayIndex, In as formatPropertyKey, It as mapInput, Jn as structure, Jt as ReasonBase, K as some$1, Kn as random, Kt as InterruptorStackTrace, L as isReadonlyArrayNonEmpty, Ln as currentFiberTypeId, Mn as format$1, On as setStackTraceLimit, Pn as formatJson, Qn as isError, Qt as args, R as join$1, S as filter, Sn as makePrimitive$1, Sr as memoizeIdempotent, St as match$4, T as findFirstIndex, Tn as assignProperty, Tr as Prototype$1, Tt as some, U as of, Un as hash, Ut as Error$3, V as map$9, Vt as Die, Wn as number$1, Wt as ExitTypeId, Xn as hasProperty, Xt as TaggedError$2, Yn as symbol$1, Yt as StackTraceKey, Zn as isBoolean$1, Zt as Yield, _ as dedupe, _n as isDone$2, _r as constVoid, _t as getOrUndefined$1, an as constEmptyAnnotations, ar as isNumber, at as succeed$6, bn as isFailReason$1, br as identity, c as startsWith, cn as contE, d as Error$2, dn as exitDie, dr as isTagged, en as causeCombine, er as isIterable, et as fail$5, f as TaggedError$1, fn as exitFail, fr as isUndefined, ft as flatMap$3, g as contains, gn as isDieReason$1, gr as constUndefined, gt as getOrElse, hn as isCause, hr as constTrue, ht as fromUndefinedOr, in as causeFromReasons, ir as isNullish, it as match$3, jn as toStringUnknown, jt as isGreaterThan$1, kn as BaseProto, kt as Number$6, ln as done$1, lt as exists, m as append$1, mn as exitSucceed, mr as constFalse, mt as fromNullishOr, n as make$29, nn as causeEmpty, nr as isNotNullish, on as contA, or as isObject, ot as normalize$1, p as taggedEnum, pn as exitFailCause, pr as isUnknown, qn as string$1, qt as PipeInspectableProto, rn as causeFail, rr as isNotUndefined, rt as isFailure$1, sn as contAll, sr as isObjectKeyword, tn as causeDie, tr as isNotNull, u as trimEnd, un as evaluate, ur as isString, vn as isEffect$1, vr as constant, vt as isNone, w as findFirst, wn as withFiber$1, wr as Class, xn as isInterruptReason, xr as memoize, xt as map$10, y as empty$3, yn as isExit, yr as dual, yt as isSome, zn as equals$1 } from "./MutableRef-WrqsqeER.mjs";
3
3
  import * as NodeChildProcess from "node:child_process";
4
4
  import { PassThrough } from "node:stream";
5
5
  import * as NodeCrypto from "node:crypto";
@@ -25233,7 +25233,7 @@ const runWith = (command, config) => {
25233
25233
  };
25234
25234
  //#endregion
25235
25235
  //#region package.json
25236
- var version = "0.1.1062";
25236
+ var version = "0.1.1064";
25237
25237
  //#endregion
25238
25238
  //#region src/install.ts
25239
25239
  const cli = pipe(make("deslop-coding-standards", {}, fnUntraced(function* () {
package/dist/oxlint.d.ts CHANGED
@@ -4123,6 +4123,7 @@ export declare const oxlint: {
4123
4123
  '@deslop/coding-standards/no-fake-ref-state': "error";
4124
4124
  '@deslop/coding-standards/no-hand-written-guard': "error";
4125
4125
  '@deslop/coding-standards/no-let': "error";
4126
+ '@deslop/coding-standards/no-multiline-comment': "error";
4126
4127
  '@deslop/coding-standards/no-native-control': "error";
4127
4128
  '@deslop/coding-standards/no-native-emptiness-check': "error";
4128
4129
  '@deslop/coding-standards/no-native-method-call': "error";
package/dist/oxlint.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as fromOption, $n as isNotNull, A as getSomes, Bn as combine, C as findFirst, Ct as some, D as flatten, E as flatMap$1, G as sort, Gn as string, H as prepend, Hn as number, I as join, In as byReferenceUnsafe, J as get$2, Jn as hasProperty, K as take, L as last, Ln as equals, M as isArrayEmpty, N as isArrayNonEmpty, On as NodeInspectSymbol, Rn as symbol, S as filterMap, St as orElse, Un as optimize, V as of, Vn as hash, W as some$1, X as remove, Yn as isBoolean, Z as values, _ as dropRight, _r as dual, _t as isSome, a as includes, at as all, b as every, bt as match$1, c as startsWith, cr as isString, ct as filter, d as TaggedError, dt as flatten$1, er as isNotNullish, ft as fromNullishOr, g as dedupe, h as contains$1, i as Order, j as head, k as get$1, lt as firstSomeOf, m as appendAll, mt as getOrElse, n as make$2, nr as isNullish$1, o as match, ot as contains, p as append, pt as fromUndefinedOr, q as fromEntries, qn as symbol$1, r as update, rr as isNumber, s as split, sr as isReadonlyObject, st as exists, t as get$3, ut as flatMap, v as empty, w as findFirstIndex, wr as pipeArguments, wt as zipWith, x as filter$1, xr as pipe, xt as none, y as ensure, yt as map, z as map$1 } from "./MutableRef-CzOzKHjT.mjs";
1
+ import { $ as values, An as NodeInspectSymbol, Bn as symbol, C as filterMap, Cr as pipe, Ct as none, D as flatMap$1, Er as pipeArguments, Et as zipWith, F as isArrayNonEmpty, Gn as optimize, Hn as combine, J as take, K as some$1, M as getSomes, N as head, O as flatten, P as isArrayEmpty, Q as remove, R as join, Rn as byReferenceUnsafe, S as filter$1, St as match$1, T as findFirstIndex, Tt as some, U as of, Un as hash, V as map$1, W as prepend, Wn as number, X as get$2, Xn as hasProperty, Y as fromEntries, Yn as symbol$1, Zn as isBoolean, _ as dedupe, a as includes, ar as isNumber, b as ensure, c as startsWith, ct as contains, dt as firstSomeOf, f as TaggedError, ft as flatMap, g as contains$1, gt as getOrElse, h as appendAll, ht as fromUndefinedOr, i as Order, ir as isNullish$1, j as get$1, k as forEach, l as trim, lr as isReadonlyObject, lt as exists, m as append, mt as fromNullishOr, n as make$2, nr as isNotNullish, o as match, pt as flatten$1, q as sort, qn as string, r as update, s as split, st as all, t as get$3, tr as isNotNull, tt as fromOption, ur as isString, ut as filter, v as dropRight, w as findFirst, wt as orElse, x as every, xt as map, y as empty, yr as dual, yt as isSome, z as last, zn as equals } from "./MutableRef-WrqsqeER.mjs";
2
2
  //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/internal/graph.js
3
3
  /** @internal */
4
4
  const TypeId = "~effect/Graph";
@@ -1314,6 +1314,30 @@ const noLet = defineRule({
1314
1314
  meta: { type: "problem" }
1315
1315
  });
1316
1316
  //#endregion
1317
+ //#region src/rules/no-multiline-comment.ts
1318
+ const directive = /^\s*(?:eslint|oxlint|@effect-diagnostics|@ts-|\/\s*<reference|#region|#endregion)/u;
1319
+ function adjacentLines(pair) {
1320
+ const first = pair.first;
1321
+ const second = pair.second;
1322
+ return first?.type === "Line" && second?.type === "Line" && second.loc.start.line === first.loc.end.line + 1;
1323
+ }
1324
+ const noMultilineComment = defineRule({
1325
+ create: (context) => ({ Program: () => {
1326
+ const comments = pipe(context.sourceCode.getAllComments(), filter$1((comment) => !directive.test(comment.value)));
1327
+ pipe(comments, filter$1((comment, index) => adjacentLines({
1328
+ first: comment,
1329
+ second: comments[index + 1]
1330
+ }) && !adjacentLines({
1331
+ first: comments[index - 1],
1332
+ second: comment
1333
+ }) || comment.type === "Block" && includes("\n")(trim(comment.value))), forEach((comment) => context.report({
1334
+ message: "A comment is one line that states an outside constraint; rename or split the code instead.",
1335
+ node: comment
1336
+ })));
1337
+ } }),
1338
+ meta: { type: "suggestion" }
1339
+ });
1340
+ //#endregion
1317
1341
  //#region src/rules/no-native-control.ts
1318
1342
  const primitives = {
1319
1343
  button: "Button",
@@ -2142,6 +2166,9 @@ function redundantConstAlias(input) {
2142
2166
  scope: input.context.sourceCode.getScope(input.node)
2143
2167
  }), exists((alias) => filter$1(alias.references, (reference) => reference.isRead()).length === 1));
2144
2168
  }
2169
+ function exportedAlias(input) {
2170
+ return input.node.parent.type === "VariableDeclaration" && input.node.parent.kind === "const" && input.node.parent.parent.type === "ExportNamedDeclaration" && input.node.id.type === "Identifier" && input.node.init?.type === "Identifier" && pipe(variableFor(input.context, input.node.init), exists((variable) => some$1(variable.defs, (definition) => definition.type === "ImportBinding" || definition.type === "FunctionName" || definition.type === "ClassName" || definition.node.type === "VariableDeclarator" && definition.node.parent.type === "VariableDeclaration" && definition.node.parent.kind === "const")));
2171
+ }
2145
2172
  function singleUseLiteral(input) {
2146
2173
  if (input.node.parent.type !== "VariableDeclaration" || input.node.parent.kind !== "const" || isExport(input.node.parent.parent) || input.node.id.type !== "Identifier" || input.node.id.typeAnnotation !== null || !(input.node.init?.type === "Literal" && !hasProperty(input.node.init, "regex") || input.node.init?.type === "TemplateLiteral" && isArrayEmpty(input.node.init.expressions))) return false;
2147
2174
  return pipe(variableFromScope({
@@ -2220,6 +2247,13 @@ const noTrivialIndirection = defineRule({
2220
2247
  });
2221
2248
  },
2222
2249
  VariableDeclarator: (node) => {
2250
+ if (exportedAlias({
2251
+ context,
2252
+ node
2253
+ })) context.report({
2254
+ message: "Export the value under one name; this second name is an alias.",
2255
+ node
2256
+ });
2223
2257
  if (redundantConstAlias({
2224
2258
  context,
2225
2259
  node
@@ -2578,6 +2612,7 @@ const oxlint = defineConfig({
2578
2612
  "@deslop/coding-standards/no-fake-ref-state": "error",
2579
2613
  "@deslop/coding-standards/no-hand-written-guard": "error",
2580
2614
  "@deslop/coding-standards/no-let": "error",
2615
+ "@deslop/coding-standards/no-multiline-comment": "error",
2581
2616
  "@deslop/coding-standards/no-native-control": "error",
2582
2617
  "@deslop/coding-standards/no-native-emptiness-check": "error",
2583
2618
  "@deslop/coding-standards/no-native-method-call": "error",
@@ -3282,6 +3317,7 @@ var oxlint_default = definePlugin({
3282
3317
  "no-fake-ref-state": noFakeRefState,
3283
3318
  "no-hand-written-guard": noHandWrittenGuard,
3284
3319
  "no-let": noLet,
3320
+ "no-multiline-comment": noMultilineComment,
3285
3321
  "no-native-control": noNativeControl,
3286
3322
  "no-native-emptiness-check": noNativeEmptinessCheck,
3287
3323
  "no-native-method-call": noNativeMethodCall,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deslop/coding-standards",
3
- "version": "0.1.1062",
3
+ "version": "0.1.1064",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/MP281X/deslop",
@@ -80,12 +80,13 @@ The first draft the user sees is already the refined one. Work through these ste
80
80
  - The URL holds navigation state, and Back restores the scroll position and the draft.
81
81
  - Place an error beside its field and move focus to the first one. Undo or confirm a destructive action.
82
82
  - When the app already knows an action is not allowed, disable it and show the reason beside it.
83
+ - Selecting "All" clears the filter; never store or show "All" as one more filter value.
83
84
 
84
85
  **States and speed.** A loading state has the layout of the loaded content, and a loader waits before it appears. Use stale-while-revalidate for cached data. Apply writes optimistically and roll back on failure without losing the person's place. Start unavoidable work early, and add no artificial wait. Errors and rare states get the same care as the main path.
85
86
 
86
87
  **Copy.** Name actions after the person's task, with one vocabulary and sentence case. An empty state offers the next action. An error names what failed and the recovery that exists, beside its control.
87
88
 
88
- **Motion.** Motion explains a change; it never delays input or decorates.
89
+ **Motion.** Motion explains a state change or a spatial relationship: plan its trigger, source and destination with the interaction. It never delays input or decorates.
89
90
 
90
91
  - Frequent actions and typing get no animation. Keep tweens under 300 ms, ease-out for entrances and ease-in-out for morphs. Interface springs start at a 0.4 second duration with 0.15 bounce.
91
92
  - An entrance starts near its resting size, from 0.9 scale or more. A surface anchored to a trigger enters and exits from it.
@@ -97,11 +98,11 @@ The first draft the user sees is already the refined one. Work through these ste
97
98
 
98
99
  ## Prototype and tune
99
100
 
100
- **Variants.** When a direction needs the user's judgment, build an interactive render before product code: two or three variants on the same data, each clickable through every state from the States step. Give the page a variant switch and a grouped state selector that the phone can use. Fill it with realistic mock data, and draw it as close as possible to the code you will write: the app's tokens, components, copy and behavior. For a native app the render settles structure, flow and states; settle the final look in simulator captures. Label each variant with its one difference, mark your recommendation, and let the user pick by message.
101
+ **Variants.** When layout or interaction has real alternatives, build an interactive render before product code: two or three variants on the same data, each clickable through every state from the States step. Give the page a variant switch and a grouped state selector that the phone can use. Fill it with realistic mock data, and draw it as close as possible to the code you will write: the app's tokens, components, copy and behavior. For a native app the render settles structure, flow and states; settle the final look in simulator captures. Label each variant with its one difference and mark your recommendation.
101
102
 
102
103
  **Real host.** Build one representative screen with realistic data in the real host: the browser preview for the web, the simulator for a native app. An HTML imitation of a native screen misleads.
103
104
 
104
- **Tune.** Settle values yourself; the user never operates a tuning tool. For values you cannot settle by reasoning, such as spacing, timing, springs or blur, capture candidates side by side, including both extremes, and judge them against the reference. Write the chosen values into the source and recapture.
105
+ **Tune.** Settle values yourself. For values you cannot settle by reasoning, such as spacing, timing, springs or blur, capture candidates side by side, including both extremes, and judge them against the reference. Write the chosen values into the source and recapture.
105
106
 
106
107
  ## Critique before showing
107
108
 
@@ -131,10 +132,11 @@ Ground the page in its subject: name the audience and the page's one job, and ta
131
132
 
132
133
  ## Visual explanations
133
134
 
134
- These rules cover diagrams, review pages and rendered agent answers; the reply decides when it needs a render. A render adds spatial or interactive information and replaces the text it shows; it never redraws prose, a file list or a fake runtime screenshot.
135
+ These rules cover diagrams, review pages and rendered agent answers; the reply decides when it needs a render. A render adds spatial or interactive information and replaces the text it shows; it never redraws prose, a file list, a check table or a fake runtime screenshot.
135
136
 
136
137
  | The reader asks | Exhibit |
137
138
  | ------------------------------------ | ------------------------------------------------------------- |
139
+ | What does it look like now? | State map of the changed system, changed parts marked |
138
140
  | What changed on screen? | Before and after pair with the same data, the old state left |
139
141
  | Which transitions are allowed? | State machine with forbidden edges marked |
140
142
  | What happens in order, and who acts? | Sequence in swimlanes, one lane per actor |
@@ -149,8 +151,9 @@ These rules cover diagrams, review pages and rendered agent answers; the reply d
149
151
  When none fits, choose the form that matches the data's shape; draw a list as a list.
150
152
 
151
153
  - **One message.** Each page answers one question, and its first line states the conclusion, such as "The catalog loads 26 times faster".
152
- - **One dominant element.** Size, weight and position show importance; mute the context.
154
+ - **One dominant element.** Size, weight and position show importance; mute the context. Show at most six labeled elements; never a text table, a collapsed card or a filter chip.
155
+ - **Honest scale.** Bars start at zero on one linear scale; draw a range as a range.
153
156
  - **Labels.** Put names, values and units on the data, with one scale per comparison. Labels and captions stay under twelve words, and a visual holds no paragraphs.
154
157
  - **Real content.** Use real names, numbers and captures, and show the scope.
155
- - **Interaction.** A render sends nothing back, so decisions come by message. When side-by-side options or captures turn unreadable at phone width, show them at one position behind labeled tabs. The conclusion stays visible without a tap.
156
- - **Check.** Use the host's theme variables, check light, dark and phone width, and fix clipping, overlap and contrast before you show it.
158
+ - **Interaction.** When side-by-side options or captures turn unreadable at phone width, show them at one position behind labeled tabs. The conclusion stays visible without a tap.
159
+ - **Check.** Use the host's theme variables, check light, dark and a 390-point width, and fix clipping, overlap and contrast before you show it. At that width the page stays under about 400 points tall.
@@ -3,7 +3,7 @@ name: engineering
3
3
  description: 'TypeScript and Effect code conventions paired with shared lint. Use when designing, implementing or reviewing product and test code, including prototypes.'
4
4
  ---
5
5
 
6
- **Scope.** Apply these rules and the repository's `CODING_STANDARDS.md`, and write each line right the first time; lint is only the fallback. A refactor or cleanup request applies every rule to every line of the owned files.
6
+ **Scope.** Apply these rules and the repository's `CODING_STANDARDS.md`, and write each line right the first time; lint is only the fallback. A refactor or cleanup request applies every rule to every line of the owned files. Scratch code outside the repository follows no style rule.
7
7
 
8
8
  ## Simplicity
9
9