feat(eslint): Move to ESLint 10 and npm trusted publishing - #308
Merged
Merged
Conversation
- Change unit and unit:watch to depend on build instead of ^build - Package #* imports resolve to ./dist at runtime, so tests ran against a stale or missing dist of the package under test - build still depends on ^build, so dependency order is unchanged Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
- Set the eslint peer range to ^10.0.0 in all configs and presets and allow ^9.0.0 || ^10.0.0 in scripts - Update @eslint/js, @eslint/compat, typescript-eslint, eslint-plugin-import-x, eslint-import-resolver-typescript, eslint-plugin-react-hooks and globals - Wrap eslint-plugin-react with fixupConfigRules because it calls context APIs that ESLint 10 removed; eslint-plugin-jsx-a11y runs as is - Allow the eslint 10 peer for both plugins in pnpm-workspace.yaml and document the pnpm peer-warning workaround in the READMEs - radix now always requires a radix, since ESLint 10 drops as-needed - Drop deprecated @typescript-eslint/no-loop-func in favor of the core rule - Import includeIgnoreFile from eslint/config and drop @eslint/compat from the base config - Fix import-x rule option types for the new defaultOptions typing - Add changesets for the configs, presets and scripts BREAKING CHANGE: ESLint 9 is no longer supported. parseInt without a radix is now an error. Refs devkit-91a.7 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
- Remove the ./rule-overrides export from eslint-config-next and eslint-config-a11y; neither package ever had a rules file (copied in Init) - Drop the require export and point main to the ESM file in the three presets and tsup-config; tsup builds ESM only, so .cjs never existed - Add publint as a lint:package task in every published package, run after build in turbo and in CI, so a broken exports or main entry fails - Fix the tsup-config README: it builds ESM only and is used through @tcd-devkit/tsup-config/lib - Add a patch changeset for the six affected packages Closes devkit-j65 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
- The ESLint configs and presets are ESM-only and export only the import condition, so an eslint.config.cjs file cannot load them - Change "(or .mjs/.cjs)" to "(or .mjs)" in all eleven READMEs Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
🦋 Changeset detectedLatest commit: 6a091d3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
- Remove NPM_TOKEN; npm classic tokens are gone and changesets/action v1.7+ publishes through OIDC when no token is set - Add id-token: write, plus contents and pull-requests write that the action needs, as job permissions - Install npm 11 before publish; trusted publishing needs npm 11.5.1+ and pnpm publish runs the npm CLI - Use the exact GitHub owner case (TheCodeDestroyer) in package.json repository, homepage and bugs URLs, because npm matches repository.url against the OIDC claims case-sensitively Refs devkit-uur Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
3 tasks
Merged
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.
Summary
publintso this cannot happen again.Changes
ESLint 10
eslintpeer range is now^10.0.0in all configs and presets.@tcd-devkit/scriptsallows^9.0.0 || ^10.0.0.@eslint/js,@eslint/compat,typescript-eslint(8.70),eslint-plugin-import-x,eslint-import-resolver-typescript,eslint-plugin-react-hooksandglobals.eslint-plugin-reactwithfixupConfigRules, because it calls context APIs that ESLint 10 removed.eslint-plugin-jsx-a11yruns as is. Both have no ESLint 10 release yet, so the READMEs show how to hide the pnpm peer warning (tracked in devkit-91a.7).radixnow always requires a radix, because ESLint 10 removedas-needed.@typescript-eslint/no-loop-funcand use the coreno-loop-funcrule.includeIgnoreFilenow comes fromeslint/config.Package entry points
./rule-overridesexport fromeslint-config-nextandeslint-config-a11y. These packages have no rules file.tsup-config: remove therequireexport and pointmainto the ESM file. The build makes ESM only.lint:package(publint) task that runs after build, in turbo and in CI..cjsfrom the config file examples.Build
unitandunit:watchnow depend onbuildinstead of^build.Release (trusted publishing)
NPM_TOKEN. Addid-token: write,contents: writeandpull-requests: write. Install npm 11 before publishing, because OIDC needs npm 11.5.1 or later andpnpm publishruns the npm CLI.changesets/action@v1. v1.7 and later support OIDC, and v2 needs Changesets CLI v3.package.jsonURLs now useTheCodeDestroyer. npm comparesrepository.urlwith the OIDC claims and the comparison is case-sensitive.Test plan
pnpm turbo build lint:package lint:types unit //#root-lint:eslint //#root-lint:prettier: 58 of 58 tasks passpnpm packtarballs of all packages andeslint10.10.0:@convex-dev/eslint-plugin.tscandprettier --checkpass.radix(9),max-nested-callbacks(3, a change in ESLint 10 for TS files),no-unnecessary-type-assertion(4, from typescript-eslint 8.70).TheCodeDestroyer/devkit,release.yml)🤖 Generated with Claude Code