Dependency Version Upgrades
Renovate
We rely on renovate bot to automatically raise PRs to update our dependencies using this configuration.
Dependency Dashboard
Renovate is configured to manage a dependency dashboard issue which can be used to understand the tool's state:
- What dependency bumps require approval for renovate to action (eg because they are major bumps)
- What dependency bumps it is working on (i.e. pending)
- What dependency bumps are currently open and awaiting review + merge
- Note that renovate is an asynchronous tools so this list will lag behind a bit after you merge PRs
- What dependency bumps have been ignored
Ticking a checkbox in this issue will cause renovate to action the dependency:
- If you tick one in the "Pending Approval" list it will approve it and renovate will raise a PR.
- If you tick one in the "Pending Status Checks" list it will cause renovate to create the PR before its internal status checks are complete.
- If you tick one in the "Open" list it will cause renovate to rebase the PR (if there are no manual changes) or recreate the PR (if there are manual changes).
- If you tick one in the "Ignored or Blocked" list it will cause renovate to recreate the PR.
Merging Renovate PRs
Renovate will not automatically merge its dependency PRs because we have branch protection turned on. Renovate PRs must go through the same workflow as human PRs: i.e. all PRs must be approved with passing status checks before they can be merged.
Renovate will automatically update a PR if there is a conflict with main
. You can also force it to rebase a PR by ticking the box in the PR's description, or ticking the relevant box on the dependency dashboard.
You should generally avoid clicking the "Update branch" button in the Github UI as this will create a human commit - which cause renovate to treat the branch as "dirty" and it will no longer automatically. Only click it if you are planning on merging the PR manually ASAP.
Manual Dependency Updates
Occasionally it will be desirable to manually bump the dependencies in one commit rather than relying on renovate's many PRs. Doing so is just a matter of:
git checkout main && git pull
yarn install
yarn update-interactive
- this will start yarn's prompt to update the deps.- Ignore the lines with
*
deps as these are intentionally set as such. - Avoid changing the dep ranges like the complex range we have for TypeScript (eg
>=4.7.4 <5.5.0
). - Once you're ready, hit
enter
and yarn will make the changes and rerun the install.
- Ignore the lines with
- Run all of the relevant checks locally so you can action any failures before raising a PR:
yarn build
yarn typecheck
yarn lint
yarn test
yarn integration-test
- Create a new branch (a name like
update-deps-20231201
is good just to keep it unique), create, and land a PR.
Babel
Our published packages only depend on @babel/*
packages as devDependencies.
You can generally upgrade those dependencies with:
yarn add -D @babel/code-frame @babel/core @babel/eslint-parser @babel/parser @babel/types
npx nx run ast-spec:test -u
The fixtures under packages/ast-spec/
describe how the files are parsed under both Babel and our (TSESTree) parser.
ESLint
The typescript-eslint repository contains four kinds of version ranges for the eslint
package:
- Integration tests: Pinned to our lowest supported ESLint version
- Packages with a
*
peerDependency
version: These fall back to the explicitpeerDependency
versions - Packages with explicit
peerDependency
versions: The full range of supported ESLint major versions - Root
package.json
's'devDependency
: A relatively recent release, used only for repository development
Whenever you discover any new areas of work that are blocked by dropping an old ESLint version, such as new ESLint API deprecations, add a TODO comment that will be caught by the regular expressions under Removing Support for an Old ESLint Version.
Adding Support for a New ESLint Version
- Upgrade the root
package.json
devDependency
to the latest ESLint - Add the new major version to the explicit
peerDependency
versions - Check
eslint-visitor-keys
for a new version to be upgraded to as well. - Update Users > Dependency Versions > ESLint