Skip to content

Commit caae48b

Browse files
authored
Merge pull request #4 from xaos7991/chore/migrate-scripts-to-pnpm
Migrate scripts to pnpm and replaced yarn reference
2 parents e4500eb + 47bca3f commit caae48b

File tree

22 files changed

+89
-91
lines changed

22 files changed

+89
-91
lines changed

.github/renovate.json5

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@
4343
enabled: false,
4444
},
4545

46-
postUpdateOptions: [
47-
'pnpmDedupe',
48-
],
46+
postUpdateOptions: ['pnpmDedupe'],
4947

5048
// By default renovate will auto-rebase whenever the dep pranch falls behind main.
5149
// This is annoying as it spams notifications and creates unnecessary action runs.

docs/contributing/Local_Development.mdx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,25 @@ Thank you for your interest in developing on typescript-eslint! ❤️‍🔥
99
1010
## Setup
1111

12-
After [forking the repo from GitHub](https://help.github.com/articles/fork-a-repo) and [installing Yarn](https://yarnpkg.com):
12+
After [forking the repo from GitHub](https://help.github.com/articles/fork-a-repo) and [installing pnpm](https://pnpm.io/):
1313

1414
```shell
1515
git clone https://github.com/<your-name-here>/typescript-eslint
1616
cd typescript-eslint
17-
yarn
17+
pnpm install
1818
```
1919

20-
You can see which version of `yarn` we use by checking the `packageManager` field in the root `package.json`.
20+
You can see which version of `pnpm` we use by checking the `packageManager` field in the root `package.json`.
2121

22-
Postinstall scripts will then fully build your repository locally with (`yarn build`).
22+
Postinstall scripts will then fully build your repository locally with (`pnpm run build`).
2323
At this point, you're ready to develop! 🚀
2424

2525
## Builds
2626

27-
You can run `yarn build` in the root to build all packages, or in any package to build just that package.
27+
You can run `pnpm run build` in the root to build all packages, or in any package to build just that package.
2828

29-
Keep in mind that packages generally depend on each other's built outputs, and you'll need to `yarn build` dependents for their consumers to receive any new local changes.
30-
For example, if you make a change within `scope-manager` and want to use it in `eslint-plugin`, you'll need to `yarn build` either from the root or within `packages/scope-manager`.
29+
Keep in mind that packages generally depend on each other's built outputs, and you'll need to `pnpm run build` dependents for their consumers to receive any new local changes.
30+
For example, if you make a change within `scope-manager` and want to use it in `eslint-plugin`, you'll need to `pnpm run build` either from the root or within `packages/scope-manager`.
3131

3232
## Validating Changes
3333

@@ -40,46 +40,46 @@ You can also perform them locally.
4040

4141
We use [Prettier](https://prettier.io) to auto-format code.
4242
A Git pre-commit hook should apply it to all committed changes.
43-
Alternately, you can run `yarn format` in any package or in the root.
43+
Alternately, you can run `pnpm run format` in any package or in the root.
4444

4545
### Linting
4646

4747
All code changes must pass ESLint.
48-
You can run `yarn lint` in any package or in the root.
48+
You can run `pnpm run lint` in any package or in the root.
4949

5050
### Proofreading
5151

5252
Changes must pass two linters for documentation and naming, the commands for which may be run from the root:
5353

54-
- `yarn check-spelling`: [CSpell](https://cspell.org), for all code
55-
- `yarn lint-markdown`: [Markdownlint](https://github.com/DavidAnson/markdownlint), for Markdown documentation
54+
- `pnpm run check-spelling`: [CSpell](https://cspell.org), for all code
55+
- `pnpm run lint-markdown`: [Markdownlint](https://github.com/DavidAnson/markdownlint), for Markdown documentation
5656

5757
### Tests
5858

5959
All code changes should ideally be unit tested if possible.
60-
You can run `yarn test` in any package to run its tests.
60+
You can run `pnpm run test` in any package to run its tests.
6161

6262
> [VS Code launch tasks](https://code.visualstudio.com/docs/editor/tasks) tasks are provided that allow [visual debugging](https://code.visualstudio.com/docs/editor/debugging) tests.
6363
6464
### Type Checking
6565

6666
All code should pass TypeScript type checking.
67-
You can run `yarn typecheck` in any package or in the root to run `tsc`.
67+
You can run `pnpm run typecheck` in any package or in the root to run `tsc`.
6868

69-
> Run `yarn typecheck -w` to start `tsc` in watch mode.
69+
> Run `pnpm run typecheck -w` to start `tsc` in watch mode.
7070
7171
## Rule Development
7272

7373
Some portions of this repository are generated by manually running scripts that read from rule files.
7474
If you modify rules, you may need to run either or both of:
7575

76-
- `yarn generate-configs` from root: to regenerate [shared configs](../users/Shared_Configurations.mdx)
77-
- `yarn test docs -u` from `packages/eslint-plugin`: to regenerate snapshots based on rule docs and options
76+
- `pnpm run generate-configs` from root: to regenerate [shared configs](../users/Shared_Configurations.mdx)
77+
- `pnpm run test docs -u` from `packages/eslint-plugin`: to regenerate snapshots based on rule docs and options
7878

7979
## Website Development
8080

8181
Our interactive documentation website is built with [Docusaurus](https://docusaurus.io).
82-
Running `yarn start` from either the root or `packages/website` will start a local dev server on `localhost:3000`.
82+
Running `pnpm run start` from either the root or `packages/website` will start a local dev server on `localhost:3000`.
8383

8484
> The `website` package relies on other packages being built.
85-
> We recommend running `yarn build` from the root before `yarn start`.
85+
> We recommend running `pnpm run build` from the root before `pnpm run start`.

docs/contributing/Pull_Requests.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Please don't:
3030
### Code Coverage
3131

3232
We aim for 100% code coverage in all PRs when possible, except in the `website/` package.
33-
Coverage reports are generated locally whenever `yarn test` is run.
33+
Coverage reports are generated locally whenever `pnpm run test` is run.
3434

3535
The `codecov` bot also comments on each PR with its percentage, as well as links to the line-by-line coverage of each file touched by the PR.
3636

@@ -54,8 +54,8 @@ AST tests belong in the `ast-spec` package, within `fixtures/` subfolders alongs
5454

5555
```bash
5656
cd packages/eslint-plugin
57-
yarn test docs -u
58-
yarn test schemas -u
57+
pnpm run test docs -u
58+
pnpm run test schemas -u
5959
```
6060

6161
## Raising the PR

docs/contributing/local-development/Local_Linking.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The command to put instead of that `#` comment, depends on the local downstream
3636
Additionally, if you haven't yet built the typescript-eslint repository, do so now:
3737

3838
```shell
39-
yarn build
39+
pnpm run build
4040
```
4141

4242
## Repository Linking
@@ -73,8 +73,8 @@ After that, you need to run your repository's `lint` script and your changes sho
7373

7474
:::note
7575
Changes to `@typescript-eslint/` packages will not be reflected inside your linked repository until they're built locally.
76-
To re-build all packages, run `yarn build` from the root.
77-
To start a watch mode builder on just the ESLint plugin, run `yarn build --watch` from `./packages/eslint-plugin`.
76+
To re-build all packages, run `pnpm run build` from the root.
77+
To start a watch mode builder on just the ESLint plugin, run `pnpm run build --watch` from `./packages/eslint-plugin`.
7878
:::
7979

8080
## Troubleshooting
@@ -92,17 +92,17 @@ Require stack:
9292
In this case, you can manually install any missing packages in the local downstream repository as dev dependencies (`--save-dev`).
9393

9494
```shell
95-
yarn add ts-api-utils -D
95+
pnpm add ts-api-utils -D
9696
```
9797

9898
### Rules Not Found (`Definition for rule ... was not found`)
9999

100100
Packages need to be built.
101-
First try re-running `yarn build` from the typescript-eslint repository root.
101+
First try re-running `pnpm run build` from the typescript-eslint repository root.
102102

103103
If you're adding new rules, you'll need to also modify [`packages/eslint-plugin/src/rules/index.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/rules/index.ts) to export the rule object, then re-build.
104104

105-
If you're modifying preset configurations, you'll also need to run `yarn generate-configs`, then re-build.
105+
If you're modifying preset configurations, you'll also need to run `pnpm run generate-configs`, then re-build.
106106

107107
### Yarn Link Failures (`Cannot link ... conflicts with parent dependency`)
108108

docs/maintenance/pull-requests/Dependency_Version_Upgrades.mdx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,26 @@ You should generally avoid clicking the "Update branch" button in the Github UI
3737
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:
3838

3939
1. `git checkout main && git pull`
40-
1. `yarn install`
41-
1. `yarn update-interactive` - this will start yarn's prompt to update the deps.
40+
1. `pnpm install`
41+
1. `pnpm update --interactive` - this will start pnpm's prompt to update the deps.
4242
1. Ignore the lines with `*` deps as these are intentionally set as such.
4343
1. Avoid changing the dep ranges like the complex range we have for TypeScript (eg `>=4.7.4 <5.5.0`).
44-
1. Once you're ready, hit `enter` and yarn will make the changes and rerun the install.
44+
1. Once you're ready, hit `enter` and pnpm will make the changes and rerun the install.
4545
1. Run all of the relevant checks locally so you can action any failures before raising a PR:
46-
1. `yarn build`
47-
1. `yarn typecheck`
48-
1. `yarn lint`
49-
1. `yarn test`
50-
1. `yarn integration-test`
46+
1. `pnpm run build`
47+
1. `pnpm run typecheck`
48+
1. `pnpm run lint`
49+
1. `pnpm run test`
50+
1. `pnpm run test-integration`
5151
1. Create a new branch (a name like `update-deps-20231201` is good just to keep it unique), create, and land a PR.
5252

5353
### Babel
5454

5555
Our published packages only depend on `@babel/*` packages as devDependencies.
5656
You can generally upgrade those dependencies with:
5757

58-
1. `yarn add -D @babel/code-frame @babel/core @babel/eslint-parser @babel/parser @babel/types`
59-
2. `npx nx run ast-spec:test -u`
58+
1. `pnpm add -D @babel/code-frame @babel/core @babel/eslint-parser @babel/parser @babel/types`
59+
2. `pnpx nx run ast-spec:test -u`
6060

6161
The fixtures under `packages/ast-spec/` describe how the files are parsed under both Babel and our (TSESTree) parser.
6262

@@ -137,7 +137,7 @@ We generally start the process of supporting a new TypeScript version just after
137137
- In the parser's `getLib`, update the `switch (target)` and its preceding comment as needed (see [#6782](https://github.com/typescript-eslint/typescript-eslint/pull/6782))
138138
- Change the `SUPPORTED_TYPESCRIPT_VERSIONS` constant's `<` version to the next version of TypeScript
139139
- Change the `SUPPORTED_PRERELEASE_RANGES` constant to equal `['X.Y.1-rc']`
140-
- Run `yarn generate-lib` to update `scope-manager`
140+
- Run `pnpm run generate-lib` to update `scope-manager`
141141
1. Once all PRs needed for the RC update PR are merged, merge the RC update PR
142142
1. Once TypeScript releases the stable X.Y version, create and merge a PR with a title like `chore: bump TypeScript from X.YRC to X.Y` and the following changes:
143143
- In the root `package.json`, remove `|| X.Y.1-rc2` from the `dependency` on `typescript`, and bump its `<` version to the next version of TypeScript

docs/packages/TypeScript_ESTree.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,8 @@ const { ast, services } = parseAndGenerateServices(code, {
380380
## Debugging
381381

382382
If you encounter a bug with the parser that you want to investigate, you can turn on the debug logging via setting the environment variable: `DEBUG=typescript-eslint:*`.
383-
I.e. in this repo you can run: `DEBUG=typescript-eslint:* yarn lint`.
383+
I.e. in this repo you can run: `DEBUG=typescript-eslint:* pnpm run lint`.
384384

385385
This will include TypeScript server logs.
386386
To turn off these logs, include `-typescript-eslint:typescript-estree:tsserver:*` when setting the environment variable.
387-
I.e. for this repo change to: `DEBUG='typescript-eslint:*,-typescript-eslint:typescript-estree:tsserver:*' yarn lint`.
387+
I.e. for this repo change to: `DEBUG='typescript-eslint:*,-typescript-eslint:typescript-estree:tsserver:*' pnpm run lint`.

packages/ast-spec/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434
"build": "tsc -b tsconfig.build.json && api-extractor run --local --config=./api-extractor.json",
3535
"clean": "rimraf dist/ coverage/",
3636
"clean-fixtures": "rimraf -g \"./src/**/fixtures/**/snapshots\"",
37-
"format": "yarn run -T format",
38-
"lint": "yarn run -BT nx lint",
37+
"format": "pnpm --workspace-root run format",
38+
"lint": "pnpm --workspace-root exec nx lint",
3939
"test": "vitest --run --config=./vitest.config.mts",
40-
"check-types": "yarn run -BT nx typecheck"
40+
"check-types": "pnpm --workspace-root exec nx typecheck"
4141
},
4242
"funding": {
4343
"type": "opencollective",

packages/eslint-plugin-internal/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
"scripts": {
1717
"build": "tsc -b tsconfig.build.json",
1818
"clean": "rimraf dist/ coverage/",
19-
"format": "yarn run -T format",
20-
"lint": "yarn run -BT nx lint",
19+
"format": "pnpm --workspace-root run format",
20+
"lint": "pnpm --workspace-root exec nx lint",
2121
"test": "vitest --run --config=./vitest.config.mts",
22-
"check-types": "yarn run -BT nx typecheck"
22+
"check-types": "pnpm --workspace-root exec nx typecheck"
2323
},
2424
"dependencies": {
2525
"@prettier/sync": "^0.5.1",

packages/eslint-plugin/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@
5151
"scripts": {
5252
"build": "tsc -b tsconfig.build.json",
5353
"clean": "rimraf dist/ coverage/",
54-
"format": "yarn run -T format",
54+
"format": "pnpm --workspace-root run format",
5555
"generate-breaking-changes": "tsx tools/generate-breaking-changes.mts",
5656
"generate-configs": "yarn run -T generate-configs",
57-
"lint": "yarn run -BT nx lint",
57+
"lint": "pnpm --workspace-root exec nx lint",
5858
"test": "vitest --run --config=./vitest.config.mts",
5959
"test-single": "vitest --run --config=./vitest.config.mts --no-coverage",
60-
"check-types": "yarn run -BT nx typecheck"
60+
"check-types": "pnpm --workspace-root exec nx typecheck"
6161
},
6262
"dependencies": {
6363
"@eslint-community/regexpp": "^4.10.0",

packages/integration-tests/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
"homepage": "https://typescript-eslint.io",
1313
"license": "MIT",
1414
"scripts": {
15-
"format": "yarn run -T format",
16-
"lint": "yarn run -BT nx lint",
15+
"format": "pnpm --workspace-root run format",
16+
"lint": "pnpm --workspace-root exec nx lint",
1717
"test": "vitest --run --config=./vitest.config.mts",
18-
"check-types": "yarn run -BT nx typecheck"
18+
"check-types": "pnpm --workspace-root exec nx typecheck"
1919
},
2020
"devDependencies": {
2121
"@vitest/coverage-v8": "^3.1.3",

packages/parser/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@
4141
"scripts": {
4242
"build": "tsc -b tsconfig.build.json",
4343
"clean": "rimraf dist/ coverage/",
44-
"format": "yarn run -T format",
45-
"lint": "yarn run -BT nx lint",
44+
"format": "pnpm --workspace-root run format",
45+
"lint": "pnpm --workspace-root exec nx lint",
4646
"test": "vitest --run --config=./vitest.config.mts",
47-
"check-types": "yarn run -BT nx typecheck"
47+
"check-types": "pnpm --workspace-root exec nx typecheck"
4848
},
4949
"peerDependencies": {
5050
"eslint": "^8.57.0 || ^9.0.0",

packages/rule-schema-to-typescript-types/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
"scripts": {
2727
"build": "tsc -b tsconfig.build.json",
2828
"clean": "rimraf dist/ coverage/",
29-
"format": "yarn run -T format",
30-
"lint": "yarn run -BT nx lint",
29+
"format": "pnpm --workspace-root run format",
30+
"lint": "pnpm --workspace-root exec nx lint",
3131
"test": "vitest --run --config=./vitest.config.mts",
32-
"check-types": "yarn run -BT nx typecheck"
32+
"check-types": "pnpm --workspace-root exec nx typecheck"
3333
},
3434
"dependencies": {
3535
"@typescript-eslint/type-utils": "8.32.1",

packages/rule-tester/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@
3737
"scripts": {
3838
"build": "tsc -b tsconfig.build.json",
3939
"clean": "rimraf dist/ coverage/",
40-
"format": "yarn run -T format",
41-
"lint": "yarn run -BT nx lint",
40+
"format": "pnpm --workspace-root run format",
41+
"lint": "pnpm --workspace-root exec nx lint",
4242
"pretest-eslint-base": "tsc -b tsconfig.build.json",
4343
"test-eslint-base": "mocha --require source-map-support/register ./tests/eslint-base/eslint-base.test.js",
4444
"test": "vitest --run --config=./vitest.config.mts",
45-
"check-types": "yarn run -BT nx typecheck"
45+
"check-types": "pnpm --workspace-root exec nx typecheck"
4646
},
4747
"//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70",
4848
"dependencies": {

packages/scope-manager/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@
4040
"build": "tsc -b tsconfig.build.json",
4141
"clean": "rimraf dist/ coverage/",
4242
"clean-fixtures": "rimraf -g \"./src/**/fixtures/**/snapshots\"",
43-
"format": "yarn run -T format",
43+
"format": "pnpm --workspace-root run format",
4444
"generate-lib": "yarn run -BT nx generate-lib repo",
45-
"lint": "yarn run -BT nx lint",
45+
"lint": "pnpm --workspace-root exec nx lint",
4646
"test": "vitest --run --config=./vitest.config.mts",
47-
"check-types": "yarn run -BT nx typecheck"
47+
"check-types": "pnpm --workspace-root exec nx typecheck"
4848
},
4949
"dependencies": {
5050
"@typescript-eslint/types": "8.32.1",

packages/type-utils/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@
3838
"scripts": {
3939
"build": "tsc -b tsconfig.build.json",
4040
"clean": "rimraf dist/ coverage/",
41-
"format": "yarn run -T format",
42-
"lint": "yarn run -BT nx lint",
41+
"format": "pnpm --workspace-root run format",
42+
"lint": "pnpm --workspace-root exec nx lint",
4343
"test": "vitest --run --config=./vitest.config.mts",
44-
"check-types": "yarn run -BT nx typecheck"
44+
"check-types": "pnpm --workspace-root exec nx typecheck"
4545
},
4646
"dependencies": {
4747
"@typescript-eslint/typescript-estree": "8.32.1",

packages/types/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@
4040
"copy-ast-spec": "tsx ./tools/copy-ast-spec.mts",
4141
"build": "tsc -b tsconfig.build.json",
4242
"clean": "rimraf dist/ src/generated/ coverage/",
43-
"format": "yarn run -T format",
43+
"format": "pnpm --workspace-root run format",
4444
"generate-lib": "yarn run -BT nx run scope-manager:generate-lib",
45-
"lint": "yarn run -BT nx lint",
45+
"lint": "pnpm --workspace-root exec nx lint",
4646
"test": "vitest --run --config=./vitest.config.mts",
47-
"check-types": "yarn run -BT nx typecheck"
47+
"check-types": "pnpm --workspace-root exec nx typecheck"
4848
},
4949
"devDependencies": {
5050
"@vitest/coverage-v8": "^3.1.3",

packages/typescript-eslint/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
"scripts": {
4545
"build": "tsc -b tsconfig.build.json",
4646
"clean": "rimraf dist/ coverage/",
47-
"format": "yarn run -T format",
48-
"lint": "yarn run -BT nx lint",
47+
"format": "pnpm --workspace-root run format",
48+
"lint": "pnpm --workspace-root exec nx lint",
4949
"test": "vitest --run --config=./vitest.config.mts",
50-
"check-types": "yarn run -BT nx typecheck"
50+
"check-types": "pnpm --workspace-root exec nx typecheck"
5151
},
5252
"dependencies": {
5353
"@typescript-eslint/eslint-plugin": "8.32.1",

packages/typescript-estree/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@
4646
"scripts": {
4747
"build": "tsc -b tsconfig.build.json",
4848
"clean": "rimraf dist/ coverage/",
49-
"format": "yarn run -T format",
50-
"lint": "yarn run -BT nx lint",
49+
"format": "pnpm --workspace-root run format",
50+
"lint": "pnpm --workspace-root exec nx lint",
5151
"test": "vitest --run --config=./vitest.config.mts",
52-
"check-types": "yarn run -BT nx typecheck"
52+
"check-types": "pnpm --workspace-root exec nx typecheck"
5353
},
5454
"dependencies": {
5555
"@typescript-eslint/types": "8.32.1",

0 commit comments

Comments
 (0)