Skip to content

Commit

Permalink
Adds ts-nocheck to the PnP file (#6183)
Browse files Browse the repository at this point in the history
**What's the problem this PR addresses?**

The PnP file is fairly large; it seems that parsing it is difficult for
TypeScript on projects configured with `checkJs`, even if it doesn't
contain `// @ts-check`. Adding `// @ts-nocheck` to the file seemed to
improve the situation.

**How did you fix it?**

Adds `// @ts-nocheck` to the generated `.pnp.cjs` file.

**Checklist**
<!--- Don't worry if you miss something, chores are automatically
tested. -->
<!--- This checklist exists to help you remember doing the chores when
you submit a PR. -->
<!--- Put an `x` in all the boxes that apply. -->
- [x] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).

<!-- See
https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released
for more details. -->
<!-- Check with `yarn version check` and fix with `yarn version check
-i` -->
- [x] I have set the packages that need to be released for my changes to
be effective.

<!-- The "Testing chores" workflow validates that your PR follows our
guidelines. -->
<!-- If it doesn't pass, click on it to see details as to what your PR
might be missing. -->
- [x] I will check that all automated PR checks pass before the PR gets
reviewed.
  • Loading branch information
arcanis committed Mar 27, 2024
1 parent daa5747 commit c9d5a4c
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 1 deletion.
1 change: 1 addition & 0 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .pnp.loader.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions .yarn/versions/e6b664fe.yml
@@ -0,0 +1,27 @@
releases:
"@yarnpkg/cli": patch
"@yarnpkg/plugin-pnp": patch
"@yarnpkg/pnp": patch

declined:
- "@yarnpkg/plugin-compat"
- "@yarnpkg/plugin-constraints"
- "@yarnpkg/plugin-dlx"
- "@yarnpkg/plugin-essentials"
- "@yarnpkg/plugin-init"
- "@yarnpkg/plugin-interactive-tools"
- "@yarnpkg/plugin-nm"
- "@yarnpkg/plugin-npm-cli"
- "@yarnpkg/plugin-pack"
- "@yarnpkg/plugin-patch"
- "@yarnpkg/plugin-pnpm"
- "@yarnpkg/plugin-stage"
- "@yarnpkg/plugin-typescript"
- "@yarnpkg/plugin-version"
- "@yarnpkg/plugin-workspace-tools"
- "@yarnpkg/builder"
- "@yarnpkg/core"
- "@yarnpkg/doctor"
- "@yarnpkg/nm"
- "@yarnpkg/pnpify"
- "@yarnpkg/sdks"
1 change: 1 addition & 0 deletions packages/yarnpkg-pnp/rollup.config.js
Expand Up @@ -99,6 +99,7 @@ export default defineConfig([
file: `./sources/esm-loader/built-loader.js`,
format: `esm`,
generatedCode: `es2015`,
banner: `/* eslint-disable */\n// @ts-nocheck\n`,
},
plugins: [
resolve({
Expand Down
2 changes: 1 addition & 1 deletion packages/yarnpkg-pnp/sources/esm-loader/built-loader.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/yarnpkg-pnp/sources/generatePnpScript.ts
Expand Up @@ -10,6 +10,7 @@ export function generateLoader(shebang: string | null | undefined, loader: strin
return [
shebang ? `${shebang}\n` : ``,
`/* eslint-disable */\n`,
`// @ts-nocheck\n`,
`"use strict";\n`,
`\n`,
loader,
Expand Down

0 comments on commit c9d5a4c

Please sign in to comment.