Created
January 13, 2022 17:29
-
-
Save DanielHoffmann/e9737f46cc7421ac5c227d583cd59f1f to your computer and use it in GitHub Desktop.
Revisions
-
DanielHoffmann created this gist
Jan 13, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ // used so eslint-plugin-import can properly resolve dependencies using yarn2 let pnp try { pnp = require(`./.pnp.cjs`) } catch (error) { // not a problem } const NOTFOUND = { found: false } module.exports = { interfaceVersion: 2, resolve: (source, file) => { if (!pnp) { throw new Error(`This resolver is meant to be used with pnp, but no pnp file was found`) } try { return { found: true, path: pnp.resolveRequest(source, file) } } catch (error) { return NOTFOUND } }, }