@deslop/coding-standards 0.1.1083 → 0.1.1085

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.
@@ -5408,6 +5408,46 @@ const take$1 = /*#__PURE__*/ dual(2, (self, n) => {
5408
5408
  return input.slice(0, clampCount(n, input.length));
5409
5409
  });
5410
5410
  /**
5411
+ * Takes elements from the start while the predicate holds, stopping at the
5412
+ * first element that fails.
5413
+ *
5414
+ * **When to use**
5415
+ *
5416
+ * Use to keep the leading elements of an iterable while each element satisfies
5417
+ * a predicate, returning the retained prefix as an array.
5418
+ *
5419
+ * **Details**
5420
+ *
5421
+ * Supports refinements for type narrowing. The predicate receives
5422
+ * `(element, index)`.
5423
+ *
5424
+ * **Example** (Taking while condition holds)
5425
+ *
5426
+ * ```ts import.meta.vitest
5427
+ * import { Array } from "effect"
5428
+ *
5429
+ * Array.takeWhile([1, 3, 2, 4, 1, 2], (x) => x < 4) // => [1, 3, 2]
5430
+ * ```
5431
+ *
5432
+ * @see {@link take} for keeping a fixed number of leading elements
5433
+ * @see {@link dropWhile} for removing the matching prefix and keeping the rest
5434
+ * @see {@link span} for splitting the matching prefix from the remaining elements
5435
+ *
5436
+ * @stability stable
5437
+ * @category getters
5438
+ * @since 2.0.0
5439
+ */
5440
+ const takeWhile = /*#__PURE__*/ dual(2, (self, predicate) => {
5441
+ let i = 0;
5442
+ const out = [];
5443
+ for (const a of self) {
5444
+ if (!predicate(a, i)) break;
5445
+ out.push(a);
5446
+ i++;
5447
+ }
5448
+ return out;
5449
+ });
5450
+ /**
5411
5451
  * Removes the last `n` elements, creating a new array.
5412
5452
  *
5413
5453
  * **When to use**
@@ -6352,6 +6392,23 @@ globalThis.String;
6352
6392
  */
6353
6393
  const Order = String$2;
6354
6394
  /**
6395
+ * Converts a string to uppercase.
6396
+ *
6397
+ * **Example** (Converting strings to uppercase)
6398
+ *
6399
+ * ```ts import.meta.vitest
6400
+ * import { pipe, String } from "effect"
6401
+ *
6402
+ * pipe("a", String.toUpperCase) // => "A"
6403
+ * String.toUpperCase("hello") // => "HELLO"
6404
+ * ```
6405
+ *
6406
+ * @stability stable
6407
+ * @category transforming
6408
+ * @since 2.0.0
6409
+ */
6410
+ const toUpperCase = (self) => self.toUpperCase();
6411
+ /**
6355
6412
  * Replaces matches in a string using `String.prototype.replace`.
6356
6413
  *
6357
6414
  * **Details**
@@ -6995,4 +7052,4 @@ const toArrayN = (self, n) => {
6995
7052
  */
6996
7053
  const toArray = (self) => toArrayN(self, self.length);
6997
7054
  //#endregion
