@vwala/tooling-config 1.5.2 → 1.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
|
@@ -109,7 +109,7 @@ Two of Biome's own rules carry the naming convention, both at `warn`:
|
|
|
109
109
|
|
|
110
110
|
| Rule | Enforces |
|
|
111
111
|
| --- | --- |
|
|
112
|
-
| `useFilenamingConvention` | Filenames are kebab-case. Every dot-separated part counts, so `payment.service.ts`, `complete-invoice.command-handler.ts`, `invoice.types.ts` and `invoice.test.ts` all pass while `paymentService.ts` does not. |
|
|
112
|
+
| `useFilenamingConvention` | Filenames are kebab-case. Every dot-separated part counts, so `payment.service.ts`, `complete-invoice.command-handler.ts`, `invoice.types.ts` and `invoice.test.ts` all pass while `paymentService.ts` does not. Filenames starting with `_` or containing `+` or `[` are exempt. |
|
|
113
113
|
| `useNamingConvention` | `camelCase` variables and functions, `PascalCase` types, classes, interfaces and components, `CONSTANT_CASE` for module-level constants. |
|
|
114
114
|
|
|
115
115
|
They are warnings because the convention applies to new code and asks that existing files be renamed only when meaningfully touched — a repository does not have to rename its way in. `useNamingConvention` deliberately does not check object literal or type properties: those keys are usually dictated by an external payload rather than chosen. `strictCase` is off, so `HTTPServer` is accepted alongside `HttpServer`.
|
|
@@ -118,6 +118,8 @@ They are warnings because the convention applies to new code and asks that exist
|
|
|
118
118
|
|
|
119
119
|
`__tests__`, `__mocks__`, `_scripts`, hidden folders, and the `[slug]` / `(group)` / `@slot` segments Next.js and Expo give meaning to are exempt from the folder check.
|
|
120
120
|
|
|
121
|
+
Filenames that carry a routing marker — a leading `_` (`_layout.tsx`), or a `+` or `[` anywhere (`+not-found.tsx`, `hello+api.ts`, `[id].tsx`, `[...slug].tsx`) — are exempt from both `useFilenamingConvention` and `check-naming`, because Expo Router and Next.js own those names. Only the filename counts: `payment_service.ts` still fails, and so does `fooBar.ts` inside `_scripts/`.
|
|
122
|
+
|
|
121
123
|
Paths under `prisma/migrations/` at any depth are ignored entirely because Prisma owns each migration directory name and persists that exact identity in the database, so it cannot be renamed to kebab-case.
|
|
122
124
|
|
|
123
125
|
### Exports
|
package/package.json
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
* warning never fails a build; a file added in this branch has to be an error
|
|
17
17
|
* somewhere, and this is that somewhere. Expect a new badly-named file to be
|
|
18
18
|
* reported twice — once by `biome ci` as a warning, once here as an error.
|
|
19
|
+
* Filenames carrying a routing marker (a leading `_`, or a `+` or `[` anywhere)
|
|
20
|
+
* are skipped by both, because Expo Router and Next.js own those names.
|
|
19
21
|
*
|
|
20
22
|
* Wire this into a repository's own check script and run it from the repository
|
|
21
23
|
* root. Set NAMING_BASE_REF when the default branch is not `origin/main`; when
|
|
@@ -35,6 +37,10 @@ const KEBAB_CASE = /^[a-z0-9]+(-[a-z0-9]+)*$/;
|
|
|
35
37
|
// runnable helpers, anything hidden, and the bracket/paren/@ segments that
|
|
36
38
|
// Next.js and Expo routing give meaning to.
|
|
37
39
|
const RESERVED_FOLDER = /^(__[a-z]+__|_[a-z-]+|\..+|\[.+\]|\(.+\)|@.+|\+.+)$/;
|
|
40
|
+
// Filenames that carry a router's marker — Expo's `_layout` and `+not-found`,
|
|
41
|
+
// its `+api` suffix, a `[param]` / `[...slug]` segment — follow whatever that
|
|
42
|
+
// framework enforces, which is not ours to second-guess.
|
|
43
|
+
const FRAMEWORK_FILE = /^_|[+[]/;
|
|
38
44
|
// Paths whose names another tool owns. Prisma generates a migration directory as
|
|
39
45
|
// `<timestamp>_<name>` and records that exact string in the `_prisma_migrations`
|
|
40
46
|
// table, so the name is an identity rather than a choice: no migration can ever
|
|
@@ -82,7 +88,7 @@ for (const [folder, { segment, isNew }] of folders) {
|
|
|
82
88
|
}
|
|
83
89
|
|
|
84
90
|
for (const file of files) {
|
|
85
|
-
if (!SOURCE_FILE.test(file)) {
|
|
91
|
+
if (!SOURCE_FILE.test(file) || FRAMEWORK_FILE.test(basename(file))) {
|
|
86
92
|
continue;
|
|
87
93
|
}
|
|
88
94
|
// `payment.service.ts` is a name plus two extensions; the convention allows a
|