You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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`.
21
21
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`).
23
23
At this point, you're ready to develop! 🚀
24
24
25
25
## Builds
26
26
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.
28
28
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`.
31
31
32
32
## Validating Changes
33
33
@@ -40,46 +40,46 @@ You can also perform them locally.
40
40
41
41
We use [Prettier](https://prettier.io) to auto-format code.
42
42
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.
44
44
45
45
### Linting
46
46
47
47
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.
49
49
50
50
### Proofreading
51
51
52
52
Changes must pass two linters for documentation and naming, the commands for which may be run from the root:
53
53
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
56
56
57
57
### Tests
58
58
59
59
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.
61
61
62
62
> [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.
63
63
64
64
### Type Checking
65
65
66
66
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`.
68
68
69
-
> Run `yarn typecheck -w` to start `tsc` in watch mode.
69
+
> Run `pnpm run typecheck -w` to start `tsc` in watch mode.
70
70
71
71
## Rule Development
72
72
73
73
Some portions of this repository are generated by manually running scripts that read from rule files.
74
74
If you modify rules, you may need to run either or both of:
75
75
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
78
78
79
79
## Website Development
80
80
81
81
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`.
83
83
84
84
> 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`.
Copy file name to clipboardExpand all lines: docs/contributing/local-development/Local_Linking.mdx
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ The command to put instead of that `#` comment, depends on the local downstream
36
36
Additionally, if you haven't yet built the typescript-eslint repository, do so now:
37
37
38
38
```shell
39
-
yarn build
39
+
pnpm run build
40
40
```
41
41
42
42
## Repository Linking
@@ -73,8 +73,8 @@ After that, you need to run your repository's `lint` script and your changes sho
73
73
74
74
:::note
75
75
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`.
78
78
:::
79
79
80
80
## Troubleshooting
@@ -92,17 +92,17 @@ Require stack:
92
92
In this case, you can manually install any missing packages in the local downstream repository as dev dependencies (`--save-dev`).
93
93
94
94
```shell
95
-
yarn add ts-api-utils -D
95
+
pnpm add ts-api-utils -D
96
96
```
97
97
98
98
### Rules Not Found (`Definition for rule ... was not found`)
99
99
100
100
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.
102
102
103
103
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.
104
104
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.
106
106
107
107
### Yarn Link Failures (`Cannot link ... conflicts with parent dependency`)
Copy file name to clipboardExpand all lines: docs/maintenance/pull-requests/Dependency_Version_Upgrades.mdx
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,26 +37,26 @@ You should generally avoid clicking the "Update branch" button in the Github UI
37
37
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:
38
38
39
39
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.
42
42
1. Ignore the lines with `*` deps as these are intentionally set as such.
43
43
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.
45
45
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`
51
51
1. Create a new branch (a name like `update-deps-20231201` is good just to keep it unique), create, and land a PR.
52
52
53
53
### Babel
54
54
55
55
Our published packages only depend on `@babel/*` packages as devDependencies.
56
56
You can generally upgrade those dependencies with:
The fixtures under `packages/ast-spec/` describe how the files are parsed under both Babel and our (TSESTree) parser.
62
62
@@ -137,7 +137,7 @@ We generally start the process of supporting a new TypeScript version just after
137
137
- 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))
138
138
- Change the `SUPPORTED_TYPESCRIPT_VERSIONS` constant's `<` version to the next version of TypeScript
139
139
- 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`
141
141
1. Once all PRs needed for the RC update PR are merged, merge the RC update PR
142
142
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:
143
143
- 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
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`.
384
384
385
385
This will include TypeScript server logs.
386
386
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`.
0 commit comments