6998
- export { makeEquivalence as $, formatDate as $n, isLessThanOrEqualTo as $t, dedupeWith as A, evaluate as An, isObject as Ar, flatMap$2 as At, flatMap as B, isFailReason as Bn, constTrue as Br, match$4 as Bt, TaggedError as C, causeFail as Cn, isFunction as Cr, succeed as Ct, contains as D, contAll as Dn, isNotUndefined as Dr, exists as Dt, appendAll as E, contA as En, isNotNullish as Er, contains$1 as Et, filter as F, isCause as Fn, isString as Fr, getOrUndefined as Ft, getSomes as G, assignProperty as Gn, identity as Gr, zipWith as Gt, forEach as H, makePrimitive as Hn, constVoid as Hr, orElse as Ht, filterMap as I, isDieReason as In, isTagged as Ir, isNone as It, isArrayNonEmpty as J, setStackTraceLimit as Jn, pipe as Jr, Number$2 as Jt, head as K, internalCall as Kn, memoize as Kr, BigInt$1 as Kt, findFirst as L, isDone as Ln, isUndefined as Lr, isSome as Lt, empty as M, exitFail as Mn, isPropertyKey as Mr, fromNullishOr as Mt, ensure as N, exitFailCause as Nn, isReadonlyObject as Nr, fromUndefinedOr as Nt, containsWith as O, contE as On, isNullish as Or, filter$1 as Ot, every as P, exitSucceed as Pn, isRegExp as Pr, getOrElse as Pt, last as Q, format as Qn, isLessThan as Qt, findFirstIndex as R, isEffect as Rn, isUnknown as Rr, liftThrowable as Rt, Error$1 as S, causeEmpty as Sn, isError as Sr, match$3 as St, append$1 as T, constEmptyAnnotations as Tn, isNotNull as Tr, all as Tt, fromIterable as U, makePrimitiveProto as Un, constant as Ur, some$1 as Ut, flatten as V, isInterruptReason as Vn, constUndefined as Vr, none as Vt, get$1 as W, withFiber as Wn, dual as Wr, toArray$1 as Wt, isReadonlyArrayNonEmpty as X, NodeInspectSymbol as Xn, Prototype as Xr, isGreaterThan as Xt, isCanonicalArrayIndex as Y, BaseProto as Yn, Class$1 as Yr, String$2 as Yt, join as Z, toStringUnknown as Zn, pipeArguments as Zr, isGreaterThanOrEqualTo as Zt, startsWith as _, args as _n, structureKeys as _r, fromOption as _t, takeN as a, CauseImpl as an, symbolRedactable as ar, reduce as at, parse as b, causeCombine as bn, isBigInt as br, isSuccess as bt, make$1 as c, Error$2 as cn, equals as cr, take$1 as ct, Order as d, InterruptorStackTrace as dn, combine as dr, makeEquivalence$1 as dt, make$2 as en, formatJson as er, map as et, includes as f, PipeInspectableProto as fn, hash as fr, map$1 as ft, split as g, Yield as gn, structure as gr, flatMap$1 as gt, replaceAll as h, TaggedError$1 as hn, string as hr, fail as ht, take as i, strictEqual as in, redact as ir, prepend as it, dropRight as j, exitDie as jn, isObjectKeyword as jr, flatten$1 as jt, dedupe as k, done as kn, isNumber as kr, firstSomeOf as kt, update as l, ExitTypeId as ln, symbol as lr, fromEntries as lt, replace as m, StackTraceKey as mn, optimize as mr, values as mt, clear as n, Tuple as nn, formatPropertyKey as nr, matchRight as nt, toArray as o, Die as on, asEquivalence as or, some as ot, match$1 as p, ReasonBase as pn, number as pr, remove as pt, isArrayEmpty as q, getStackTraceLimit as qn, memoizeIdempotent as qr, Date$1 as qt, make as r, make$3 as rn, currentFiberTypeId as rr, of as rt, get as s, Done as sn, byReferenceUnsafe as sr, sort as st, append as t, mapInput as tn, formatPath as tr, match$2 as tt, match as u, Fail as un, array as ur, get$2 as ut, trim as v, causeAddInterrupts as vn, symbol$1 as vr, getOrThrow as vt, taggedEnum as w, causeFromReasons as wn, isIterable as wr, normalize as wt, round as x, causeDie as xn, isBoolean as xr, map$2 as xt, trimEnd as y, causeAnnotate as yn, hasProperty as yr, isFailure as yt, findLast as z, isExit as zn, constFalse as zr, map$3 as zt };
7055
+ export { last as $, toStringUnknown as $n, pipeArguments as $r, isGreaterThanOrEqualTo as $t, dedupe as A, contE as An, isNullish as Ar, filter$1 as At, findLast as B, isEffect as Bn, isUnknown as Br, liftThrowable as Bt, Error$1 as C, causeDie as Cn, isBoolean as Cr, map$2 as Ct, appendAll as D, constEmptyAnnotations as Dn, isNotNull as Dr, all as Dt, append$1 as E, causeFromReasons as En, isIterable as Er, normalize as Et, every as F, exitFailCause as Fn, isReadonlyObject as Fr, fromUndefinedOr as Ft, get$1 as G, makePrimitiveProto as Gn, constant as Gr, some$1 as Gt, flatten as H, isFailReason as Hn, constTrue as Hr, match$4 as Ht, filter as I, exitSucceed as In, isRegExp as Ir, getOrElse as It, isArrayEmpty as J, internalCall as Jn, memoize as Jr, BigInt$1 as Jt, getSomes as K, withFiber as Kn, dual as Kr, toArray$1 as Kt, filterMap as L, isCause as Ln, isString as Lr, getOrUndefined as Lt, dropRight as M, evaluate as Mn, isObject as Mr, flatMap$2 as Mt, empty as N, exitDie as Nn, isObjectKeyword as Nr, flatten$1 as Nt, contains as O, contA as On, isNotNullish as Or, contains$1 as Ot, ensure as P, exitFail as Pn, isPropertyKey as Pr, fromNullishOr as Pt, join as Q, NodeInspectSymbol as Qn, Prototype as Qr, isGreaterThan as Qt, findFirst as R, isDieReason as Rn, isTagged as Rr, isNone as Rt, round as S, causeCombine as Sn, isBigInt as Sr, isSuccess as St, taggedEnum as T, causeFail as Tn, isFunction as Tr, succeed as Tt, forEach as U, isInterruptReason as Un, constUndefined as Ur, none as Ut, flatMap as V, isExit as Vn, constFalse as Vr, map$3 as Vt, fromIterable as W, makePrimitive as Wn, constVoid as Wr, orElse as Wt, isCanonicalArrayIndex as X, setStackTraceLimit as Xn, pipe as Xr, Number$2 as Xt, isArrayNonEmpty as Y, getStackTraceLimit as Yn, memoizeIdempotent as Yr, Date$1 as Yt, isReadonlyArrayNonEmpty as Z, BaseProto as Zn, Class$1 as Zr, String$2 as Zt, startsWith as _, TaggedError$1 as _n, string as _r, fail as _t, takeN as a, make$3 as an, currentFiberTypeId as ar, prepend as at, trimEnd as b, causeAddInterrupts as bn, symbol$1 as br, getOrThrow as bt, make$1 as c, Die as cn, asEquivalence as cr, sort as ct, Order as d, ExitTypeId as dn, symbol as dr, fromEntries as dt, isLessThan as en, format as er, makeEquivalence as et, includes as f, Fail as fn, array as fr, get$2 as ft, split as g, StackTraceKey as gn, optimize as gr, values as gt, replaceAll as h, ReasonBase as hn, number as hr, remove as ht, take as i, Tuple as in, formatPropertyKey as ir, of as it, dedupeWith as j, done as jn, isNumber as jr, firstSomeOf as jt, containsWith as k, contAll as kn, isNotUndefined as kr, exists as kt, update as l, Done as ln, byReferenceUnsafe as lr, take$1 as lt, replace as m, PipeInspectableProto as mn, hash as mr, map$1 as mt, clear as n, make$2 as nn, formatJson as nr, match$2 as nt, toArray as o, strictEqual as on, redact as or, reduce as ot, match$1 as p, InterruptorStackTrace as pn, combine as pr, makeEquivalence$1 as pt, head as q, assignProperty as qn, identity as qr, zipWith as qt, make as r, mapInput as rn, formatPath as rr, matchRight as rt, get as s, CauseImpl as sn, symbolRedactable as sr, some as st, append as t, isLessThanOrEqualTo as tn, formatDate as tr, map as tt, match as u, Error$2 as un, equals as ur, takeWhile as ut, toUpperCase as v, Yield as vn, structure as vr, flatMap$1 as vt, TaggedError as w, causeEmpty as wn, isError as wr, match$3 as wt, parse as x, causeAnnotate as xn, hasProperty as xr, isFailure as xt, trim as y, args as yn, structureKeys as yr, fromOption as yt, findFirstIndex as z, isDone as zn, isUndefined as zr, isSome as zt };
package/dist/install.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { An as evaluate, Ar as isObject, At as flatMap$4, Bn as isFailReason$1, Br as constTrue, Bt as match$4, C as TaggedError$1, Cn as causeFail, Cr as isFunction, Ct as succeed$6, D as contains, Dn as contAll, Dr as isNotUndefined, Dt as exists, En as contA, Er as isNotNullish, F as filter, Fn as isCause, Fr as isString$1, Ft as getOrUndefined$1, Gn as assignProperty, Gr as identity, Hn as makePrimitive$1, Hr as constVoid, Ht as orElse, In as isDieReason$1, Ir as isTagged, It as isNone, J as isArrayNonEmpty, Jn as setStackTraceLimit, Jr as pipe, Jt as Number$5, Kn as internalCall, Kr as memoize, L as findFirst, Ln as isDone$2, Lr as isUndefined, Lt as isSome, M as empty$3, Mn as exitFail, Mt as fromNullishOr, Nn as exitFailCause, Nt as fromUndefinedOr, On as contE, Or as isNullish, Pn as exitSucceed, Pt as getOrElse, Qn as format$1, R as findFirstIndex, Rn as isEffect$1, Rr as isUnknown, S as Error$2, Sn as causeEmpty, Sr as isError, St as match$3, T as append, Tn as constEmptyAnnotations, Tr as isNotNull, U as fromIterable$1, Un as makePrimitiveProto, Ur as constant, Ut as some, Vn as isInterruptReason, Vr as constUndefined, Vt as none, Wn as withFiber$1, Wr as dual, X as isReadonlyArrayNonEmpty, Xn as NodeInspectSymbol, Xr as Prototype$1, Xt as isGreaterThan$1, Y as isCanonicalArrayIndex, Yn as BaseProto, Yr as Class, Yt as String$6, Z as join$1, Zn as toStringUnknown, Zr as pipeArguments, _ as startsWith, _n as args, a as takeN, an as CauseImpl, at as reduce, bn as causeCombine, c as make$30, cn as Error$3, cr as equals$1, dn as InterruptorStackTrace, dr as combine$1, er as formatJson, et as map$8, fn as PipeInspectableProto, fr as hash, gn as Yield, gr as structure, hn as TaggedError$2, hr as string$1, ht as fail$5, i as take$1, jn as exitDie, jr as isObjectKeyword, k as dedupe, kn as done$1, kr as isNumber, ln as ExitTypeId, lr as symbol, mn as StackTraceKey, n as clear, nr as formatPropertyKey, on as Die, ot as some$1, pn as ReasonBase, pr as number$1, qn as getStackTraceLimit, qr as memoizeIdempotent, r as make$29, rr as currentFiberTypeId, rt as of, sn as Done$1, t as append$1, tn as mapInput, tr as formatPath, tt as match$5, u as match$6, un as Fail, vn as causeAddInterrupts, vr as symbol$1, w as taggedEnum, wn as causeFromReasons, wr as isIterable, wt as normalize$1, x as round, xn as causeDie, xr as isBoolean$1, y as trimEnd, yn as causeAnnotate, yr as hasProperty, yt as isFailure$1, z as findLast, zn as isExit, zr as constFalse, zt as map$10 } from "./MutableList-Cpkiw3Cl.mjs";
2
+ import { $n as toStringUnknown, $r as pipeArguments, A as dedupe, An as contE, Ar as isNullish, B as findLast, Bn as isEffect$1, Br as isUnknown, C as Error$2, Cn as causeDie, Cr as isBoolean$1, Dn as constEmptyAnnotations, Dr as isNotNull, E as append, En as causeFromReasons, Er as isIterable, Et as normalize$1, Fn as exitFailCause, Ft as fromUndefinedOr, Gn as makePrimitiveProto, Gr as constant, Gt as some, Hn as isFailReason$1, Hr as constTrue, Ht as match$4, I as filter, In as exitSucceed, It as getOrElse, Jn as internalCall, Jr as memoize, Kn as withFiber$1, Kr as dual, Ln as isCause, Lr as isString$1, Lt as getOrUndefined$1, Mn as evaluate, Mr as isObject, Mt as flatMap$4, N as empty$3, Nn as exitDie, Nr as isObjectKeyword, O as contains, On as contA, Or as isNotNullish, Pn as exitFail, Pt as fromNullishOr, Q as join$1, Qn as NodeInspectSymbol, Qr as Prototype$1, Qt as isGreaterThan$1, R as findFirst, Rn as isDieReason$1, Rr as isTagged, Rt as isNone, S as round, Sn as causeCombine, T as taggedEnum, Tn as causeFail, Tr as isFunction, Tt as succeed$6, Un as isInterruptReason, Ur as constUndefined, Ut as none, Vn as isExit, Vr as constFalse, Vt as map$10, W as fromIterable$1, Wn as makePrimitive$1, Wr as constVoid, Wt as orElse, X as isCanonicalArrayIndex, Xn as setStackTraceLimit, Xr as pipe, Xt as Number$5, Y as isArrayNonEmpty, Yn as getStackTraceLimit, Yr as memoizeIdempotent, Z as isReadonlyArrayNonEmpty, Zn as BaseProto, Zr as Class, Zt as String$6, _ as startsWith, _n as TaggedError$2, _r as string$1, _t as fail$5, a as takeN, ar as currentFiberTypeId, b as trimEnd, bn as causeAddInterrupts, br as symbol$1, c as make$30, cn as Die, dn as ExitTypeId, dr as symbol, er as format$1, fn as Fail, gn as StackTraceKey, hn as ReasonBase, hr as number$1, i as take$1, ir as formatPropertyKey, it as of, jn as done$1, jr as isNumber, kn as contAll, kr as isNotUndefined, kt as exists, ln as Done$1, mn as PipeInspectableProto, mr as hash, n as clear, nr as formatJson, nt as match$5, ot as reduce, pn as InterruptorStackTrace, pr as combine$1, qn as assignProperty, qr as identity, r as make$29, rn as mapInput, rr as formatPath, sn as CauseImpl, st as some$1, t as append$1, tt as map$8, u as match$6, un as Error$3, ur as equals$1, vn as Yield, vr as structure, w as TaggedError$1, wn as causeEmpty, wr as isError, wt as match$3, xn as causeAnnotate, xr as hasProperty, xt as isFailure$1, yn as args, z as findFirstIndex, zn as isDone$2, zr as isUndefined, zt as isSome } from "./MutableList-NTBI6AHW.mjs";
3
3
  import * as OS from "node:os";
