fix: exempt .mjs and .cjs from indent-size checks in shared .editorconfig - #165
Open
vector-arrow wants to merge 1 commit into
Open
fix: exempt .mjs and .cjs from indent-size checks in shared .editorconfig#165vector-arrow wants to merge 1 commit into
vector-arrow wants to merge 1 commit into
Conversation
.mjs and .cjs are plain JavaScript with an explicit module type (ESM /
CommonJS). They matched no rule and fell through to [*] (indent_size = 4),
while *.js is explicitly unset — so identical code passed as script.js and
failed as script.mjs.
Affected today:
- Arrow-air/website: 4 .mjs scripts, 47 editorconfig-checker errors
- Arrow-air/project-flight-tracking: frontend/tailwind.config.cjs (2-space,
no local exclusion)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Terraform Format and Style 🖌
|
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.
Problem
src/templates/all/.editorconfigexempts*.jsfromindent_size, but not*.mjsor*.cjs. Those extensions match no rule in the file, so they fall through to[*](indent_size = 4). The result: identical code passes asscript.jsand fails asscript.mjs.Because
.editorconfigis in thefileslocal insrc/main.tf(managed, overwritten on every sync), downstream repos cannot fix this locally — any edit is reverted on the next sync.Change
One line.
.mjs/.cjsare plain JavaScript with an explicit module type (ESM / CommonJS) — not a different language, and nothing in the file suggests a deliberate stance on module syntax. The group already containsCargo.lock, so it is a "files whose indentation we don't police" bucket rather than a language grouping.Repos affected today
Arrow-air/website.mjsunderscripts/Arrow-air/project-flight-trackingfrontend/tailwind.config.cjs.editorconfig-checker.jsonexclusionThe
project-flight-trackinghit is why.cjsis included rather than just.mjs.Note for anyone hitting this downstream
Two of the website's
.mjsfiles are code generators holding the emitted file in a template literal —gen-bounty-form.mjsemits a GitHub issue-form YAML andgen-discipline-icons.mjsemits a TSX component, both necessarily 2-space. All 93 violating lines are inside those template literals; none are the scripts' own code. Reformatting them to 4-space would have corrupted the generated bounty form, since YAML indentation is semantic. Check for that pattern before reformatting anything on an.mjschecker failure.Verification
Nothing meaningful runs in
tf-github— the template is inert data. Verify downstream after sync:make editorconfig-testinArrow-air/website(ornpx --yes editorconfig-checkerwithout Docker) should go from 47 errors to clean. No file other than*.mjs/*.cjschanges status.Follow-ups
## DO NOT EDIT!header is applied toseeded_filestoo (e.g..cspell.config.yaml), where it's misleading — those are repo-owned after creation. Happy to open that as its own PR if wanted; deliberately not bundled here.🤖 Generated with Claude Code