@vvedantb/config 0.18.0 → 0.19.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.19.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`60ae003`](https://github.com/vvedantb/v/commit/60ae00383f37e0c2939dd11b38ddafc36979cb66) Thanks [@vvedantb](https://github.com/vvedantb)! - Add the `vvedantb/no-filler-copy` lint rule, on by default in the base config.
8
+
3
9
  ## 0.18.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -71,6 +71,7 @@ Seventeen rules, with no app prefix:
71
71
  | `convex-no-collect-in-query` | `.collect()` on a `db.query(...)` chain. Use `.take(n)` or `.paginate()`. Syntactic port of `@convex-dev/eslint-plugin`, which needs type information. Warning in `convex` and `backend` folders, off in tests. |
72
72
  | `convex-no-filter-in-query` | `.filter()` on a `db.query(...)` chain, also through a variable. Use `.withIndex()`. Warning in `convex` and `backend` folders, off in tests. |
73
73
  | `convex-no-time-or-random-in-queries` | `new Date()`, `Date.now()`, `performance.now()`, `Math.random()` and `crypto.randomUUID()` inside a Convex query handler. Helpers that the handler calls are not followed. |
74
+ | `no-filler-copy` | Filler strings: a bare "Try again.", "Tasks you create will appear here.", "Please wait while we…", "We are sorry…". Delete them. |
74
75
  | `no-tab-search-param` | A tab in the query string: `searchParams.get("tab")`, `useQueryState("tab")`, `"?tab=x"` strings. Use a nested route such as `/edit-details/specialisms`. |
75
76
  | `no-ts-nocheck` | `@ts-nocheck` and `@ts-ignore` comments. `@ts-expect-error` with a reason stays allowed. |
76
77
  | `no-conditional-tests` | An `expect(...)` call inside an `if`, `?:`, `&&`/`\|\|` or `switch` case in a test file. |
package/oxlint/base.json CHANGED
@@ -41,6 +41,7 @@
41
41
  "no-effect/no-external-store-subscription": "error",
42
42
  "no-effect/no-initialize-state": "error",
43
43
  "vvedantb/no-comments": "error",
44
+ "vvedantb/no-filler-copy": "error",
44
45
  "vvedantb/no-tab-search-param": "error",
45
46
  "no-console": ["error", { "allow": ["warn", "error", "info"] }],
46
47
  "no-restricted-properties": [
@@ -111,6 +112,7 @@
111
112
  "vvedantb/convex-no-collect-in-query": "off",
112
113
  "vvedantb/convex-no-filter-in-query": "off",
113
114
  "vvedantb/convex-no-time-or-random-in-queries": "off",
115
+ "vvedantb/no-filler-copy": "off",
114
116
  "vvedantb/no-tab-search-param": "off"
115
117
  }
116
118
  },
package/oxlint/plugin.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import noDoubleCast from "./rules/no-double-cast.mjs";
2
2
  import noJsonParse from "./rules/no-json-parse.mjs";
3
3
  import noComments from "./rules/no-comments.mjs";
4
+ import noFillerCopy from "./rules/no-filler-copy.mjs";
4
5
  import noConditionalTests from "./rules/no-conditional-tests.mjs";
5
6
  import noInlineObjectTypeAssertion from "./rules/no-inline-object-type-assertion.mjs";
6
7
  import noInlineZodSchema from "./rules/no-inline-zod-schema.mjs";
@@ -24,6 +25,7 @@ export default {
24
25
  "convex-no-time-or-random-in-queries": convexNoTimeOrRandomInQueries,
25
26
  "no-tab-search-param": noTabSearchParam,
26
27
  "no-comments": noComments,
28
+ "no-filler-copy": noFillerCopy,
27
29
  "no-conditional-tests": noConditionalTests,
28
30
  "no-double-cast": noDoubleCast,
29
31
  "no-inline-object-type-assertion": noInlineObjectTypeAssertion,
@@ -0,0 +1,33 @@
1
+ const message =
2
+ "Filler copy. Delete it: the title already says it. Keep copy only where the user needs it to act.";
3
+
4
+ const FILLER = [
5
+ /^\s*Try again\.\s*$/i,
6
+ /^\s*(?:\w+\s+)?you create (?:will )?appear here\.?\s*$/i,
7
+ /^\s*Please wait while we\b/i,
8
+ /^\s*We(?:'|’)re sorry\b/i,
9
+ /^\s*We are sorry\b/i,
10
+ ];
11
+
12
+ function isFiller(text) {
13
+ return FILLER.some((pattern) => pattern.test(text));
14
+ }
15
+
16
+ export default {
17
+ meta: { type: "suggestion", docs: { description: message } },
18
+ create(context) {
19
+ return {
20
+ Literal(node) {
21
+ if (typeof node.value === "string" && isFiller(node.value)) {
22
+ context.report({ node, message });
23
+ }
24
+ },
25
+ TemplateElement(node) {
26
+ if (isFiller(node.value.raw)) context.report({ node, message });
27
+ },
28
+ JSXText(node) {
29
+ if (isFiller(node.value)) context.report({ node, message });
30
+ },
31
+ };
32
+ },
33
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vvedantb/config",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "license": "MIT",
5
5
  "description": "Shared tsconfig bases, oxlint base, Vite, Vitest, Babel and Metro presets, a WXT preset and host-permission helper for Chrome extensions, pinned tool versions, a sync CLI for Claude commands, CLAUDE.md, Cursor environment and Convex tsconfig, a packaged Electron app.asar module check, a shared header and footer check, a no-source-text-in-tests check, a no-comments check with a ratchet baseline, shared oxlint JS plugins and a CLI that adds an extension to Clerk's allowed origins.",
6
6
  "type": "module",