static: biome --write cleanups (optional-chain + unused catch binding) - #21
Merged
Conversation
Apply biome's fixable lint findings to the three JS files that PR #18's glob coverage (biome.json static/**/*.js) started linting but did not yet fix: useOptionalChain in map.js / feature-map.js / gradient-profile.js, and a noUnusedVariables catch binding (catch (e) -> catch (_e)). All mechanical and semantically identical — optional chaining on plain object property reads (f.geometry && f.geometry.coordinates -> f.geometry?.coordinates), and the !payload || !payload.samples guard collapses to !payload?.samples. `biome check` is now clean (0 warnings). Cache-bust ?v= is mtime-derived (_shared.py), so the reformatted files ship with fresh versions on the next `levels build`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Applies biome's fixable lint findings to the three JS files that #18's glob coverage (
biome.json→static/**/*.js) started linting but hadn't yet fixed.Changes (all mechanical, semantically identical):
map.js,feature-map.js,gradient-profile.js:useOptionalChainon plain object property reads —f.geometry && f.geometry.coordinates→f.geometry?.coordinates;(geom && geom.features) || []→(geom?.features) || [];!payload || !payload.samples→!payload?.samples.gradient-profile.js:noUnusedVariables— unusedcatch (e)→catch (_e).biome checkis now clean (0 warnings). Cache-bust?v=is mtime-derived, so the files ship with fresh versions.Already deployed: run live via
levels buildon the host (verified: docroot JS matches repo,map.js?v=1779655707, site 200, servedmap.jscarries the optional-chain change). PR is for the record + CI; the live tree sits on this branch until merge.Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com