@vvedantb/config 0.18.0 → 0.20.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,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.20.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`cb8ab26`](https://github.com/vvedantb/v/commit/cb8ab264a6276104940defff1e6b8097ab1d4259) Thanks [@vvedantb](https://github.com/vvedantb)! - Faster first load for web apps built with `defineWebViteConfig`.
8
+
9
+ - New `originHints()` Vite plugin, on by default. It adds `preconnect` links for the Convex and Clerk origins and starts the Clerk JS and Clerk UI scripts from the HTML, so they download with the app bundle. The script URLs come from the app's own `@clerk/react`. Apps that do not depend on `@clerk/react` get no Clerk tags. Pass `originHints: false` to turn it off.
10
+ - `vendorChunks` no longer has a `radix` group. It forced every Radix primitive into the entry chunk; each primitive now loads with the chunk that uses it. `VendorChunk` drops `"radix"`.
11
+
12
+ ## 0.19.0
13
+
14
+ ### Minor Changes
15
+
16
+ - [`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.
17
+
3
18
  ## 0.18.0
4
19
 
5
20
  ### 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. |
@@ -275,7 +276,7 @@ export default defineConfig({
275
276
  | `tsconfigPaths` | `resolve.tsconfigPaths: true`. |
276
277
  | `alias` | `resolve.alias` as given (object or `{ find, replacement }` list). `srcAlias(dir)` is `{ "@": "<dir>/src" }`. |
277
278
  | `dedupe` | `resolve.dedupe` as given. `REACT_DEDUPE` is `react`, `react-dom`, `convex`, `@tanstack/react-router`, `@clerk/react`. |
278
- | `vendorChunks` | `build`: `outDir: "dist"`, `chunkSizeWarningLimit: 1000` and rolldown chunk groups `vendor-radix`, `vendor-convex`, `vendor-clerk`, `vendor-motion` (priority 15). An object keyed by group (`radix`, `convex`, `clerk`, `motion`) replaces that group's `test` RegExp. |
279
+ | `vendorChunks` | `build`: `outDir: "dist"`, `chunkSizeWarningLimit: 1000` and rolldown chunk groups `vendor-convex`, `vendor-clerk`, `vendor-motion` (priority 15). Radix has no group, so each primitive loads with the chunk that uses it. An object keyed by group (`convex`, `clerk`, `motion`) replaces that group's `test` RegExp. |
279
280
 
280
281
  Keys that are not asked for are left out, so `resolve` and `build` appear only when set. `reactPlugins(setup)` and `vendorChunkBuild(tests?)` are exported on their own.
281
282
 
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export { runClerkAllow, type ClerkAllowFetch, type ClerkAllowIo, type ClerkAllow
9
9
  export { SHARED_WORKER_SETUP, sharedWorkerVitestConfig, type SharedWorkerOptions, type SharedWorkerTestConfig, type SharedWorkerVitestConfig, } from "./vitest-shared.js";
10
10
  export { CHECK_IDS, checkCiReusableWorkflow, checkConfigVersion, checkNoEslint, checkNoPlainTsc, checkNoPrettier, checkOxlintDep, checkOxlintScript, checkTsrsPresent, isOlderMinor, loadRepo, loadWaivers, rangeMinorFloor, runDoctor, runDoctorChecks, type CheckId, type CheckResult, type CheckStatus, type DoctorCheckOptions, type DoctorIo, type LoadedWaivers, type PackageEntry, type RepoModel, } from "./doctor.js";
11
11
  export { REACT_DEDUPE, defineWebViteConfig, defineWebVitestConfig, reactPlugins, srcAlias, vendorChunkBuild, type AliasOptions, type BabelReactCompiler, type PathOptions, type ReactSetup, type ResolveConfig, type RouterPluginOptions, type VendorChunk, type VendorChunkGroup, type VitePlugin, type VitePluginOption, type WebBuildConfig, type WebViteConfig, type WebViteOptions, type WebVitestConfig, type WebVitestOptions, } from "./vite.js";
12
+ export { clerkScriptTags, clerkScriptsFromReact, originHintTags, originHints, type ClerkScripts, type HeadTag, type OriginHintsOptions, type OriginHintsPlugin, type OriginHintsResolvedConfig, } from "./origin-hints.js";
12
13
  export { defineExpoMetroConfig, expoBabelConfig, type BabelApi, type ExpoBabelConfig, type ExpoMetroOptions, type MetroConfigLike, type MetroResolveContext, type MetroResolveRequest, type NativeWindMetroOptions, } from "./expo.js";
13
14
  export { DEFAULT_RELEASE_SIGNING_MARKER, appendReleaseSigning, releaseSigningGradle, withReleaseSigning, type AppBuildGradleMod, type ReleaseSigningOptions, type ReleaseSigningPropertyKeys, type WithAppBuildGradle, type WithReleaseSigningOptions, } from "./release-signing.js";
14
15
  export { ABI_SPLITS_MARKER, KEEP_RULES, KEEP_RULES_MARKER, abiSplitsGradle, keepRulesBlock, withKeepRules, resolveReleaseApkNames, splitApkFileName, splitArchitectures, withAbiSplits, type ReleaseApkNames, DEFAULT_GRADLE_PROPERTY_EDITS, DEFAULT_REACT_NATIVE_ARCHITECTURES, buildGradlePropertyEdits, ccacheInitScript, resolveReactNativeArchitectures, apkFileName, easProfileEntries, formatGithubOutput, formatReleaseJson, gradlePropertiesEdits, parseAndroidReleaseConfig, parseBadging, publicEnvDefault, readExpoVersion, releaseJson, syncPackageJsonVersion, syncExpoVersion, validateVersionCode, validateVersionName, gradleVersionNameOk, type AndroidReleaseConfig, type BadgingFields, type GradlePropertyEdit, type PublicEnvSource, type ReadAppFile, type ReleaseJson, } from "./android-release.js";
package/dist/index.js CHANGED
@@ -9,6 +9,7 @@ export { runClerkAllow, } from "./clerk-allow.js";
9
9
  export { SHARED_WORKER_SETUP, sharedWorkerVitestConfig, } from "./vitest-shared.js";
10
10
  export { CHECK_IDS, checkCiReusableWorkflow, checkConfigVersion, checkNoEslint, checkNoPlainTsc, checkNoPrettier, checkOxlintDep, checkOxlintScript, checkTsrsPresent, isOlderMinor, loadRepo, loadWaivers, rangeMinorFloor, runDoctor, runDoctorChecks, } from "./doctor.js";
11
11
  export { REACT_DEDUPE, defineWebViteConfig, defineWebVitestConfig, reactPlugins, srcAlias, vendorChunkBuild, } from "./vite.js";
12
+ export { clerkScriptTags, clerkScriptsFromReact, originHintTags, originHints, } from "./origin-hints.js";
12
13
  export { defineExpoMetroConfig, expoBabelConfig, } from "./expo.js";
13
14
  export { DEFAULT_RELEASE_SIGNING_MARKER, appendReleaseSigning, releaseSigningGradle, withReleaseSigning, } from "./release-signing.js";
14
15
  export { ABI_SPLITS_MARKER, KEEP_RULES, KEEP_RULES_MARKER, abiSplitsGradle, keepRulesBlock, withKeepRules, resolveReleaseApkNames, splitApkFileName, splitArchitectures, withAbiSplits, DEFAULT_GRADLE_PROPERTY_EDITS, DEFAULT_REACT_NATIVE_ARCHITECTURES, buildGradlePropertyEdits, ccacheInitScript, resolveReactNativeArchitectures, apkFileName, easProfileEntries, formatGithubOutput, formatReleaseJson, gradlePropertiesEdits, parseAndroidReleaseConfig, parseBadging, publicEnvDefault, readExpoVersion, releaseJson, syncPackageJsonVersion, syncExpoVersion, validateVersionCode, validateVersionName, gradleVersionNameOk, } from "./android-release.js";
@@ -0,0 +1,55 @@
1
+ /** A `<link>` or `<script>` that Vite adds to the start of `<head>`. */
2
+ export interface HeadTag {
3
+ tag: "link" | "script";
4
+ attrs: Record<string, string | boolean>;
5
+ injectTo: "head-prepend";
6
+ }
7
+ /** The part of Vite's resolved config that `originHints` reads. */
8
+ export interface OriginHintsResolvedConfig {
9
+ root: string;
10
+ env: Record<string, string>;
11
+ }
12
+ /** The Vite plugin that `originHints` returns. */
13
+ export interface OriginHintsPlugin {
14
+ name: "vvedantb-origin-hints";
15
+ configResolved: (config: OriginHintsResolvedConfig) => Promise<void>;
16
+ transformIndexHtml: () => HeadTag[];
17
+ }
18
+ /** The script URLs and attributes that `ClerkProvider` loads, for one publishable key. */
19
+ export interface ClerkScripts {
20
+ jsUrl: string;
21
+ uiUrl: string;
22
+ jsAttributes: Record<string, string>;
23
+ uiAttributes: Record<string, string>;
24
+ }
25
+ export interface OriginHintsOptions {
26
+ /** Env key for the Convex deployment URL. Default `VITE_CONVEX_URL`. */
27
+ convexUrlEnv?: string;
28
+ /** Env key for the Clerk publishable key. Default `VITE_CLERK_PUBLISHABLE_KEY`. */
29
+ clerkKeyEnv?: string;
30
+ /** Start the Clerk JS and Clerk UI scripts from the HTML. Default `true` when a Clerk key is set. */
31
+ clerkScripts?: boolean;
32
+ /** Reads the Clerk script URLs. Default: `@clerk/react/internal`, resolved from the app root. */
33
+ loadClerkScripts?: (publishableKey: string, root: string) => Promise<ClerkScripts | undefined>;
34
+ }
35
+ /**
36
+ * The Clerk script URLs and attributes from the app's own `@clerk/react`, so they match
37
+ * what the SDK requests. `undefined` when the app at `root` does not depend on `@clerk/react`.
38
+ */
39
+ export declare function clerkScriptsFromReact(publishableKey: string, root: string): Promise<ClerkScripts | undefined>;
40
+ /** `preconnect` and `dns-prefetch` links for each origin. */
41
+ export declare function originHintTags(origins: readonly string[]): HeadTag[];
42
+ /**
43
+ * Async `<script>` tags for Clerk JS and Clerk UI. The Clerk loader reuses a tag
44
+ * with `data-clerk-js-script` or `data-clerk-ui-script`, so each file still downloads once.
45
+ */
46
+ export declare function clerkScriptTags(scripts: ClerkScripts): HeadTag[];
47
+ /**
48
+ * A Vite plugin that reads the Convex URL and Clerk key from build-time env and adds:
49
+ * - `preconnect` and `dns-prefetch` links for the Convex and Clerk origins
50
+ * - async Clerk JS and Clerk UI script tags, so they download with the app bundle,
51
+ * not after it runs
52
+ *
53
+ * Without the env values it adds nothing.
54
+ */
55
+ export declare function originHints(options?: OriginHintsOptions): OriginHintsPlugin;
@@ -0,0 +1,104 @@
1
+ import { readFile } from "node:fs/promises";
2
+ import { createRequire } from "node:module";
3
+ import { resolve } from "node:path";
4
+ import { pathToFileURL } from "node:url";
5
+ const CLERK_INTERNAL_EXPORTS = [
6
+ "clerkJSScriptUrl",
7
+ "clerkUIScriptUrl",
8
+ "buildClerkJSScriptAttributes",
9
+ "buildClerkUIScriptAttributes",
10
+ ];
11
+ function isClerkInternal(module) {
12
+ return CLERK_INTERNAL_EXPORTS.every((name) => typeof Reflect.get(module, name) === "function");
13
+ }
14
+ function dependsOnClerkReact(packageJson) {
15
+ return ["dependencies", "devDependencies"].some((field) => {
16
+ const deps = Reflect.get(packageJson, field);
17
+ return typeof deps === "object" && deps !== null && "@clerk/react" in deps;
18
+ });
19
+ }
20
+ /**
21
+ * The Clerk script URLs and attributes from the app's own `@clerk/react`, so they match
22
+ * what the SDK requests. `undefined` when the app at `root` does not depend on `@clerk/react`.
23
+ */
24
+ export async function clerkScriptsFromReact(publishableKey, root) {
25
+ const packageJsonPath = resolve(root, "package.json");
26
+ const packageJson = JSON.parse(await readFile(packageJsonPath, "utf8"));
27
+ if (!dependsOnClerkReact(packageJson))
28
+ return undefined;
29
+ const require = createRequire(packageJsonPath);
30
+ const entry = require.resolve("@clerk/react/internal");
31
+ const clerk = await import(pathToFileURL(entry).href);
32
+ if (!isClerkInternal(clerk)) {
33
+ throw new Error(`originHints: ${entry} does not export the Clerk script helpers.`);
34
+ }
35
+ const options = { publishableKey };
36
+ return {
37
+ jsUrl: clerk.clerkJSScriptUrl(options),
38
+ uiUrl: clerk.clerkUIScriptUrl(options),
39
+ jsAttributes: clerk.buildClerkJSScriptAttributes(options),
40
+ uiAttributes: clerk.buildClerkUIScriptAttributes(options),
41
+ };
42
+ }
43
+ function originOf(url) {
44
+ try {
45
+ return new URL(url).origin;
46
+ }
47
+ catch {
48
+ return undefined;
49
+ }
50
+ }
51
+ function envValue(env, key) {
52
+ const value = env[key];
53
+ return value ? value : undefined;
54
+ }
55
+ /** `preconnect` and `dns-prefetch` links for each origin. */
56
+ export function originHintTags(origins) {
57
+ return [...new Set(origins)].flatMap((origin) => [
58
+ { tag: "link", attrs: { rel: "preconnect", href: origin, crossorigin: true }, injectTo: "head-prepend" },
59
+ { tag: "link", attrs: { rel: "dns-prefetch", href: origin }, injectTo: "head-prepend" },
60
+ ]);
61
+ }
62
+ /**
63
+ * Async `<script>` tags for Clerk JS and Clerk UI. The Clerk loader reuses a tag
64
+ * with `data-clerk-js-script` or `data-clerk-ui-script`, so each file still downloads once.
65
+ */
66
+ export function clerkScriptTags(scripts) {
67
+ const tag = (src, marker, attributes) => ({
68
+ tag: "script",
69
+ attrs: { async: true, crossorigin: "anonymous", [marker]: true, ...attributes, src },
70
+ injectTo: "head-prepend",
71
+ });
72
+ return [
73
+ tag(scripts.jsUrl, "data-clerk-js-script", scripts.jsAttributes),
74
+ tag(scripts.uiUrl, "data-clerk-ui-script", scripts.uiAttributes),
75
+ ];
76
+ }
77
+ /**
78
+ * A Vite plugin that reads the Convex URL and Clerk key from build-time env and adds:
79
+ * - `preconnect` and `dns-prefetch` links for the Convex and Clerk origins
80
+ * - async Clerk JS and Clerk UI script tags, so they download with the app bundle,
81
+ * not after it runs
82
+ *
83
+ * Without the env values it adds nothing.
84
+ */
85
+ export function originHints(options = {}) {
86
+ const loadClerkScripts = options.loadClerkScripts ?? clerkScriptsFromReact;
87
+ let tags = [];
88
+ return {
89
+ name: "vvedantb-origin-hints",
90
+ async configResolved(config) {
91
+ const convexUrl = envValue(config.env, options.convexUrlEnv ?? "VITE_CONVEX_URL");
92
+ const clerkKey = envValue(config.env, options.clerkKeyEnv ?? "VITE_CLERK_PUBLISHABLE_KEY");
93
+ const clerk = clerkKey ? await loadClerkScripts(clerkKey, config.root) : undefined;
94
+ const origins = [convexUrl && originOf(convexUrl), clerk && originOf(clerk.jsUrl)].filter((origin) => Boolean(origin));
95
+ tags = [
96
+ ...originHintTags(origins),
97
+ ...(clerk && options.clerkScripts !== false ? clerkScriptTags(clerk) : []),
98
+ ];
99
+ },
100
+ transformIndexHtml() {
101
+ return tags;
102
+ },
103
+ };
104
+ }
package/dist/vite.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { type OriginHintsOptions } from "./origin-hints.js";
1
2
  /** A Vite plugin: Vite's `Plugin` needs only `name`. */
2
3
  export interface VitePlugin {
3
4
  name: string;
@@ -52,7 +53,7 @@ export interface ResolveConfig {
52
53
  alias?: AliasOptions;
53
54
  dedupe?: string[];
54
55
  }
55
- export type VendorChunk = "radix" | "convex" | "clerk" | "motion";
56
+ export type VendorChunk = "convex" | "clerk" | "motion";
56
57
  export interface VendorChunkGroup {
57
58
  name: string;
58
59
  test: RegExp;
@@ -79,6 +80,8 @@ export interface WebViteOptions<Preset> extends PathOptions {
79
80
  plugins?: VitePluginOption[];
80
81
  dedupe?: readonly string[];
81
82
  vendorChunks?: boolean | Partial<Record<VendorChunk, RegExp>>;
83
+ /** Convex and Clerk preconnects and early Clerk scripts (see `originHints`). On by default; `false` turns it off. */
84
+ originHints?: boolean | OriginHintsOptions;
82
85
  }
83
86
  export interface WebViteConfig {
84
87
  plugins: VitePluginOption[];
@@ -114,7 +117,7 @@ export declare const REACT_DEDUPE: readonly ["react", "react-dom", "convex", "@t
114
117
  export declare function srcAlias(dirname: string): Record<string, string>;
115
118
  /** The plugin-react plugins for a `ReactSetup`, in order. */
116
119
  export declare function reactPlugins<Preset>(setup: ReactSetup<Preset>): VitePluginOption[];
117
- /** `outDir: "dist"`, a 1000 kB chunk warning and vendor chunks for Radix, Convex, Clerk and Motion. */
120
+ /** `outDir: "dist"`, a 1000 kB chunk warning and vendor chunks for Convex, Clerk and Motion. Radix stays with the chunk that uses each primitive. */
118
121
  export declare function vendorChunkBuild(tests?: Partial<Record<VendorChunk, RegExp>>): WebBuildConfig;
119
122
  /**
120
123
  * The shared part of a web app's `vite.config.ts`: plugins, `resolve` and `build`.
package/dist/vite.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { resolve } from "node:path";
2
+ import { originHints } from "./origin-hints.js";
2
3
  /** Packages that hold React context. pnpm can install two copies; dedupe keeps one. */
3
4
  export const REACT_DEDUPE = [
4
5
  "react",
@@ -8,12 +9,11 @@ export const REACT_DEDUPE = [
8
9
  "@clerk/react",
9
10
  ];
10
11
  const VENDOR_TESTS = {
11
- radix: /node_modules[\\/]@radix-ui/,
12
12
  convex: /node_modules[\\/]convex/,
13
13
  clerk: /node_modules[\\/]@clerk/,
14
14
  motion: /node_modules[\\/](motion|framer-motion)/,
15
15
  };
16
- const VENDOR_ORDER = ["radix", "convex", "clerk", "motion"];
16
+ const VENDOR_ORDER = ["convex", "clerk", "motion"];
17
17
  /** `{ "@": "<dirname>/src" }`. Pass `import.meta.dirname`. */
18
18
  export function srcAlias(dirname) {
19
19
  return { "@": resolve(dirname, "src") };
@@ -27,7 +27,7 @@ export function reactPlugins(setup) {
27
27
  }
28
28
  return [setup.plugin()];
29
29
  }
30
- /** `outDir: "dist"`, a 1000 kB chunk warning and vendor chunks for Radix, Convex, Clerk and Motion. */
30
+ /** `outDir: "dist"`, a 1000 kB chunk warning and vendor chunks for Convex, Clerk and Motion. Radix stays with the chunk that uses each primitive. */
31
31
  export function vendorChunkBuild(tests = {}) {
32
32
  return {
33
33
  outDir: "dist",
@@ -70,6 +70,9 @@ export function defineWebViteConfig(options) {
70
70
  plugins.push(options.router.plugin({ ...options.router.options, autoCodeSplitting: true }));
71
71
  }
72
72
  plugins.push(...reactPlugins(options.react), ...(options.plugins ?? []).filter(isPlugin));
73
+ if (options.originHints !== false) {
74
+ plugins.push(originHints(options.originHints === true ? {} : options.originHints));
75
+ }
73
76
  const config = { plugins };
74
77
  const resolved = resolveConfig(options);
75
78
  if (resolved)
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.20.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",