Repository navigation
chore: quote the scratch-vm format-message lint glob so Windows lints… - #753
Open
jonathanmendoza-tx wants to merge 1 commit into
Open
jonathanmendoza-tx wants to merge 1 commit into
jonathanmendoza-tx wants to merge 1 commit into
Conversation
… the same files as CI Refs scratchfoundation#750 The quoted single-level pattern gives the same 77 files on both platforms
This branch has not been deployed
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.
… the same files as CI
Resolves
Refs #750 (the
format-message lintfinding from the comments). One of several fixes for that issue.Proposed Changes
In
packages/scratch-vm/package.json, thelintscript changes fromto
That is the only change. The pattern is now quoted and spelled
src/*/*.js, which is the set of files the unquotedsrc/**/*.jshas always expanded to on Linux.What this does not do: the
format-message lintstep does not lintsrc/index.js,src/virtual-machine.jsorsrc/extensions/*/index.js, on any platform, and it never has. It has been that way since the step was added in 2017 (commit 652316c, "Preliminary localization (#777)"). This PR keeps that as is. It does not add or remove coverage.Reason for Changes
npm run lintinscratch-vmfails on Windows even with LF line endings. The unquotedsrc/**/*.jsis handled differently by each shell:/bin/sh, which expands**as a single*.format-message linttherefore receives the 77 files matchingsrc/*/*.js, and CI passes.cmd.exepasses the pattern through unexpanded. The CLI's bundled glob then recurses and finds 99 files. The extra 22 aresrc/index.js,src/virtual-machine.js, the 14src/extensions/*/index.jsfiles and 6 helper files undersrc/extensions.format-message-cli6.2.4 bundles ESLint 6.8 withecmaVersion: 2019hard-coded and no option to change it. Those 22 extra files make it exit 23:Definition for rule '@stylistic/max-len' was not foundin the extension entry pointssrc/virtual-machine.js 809:65 Parsing error: Unexpected token .(optional chaining)My comment on #750 offered two fixes. The other one was to quote
"src/**/*.js"so both platforms lint the deeper files. That is not viable, because the CLI's parser cannot read that syntax; it would make Linux CI fail the same way. Quoting"src/*/*.js"is the conservative option. The 77 files are the same whether the shell expands the pattern or the CLI's glob does (checked both ways: Git Bashls, which behaves like CI'ssh, and the bundled glob 5).Real coverage of the extension entry points would mean running
eslint-plugin-format-messageunder the repo's ESLint 9 config, which currently enables none of those rules. That is a different and larger change.Test Coverage
No new test file. This changes a dev script, not package code, so there is nothing for a unit test to exercise. The evidence is the lint runs in
packages/scratch-vmon Windows (cmd.exe, Node 24.21.0):format-message lint "src/**/*.js"run directly exits 23, with the 22@stylistic/max-lenerrors and thevirtual-machine.jsparse error described above.npm run lintexits 0. ESLint reports 0 errors and 714 warnings. The format-message step reports 0 errors and 11 warnings (literal-patternandliteral-locale, inengine/runtime.js,extension-support/extension-manager.jsandutil/maybe-format-message.js). The file set is 77.