fix(create-plugin): support @grafana/eslint-config v10 in scaffold - #2873
Conversation
|
|
1 similar comment
|
|
jackw
left a comment
There was a problem hiding this comment.
Awesome work @L2D2Grafana. Can you fix the version in migrations.ts please then we should be good to merge.
| }, | ||
| { | ||
| name: '014-eslint-config-v10', | ||
| version: '7.10.2', |
There was a problem hiding this comment.
I really need to fix this but... please could you sync this branch with main and then update this version to 7.11.1 to guarantee it'll run in next release version?
@grafana/eslint-config@10.0.0 removed the ./flat.js subpath export, so the scaffolded .config/eslint.config.mjs crashed with ERR_PACKAGE_PATH_NOT_EXPORTED. Update the template to import from the package root and bump devDependencies (@stylistic/eslint-plugin-ts -> @stylistic/eslint-plugin, eslint-plugin-react-hooks) to satisfy the new peer requirements. Add migration 014-eslint-config-v10 so existing plugins get the same fix via `create-plugin update`. Fixes: #2871 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The 014-eslint-config-v10 migration bumped @grafana/eslint-config, @stylistic/eslint-plugin, and eslint-plugin-react-hooks, but left eslint-config-prettier at ^8.8.0 (set by an earlier migration). @grafana/eslint-config@10.0.0 requires eslint-config-prettier >=9.1.0, so npm install failed with ERESOLVE on plugins that hadn't already picked up a newer eslint-config-prettier by other means. Caught by the "Test create-plugin update command" CI job, which runs the full migration chain against a plugin scaffolded with the oldest supported create-plugin version. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
0fbfd98 to
022e348
Compare

Summary 📝
.config/eslint.config.mjsimported@grafana/eslint-config/flat.js, a subpath removed in@grafana/eslint-config@10.0.0, crashingeslintwithERR_PACKAGE_PATH_NOT_EXPORTED. New scaffolds now import from@grafana/eslint-configdirectly and pin^10.0.0, with@stylistic/eslint-plugin-tsswapped for the@stylistic/eslint-pluginpeer dependency it now requires.014-eslint-config-v10so existing plugins get the same fix viacreate-plugin update.Test 🧪
npm run test -w @grafana/create-plugin -- --run(309 passed, including 6 new tests for the migration)npm run typecheck -w @grafana/create-pluginandnpm run lint -w @grafana/create-pluginnpm install && npm run lint— passes cleanly with@grafana/eslint-config@10.0.0(previously crashed)create-plugin updateagainst an existing plugin (logs-drilldown) and confirmed the migration rewrites.config/eslint.config.mjsandpackage.jsonas expected🤖 Generated with Claude Code