ggascoigne / prettier-plugin-import-sort

Prettier plugin to pass javascript and typescript through import-sort
MIT License
110 stars 11 forks source link

Support Prettier 2 #10

Closed heyitsarpit closed 4 years ago

heyitsarpit commented 4 years ago

Running this plugin with prettier 2 throws this error

✖ prettier --write:
internal/modules/cjs/loader.js:775
    throw err;
    ^

Error: Cannot find module 'prettier/parser-babylon'
Require stack:
- /home/arpit/Development/amoli-sessions/node_modules/prettier-plugin-import-sort/src/index.js
- /home/arpit/Development/amoli-sessions/node_modules/prettier/bin-prettier.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:772:15)
    at Function.Module._load (internal/modules/cjs/loader.js:677:27)
    at Module.require (internal/modules/cjs/loader.js:830:19)
    at require (internal/modules/cjs/helpers.js:68:18)
    at Object.<anonymous> (/home/arpit/Development/amoli-sessions/node_modules/prettier-plugin-import-sort/src/index.js:11:3)
    at Module._compile (internal/modules/cjs/loader.js:936:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
    at Module.load (internal/modules/cjs/loader.js:790:32)
    at Function.Module._load (internal/modules/cjs/loader.js:703:12)
    at Module.require (internal/modules/cjs/loader.js:830:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/arpit/Development/amoli-sessions/node_modules/prettier-plugin-import-sort/src/index.js',
    '/home/arpit/Development/amoli-sessions/node_modules/prettier/bin-prettier.js'
  ]
}
ggascoigne commented 4 years ago

what version of prettier-plugin-import-sort are you using, since this bug was fixed in 0.0.4?

heyitsarpit commented 4 years ago

Yeah just checked it was 0.0.3, I didn't do npm i prettier-plugin-import-sort@latest so it just reinstalled 0.0.3 for me.