🏗️✨:lint filenames for kebab-case - #1274
Merged
DerekNonGeneric merged 2 commits intoAug 13, 2026
Merged
Conversation
DerekNonGeneric
force-pushed
the
feat/lint-kebab-case
branch
from
June 15, 2024 03:22
c94e54c to
c7f1410
Compare
DerekNonGeneric
force-pushed
the
feat/lint-kebab-case
branch
2 times, most recently
from
June 16, 2024 17:23
93be89e to
a587c30
Compare
Member
Author
|
i think it would be nice to include the |
DerekNonGeneric
force-pushed
the
feat/lint-kebab-case
branch
from
June 16, 2024 23:15
46f9db5 to
c103036
Compare
DerekNonGeneric
force-pushed
the
feat/lint-kebab-case
branch
from
August 12, 2026 02:35
c103036 to
3afb5ea
Compare
✅ Deploy Preview for gh-pages-openinf ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
DerekNonGeneric
marked this pull request as ready for review
August 12, 2026 02:38
This was referenced Aug 12, 2026
DerekNonGeneric
force-pushed
the
feat/lint-kebab-case
branch
2 times, most recently
from
August 13, 2026 02:35
f612eb7 to
1363f27
Compare
Revives the intent of the original branch: filenames should be predictable, and under `collections/` a filename is a published URL. Reports rather than renames, which is where this departs from the earlier attempt. A rename has to be accompanied by updating every import, include and link that points at the old name, and no formatter can do that -- an autofix here would silently change URLs. Names a tool dictates are out of scope: anything under a dot-directory, and the shouted metadata names (`README.md`, `AUTHORS`, `LICENSE/`). `_data/eleventyDataSchema.mjs` is exempt outright, since Eleventy takes the global data key from the filename. Assisted-by: Claude-Code:claude-opus-5
Nothing references either file, so this is a rename and no more. Assisted-by: Claude-Code:claude-opus-5
DerekNonGeneric
force-pushed
the
feat/lint-kebab-case
branch
from
August 13, 2026 05:16
1363f27 to
6f44f51
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Picks up the branch opened in June 2024, keeping the intent and replacing the implementation. Filenames should be predictable, and under
collections/a filename is a published URL.Why the original commits are not in here
Rebasing was tried first and abandoned. The branch was 435 commits behind, and every conflict was in
package.jsonandpnpm-lock.yaml— resolving them meant re-addingrecursive-readdirandchange-caseto a 2026 lockfile only to remove them again. The old tip isc103036if any of it is wanted back.What was there could not have worked:
for (path of filepaths)— no declaration. In an ESM module that is aReferenceErrorthe first time the callback fires, so the script had never run. The final commit message, "this is still missing logging", is consistent with that.parsedPath.ext === '.ts', and all 29 build task files are.mtsnow. Even fixed, it would match nothing.recursive-readdirduplicates theglob()helper that replaced globby in 🏗️♻️:replace globby with node's built-in fs.promises.glob #1784, and drags inminimatch@3,brace-expansion@1andconcat-map.change-casewould have been a dependency for one function.Reports, rather than renames
The original was a
formattask callingrenameSync. This is averifytask, and I think that is the more important change: a rename has to be accompanied by updating every import,{% include %}and link that points at the old name, and no formatter can do that. An autofix here would silently change published URLs. Same reasoning as #1803 — a verify task that edits is a verify task you cannot trust.The title said "lint", so this is faithful to it.
The rule
A name is a run of lowercase words joined by hyphens, with an optional leading underscore for the things Eleventy and Sass mark as not-output (
_layouts/,_custom.scss). Extensions are not part of the name, and there may be several (vnu-jar.d.ts).Two categories are out of scope, because the name is not ours to pick:
.github/ISSUE_TEMPLATE/,.vscode/settings.json,.devcontainer/Dockerfile. Whatever reads them decides what they are called.README.md,AUTHORS,COPYING.md,LICENSE/and the licence identifiers inside it (CC-BY-SA-4.0.txt).One exemption is spelled out:
_data/eleventyDataSchema.mjs. Eleventy takes the global data key from the filename, so kebab-casing it would quietly unhook the front matter validator that #1802 just fixed.What it catches
Across 212 tracked paths, two — both unreferenced, so the second commit is a rename and nothing else:
Probed with deliberate violations, in the manner of the rest of the pipeline:
collections/_pages/snake_case.mdcollections/_pages/Bad Dir/collections/_pages/Bad Dir/someFile.md_assets/styles/_OkPartial.scssConsidered instead: biome
Biome 2.5.7 has
style/useFilenamingConventionwith akebab-caseoption, and it is free. I did not use it: it only sees the 31 JS/TS files, on this tree it reports exactly one thing and that thing is a false positive (eleventyDataSchema.mjs), and the 134 content files that become URLs are where the risk is. Running both would mean two enforcers with two exemption lists.Verification
nps test— 14/14 tasks passnps build— 26 copied, 34 written, unchanged by the renamenps verify.filenamesexits 0 on this tree, 1 on each planted violation aboveDepends on nothing else; #1804 is unrelated but touches the same helper.