Skip to content

Commit

Permalink
fix: Fix TypeScript on VSCode (#202)
Browse files Browse the repository at this point in the history
Just ran `yarn dlx @yarnpkg/pnpify --sdk vscode` as suggested on the interwebs and commiting the result as it seems to be working.
  • Loading branch information
BYK authored Jun 7, 2021
1 parent 3427a59 commit 1e0560e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .vim/coc-settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"eslint.packageManager": "yarn",
"eslint.nodePath": ".yarn/sdks",
"tsserver.tsdk": ".yarn/sdks/typescript/lib"
"tsserver.tsdk": ".yarn/sdks/typescript/lib",
"workspace.workspaceFolderCheckCwd": false
}
12 changes: 1 addition & 11 deletions .yarn/sdks/prettier/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {resolve, dirname} = require(`path`);
const {resolve} = require(`path`);

const relPnpApiPath = "../../../.pnp.js";

Expand All @@ -14,16 +14,6 @@ if (existsSync(absPnpApiPath)) {
// Setup the environment to be able to require prettier/index.js
require(absPnpApiPath).setup();
}

const pnpifyResolution = require.resolve(`@yarnpkg/pnpify`, {paths: [dirname(absPnpApiPath)]});
if (typeof global[`__yarnpkg_sdk_is_using_pnpify__`] === `undefined`) {
Object.defineProperty(global, `__yarnpkg_sdk_is_using_pnpify__`, {configurable: true, value: true});

process.env.NODE_OPTIONS += ` -r ${pnpifyResolution}`;

// Apply PnPify to the current process
absRequire(pnpifyResolution).patchFs();
}
}

// Defer to the real prettier/index.js your application uses
Expand Down

0 comments on commit 1e0560e

Please sign in to comment.