@ls-stack/fast-lint 0.5.0 → 0.6.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.
package/README.md CHANGED
@@ -813,6 +813,8 @@ safe and why TS inference or an alternative can't be used.
813
813
  to remove the annotation (`inferablePredicate`); only null/undefined and `typeof` checks it is sure about are
814
814
  reported
815
815
  - body-less signatures (overloads, `declare function`, interface members, function types) and `asserts x` are ignored
816
+ - `alternativeMsgs` appends a project-specific hint to the message of guards passed directly to `.find()` or
817
+ `.filter()`, e.g. pointing to a `filterAndMap` helper
816
818
 
817
819
  ```ts
818
820
  // Error: missingExplanation
@@ -840,6 +842,11 @@ type Options = [
840
842
  commentPrefix?: string
841
843
  /** Minimum characters of explanation after the prefix (default: 20) */
842
844
  minLength?: number
845
+ /** Extra hints appended to the message of guards passed directly to `.find()`/`.filter()` */
846
+ alternativeMsgs?: {
847
+ inArrayFind?: string
848
+ inArrayFilter?: string
849
+ }
843
850
  },
844
851
  ]
845
852
  ```
Binary file
Binary file
Binary file
Binary file
Binary file
package/lib/index.d.ts CHANGED
@@ -220,6 +220,10 @@ export type NoRestrictedCommentsOptions = {
220
220
  export type RequireTypeGuardExplanationOptions = {
221
221
  commentPrefix?: string
222
222
  minLength?: number
223
+ alternativeMsgs?: {
224
+ inArrayFind?: string
225
+ inArrayFilter?: string
226
+ }
223
227
  }
224
228
 
225
229
  export type RequireUsageExplanationOptions = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ls-stack/fast-lint",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "license": "MIT",
5
5
  "description": "Fast type-aware lint rules for TypeScript and React, running natively on tsrs, the Rust port of the TypeScript checker",
6
6
  "type": "module",