Repository navigation
feat(gamut-codemods): rename the ESLint plugin prefix in scope-swap - #42
Merged
Merged
Conversation
…eset Adds @skillsoft/gamut-codemods: the CLI (clean-tree guard, --dry, --only, --no-report, --force), the runner for ast, splice, and file migrations, the shared helpers (module-string finder, leftovers report, version-range checks, flat ESLint config detection), the preset registry, and the fixture harness. The scope-swap preset has its package map but no migrations yet, so a run only reports the lines that still name an old package. Each breaking change lands its migration in its own PR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…swap scope-rename swaps @Codecademy/gamut* and eslint-plugin-gamut for their @SkillSoft names in every module position and in comments. package-json, mdx-imports, and yarnrc cover dependencies, MDX ESM blocks, and .yarnrc.yml lists. @codecademy/gamut-kit has no replacement, so package-json and mf-shared expand it into the packages it bundled. In Module Federation config that makes Gamut a real singleton, which the checklist calls out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eslint-comments rewrites gamut/ directives to @skillsoft/gamut/, and eslint-config updates the plugin name, plugin: extends, and rule keys in legacy .eslintrc files. Under a flat config the prefix is the plugins key, so eslint-comments skips itself and the checklist explains why. Also types eslint-plugin-gamut's recommended severities as literals, so the plugin fits ESLint's Plugin type in a typed flat config. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 20, 2026
Merged
CodeQL read `migration.match(file)` in cli.ts as String.prototype.match on a command-line argument and flagged js/regex-injection. Nothing builds a regex from the path; the method just had the same name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…migrations Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…migrations Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The package-json warning already names each range that's newer than the fork point, so the extra next step only repeated it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # packages/gamut-codemods/src/presets/scope-swap/index.ts
dreamwasp
marked this pull request as ready for review
October 20, 2026 15:59
LinKCoding
approved these changes
Oct 27, 2026
LinKCoding
left a comment
Contributor
There was a problem hiding this comment.
checks look good!
with the flat directive, the next steps include:
1. ESLint directive comments were left as is because the repo uses a flat config, where the rule prefix is the key the plugin is registered under (for example `plugins: { gamut }`). Keep that key, or rename it and every 'gamut/' rule and directive together.
(and the other 3 usual steps)
repro for posterity:
mkdir -p /tmp/swap-flat && cd /tmp/swap-flat && git init -q \
&& printf "import { Box } from '@codecademy/gamut';\n// eslint-disable-next-line gamut/no-inline-style\nexport const A = () => <Box style={{}} />;\n" > a.tsx \
&& printf "module.exports = [];\n" > eslint.config.js \
&& git add -A && git commit -qm init \
&& node /Users/kenny.lin/Documents/eng/codecademy-eng/skillsoft-gamut/packages/gamut-codemods/dist/bin.js scope-swap .
@skillsoft/eslint-plugin-gamut
@skillsoft/gamut
@skillsoft/gamut-agent-tools
@skillsoft/gamut-codemods
@skillsoft/gamut-icons
@skillsoft/gamut-illustrations
@skillsoft/gamut-patterns
@skillsoft/gamut-styles
@skillsoft/gamut-tests
@skillsoft/variance
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #42 +/- ##
=======================================
Coverage ? 99.15%
=======================================
Files ? 23
Lines ? 943
Branches ? 289
=======================================
Hits ? 935
Misses ? 8
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Overview
Breaking change: the ESLint plugin is now
@skillsoft/eslint-plugin-gamut, so thegamut/rule prefix becomes@skillsoft/gamut/. The rule names don't change.Stack (split from #28, merge in order):
mainmaineslint-commentsrewrites// eslint-disable-next-line gamut/x(and the other directive forms) to@skillsoft/gamut/x.eslint-configupdates legacy.eslintrc/.eslintrc.json: the plugin name,plugin:extends, and rule keys. It does a targeted text rewrite, because these files are often JSONC.plugins: { gamut }). Soeslint-commentsskips itself when it finds aneslint.config.*, and the checklist explains why. Flat configs and.eslintrc.jsare left for the leftovers report.@skillsoft/eslint-plugin-gamut:configs.recommendeduses literal'error'severities (as const), so the plugin type-checks as an ESLintPluginin a typed flat config.PR Checklist
Testing Instructions
yarn nx test gamut-codemods(expect 71 tests) andyarn nx test eslint-plugin-gamut.Legacy config run:
The directive and
.eslintrc.jsonshould both use@skillsoft/gamut.Flat config run: in a new throwaway repo with an
eslint.config.js, the output starts with[eslint-comments] skipped: found flat ESLint config. Directives are left alone, and the next steps explain the plugins key.PR Links and Envs
🤖 Generated with Claude Code