slop-police 0.3.1 → 0.3.2

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.
Files changed (2) hide show
  1. package/README.md +0 -14
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -42,7 +42,6 @@ slop-police reads `slop-police.json` from the current directory:
42
42
  "no-pass-through-wrapper": "error",
43
43
  "no-duplicate-function": "warn",
44
44
  "no-placeholder-comment": "error",
45
- "no-promise-default-fallback": "error",
46
45
  "no-stringified-unknown-error": "warn"
47
46
  }
48
47
  }
@@ -167,19 +166,6 @@ export async function loadUsers(id: string) {
167
166
  // Function loadUsers has the same body shape as loadPosts (posts.ts:1), loadTeams (teams.ts:1)
168
167
  ```
169
168
 
170
- ### no-promise-default-fallback
171
-
172
- A promise `.catch()` handler that hides the rejection: an empty handler, or one that only returns `null`, `undefined`, `false`, `0`, `""`, `[]` or `{}`, optionally after `console.*` or `logger.*` calls. Only `.catch` on promises and other thenables counts.
173
-
174
- ```ts
175
- const config = await fetchConfig().catch(() => null); // Promise rejection is replaced with null
176
- navigator.clipboard.writeText(text).catch(() => {}); // Promise rejection is swallowed by an empty catch handler
177
- const enabled = await fetchFlag().catch((error) => { // Promise rejection is logged and replaced with false
178
- console.error("flag load failed", error);
179
- return false;
180
- });
181
- ```
182
-
183
169
  ### no-stringified-unknown-error
184
170
 
185
171
  `error instanceof Error ? error.message : String(error)` (in either order), which flattens a caught value into a string and drops its type, stack and cause. A plain `instanceof Error` check counts when the variable is named `error`, `err`, `e` or `cause`; an `||` of `instanceof` checks counts for any name. A function that does nothing but this conversion, like `getErrorMessage(error)`, is where it belongs and isn't reported; use it instead of repeating the expression.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slop-police",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Type-aware TypeScript linter for the dead code and needless indirection AI agents leave behind",
5
5
  "keywords": [
6
6
  "typescript",
@@ -41,9 +41,9 @@
41
41
  "node": ">=22.18"
42
42
  },
43
43
  "optionalDependencies": {
44
- "slop-police-darwin-arm64": "0.3.1",
45
- "slop-police-darwin-x64": "0.3.1",
46
- "slop-police-linux-arm64": "0.3.1",
47
- "slop-police-linux-x64": "0.3.1"
44
+ "slop-police-darwin-arm64": "0.3.2",
45
+ "slop-police-darwin-x64": "0.3.2",
46
+ "slop-police-linux-arm64": "0.3.2",
47
+ "slop-police-linux-x64": "0.3.2"
48
48
  }
49
49
  }