4
4
  import * as NodeChildProcess from "node:child_process";
5
5
  import { PassThrough } from "node:stream";
@@ -25497,7 +25497,7 @@ const runWith = (command, config) => {
25497
25497
  };
25498
25498
  //#endregion
25499
25499
  //#region package.json
25500
- var version = "0.1.1083";
25500
+ var version = "0.1.1085";
25501
25501
  //#endregion
25502
25502
  //#region src/install.ts
25503
25503
  const cli = pipe(make("deslop-coding-standards", {}, fnUntraced(function* () {
package/dist/oxlint.d.ts CHANGED
@@ -4150,6 +4150,7 @@ export declare const oxlint: {
4150
4150
  plugins: ("effecttsgo" | "eslint" | "import" | "jsx-a11y" | "oxc" | "react" | "typescript" | "unicorn")[];
4151
4151
  rules: {
4152
4152
  '@deslop/coding-standards/explicit-effect-concurrency': "error";
4153
+ '@deslop/coding-standards/module-constant': "error";
4153
4154
  '@deslop/coding-standards/motion-limits': "error";
4154
4155
  '@deslop/coding-standards/no-array-wrap-ternary': "error";
4155
4156
  '@deslop/coding-standards/no-barrel-module': "error";
@@ -4164,6 +4165,7 @@ export declare const oxlint: {
4164
4165
  '@deslop/coding-standards/no-empty-recovery': "error";
4165
4166
  '@deslop/coding-standards/no-error-message-assertion': "error";
4166
4167
  '@deslop/coding-standards/no-fake-ref-state': "error";
4168
+ '@deslop/coding-standards/no-floating-derived-type': "error";
4167
4169
  '@deslop/coding-standards/no-gradient': "error";
4168
4170
  '@deslop/coding-standards/no-hand-written-guard': "error";
4169
4171
  '@deslop/coding-standards/no-in-operator': "error";
@@ -4183,9 +4185,11 @@ export declare const oxlint: {
4183
4185
  '@deslop/coding-standards/no-renamed-import': "error";
4184
4186
  '@deslop/coding-standards/no-return-type': "error";
4185
4187
  '@deslop/coding-standards/no-single-use-value': "error";
4188
+ '@deslop/coding-standards/no-stored-jsx': "error";
4186
4189
  '@deslop/coding-standards/no-stored-schema-operation': "error";
4187
4190
  '@deslop/coding-standards/no-switch-statement': "error";
4188
4191
  '@deslop/coding-standards/no-trivial-indirection': "error";
4192
+ '@deslop/coding-standards/no-type-from-value': "error";
4189
4193
  '@deslop/coding-standards/no-typeof': "error";
4190
4194
  '@deslop/coding-standards/no-undestructured-use-state': "error";
4191
4195
  '@deslop/coding-standards/no-unexplained-disable': "error";
@@ -4592,6 +4596,12 @@ export declare const oxlint: {
4592
4596
  ignoreRestSiblings: true;
4593
4597
  reportUsedIgnorePattern: true;
4594
4598
  }];
4599
+ 'no-use-before-define': ["error", {
4600
+ classes: false;
4601
+ functions: false;
4602
+ typedefs: false;
4603
+ variables: true;
4604
+ }];
4595
4605
  'no-useless-assignment': "error";
4596
4606
  'no-useless-backreference': "error";
4597
4607
  'no-useless-call': "error";