Hi, I just upgraded prettier-atom, but unfortunately it now tries to use the linter package which is not compatible with nuclide. Is there any way to get it compatible with nuclide-diagnostics as well? Otherwise I can not use prettier-atom anymore.
And if I enable linter anyway, I get the following error:
TypeError: Cannot read property 'line' of undefined
at buildPointArrayFromPrettierErrorAndRange (/Users/hermanmeerlo/.atom/packages/prettier-atom/dist/executePrettier/handleError.js:16:37)
at setErrorMessageInLinter (/Users/hermanmeerlo/.atom/packages/prettier-atom/dist/executePrettier/handleError.js:32:29)
at /Users/hermanmeerlo/.atom/packages/prettier-atom/node_modules/lodash/lodash.min.js:49:114
at executePrettierOnBufferRange (/Users/hermanmeerlo/.atom/packages/prettier-atom/dist/executePrettier/executePrettierOnBufferRange.js:45:5)
at callAppropriatePrettierExecutor (/Users/hermanmeerlo/.atom/packages/prettier-atom/dist/formatOnSave/index.js:22:91)
at r (/Users/hermanmeerlo/.atom/packages/prettier-atom/node_modules/lodash/lodash.min.js:5:165)
at /Users/hermanmeerlo/.atom/packages/prettier-atom/node_modules/lodash/lodash.min.js:97:162
at r (/Users/hermanmeerlo/.atom/packages/prettier-atom/node_modules/lodash/lodash.min.js:5:165)
at /Users/hermanmeerlo/.atom/packages/prettier-atom/node_modules/lodash/lodash.min.js:63:325
at /Users/hermanmeerlo/.atom/packages/prettier-atom/node_modules/lodash/lodash.min.js:49:144
at /Users/hermanmeerlo/.atom/packages/prettier-atom/dist/formatOnSave/index.js:29:12
at attemptWithErrorNotification (/Users/hermanmeerlo/.atom/packages/prettier-atom/dist/atomInterface/index.js:122:10)
at safeFormatOnSaveIfAppropriate (/Users/hermanmeerlo/.atom/packages/prettier-atom/dist/formatOnSave/index.js:28:10)
at lazyFormatOnSave (/Users/hermanmeerlo/.atom/packages/prettier-atom/dist/main.js:39:15)
at /Users/hermanmeerlo/.atom/packages/prettier-atom/dist/main.js:120:14
at Function.module.exports.Emitter.simpleDispatch (<embedded>:63093:20)
at Emitter.module.exports.Emitter.emit (<embedded>:63209:34)
at TextBuffer.module.exports.TextBuffer.saveAs (<embedded>:28587:26)
at TextBuffer.module.exports.TextBuffer.save (<embedded>:28576:25)
at b._formatCodeOnSaveInTextEditor.timeout.catch.finally [as _unsubscribe] (/Users/hermanmeerlo/.atom/packages/nuclide/modules/atom-ide-ui/pkg/atom-ide-code-format/lib/CodeFormatManager.js:186:43)
at b.nb (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:20:375)
at b.unsubscribe (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:36:219)
at b.nb (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:20:375)
at a.b.unsubscribe (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:36:382)
at a.unsubscribe (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:40:333)
at a.nb (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:20:375)
at a.b.unsubscribe (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:36:382)
at a.unsubscribe (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:40:333)
at a._complete (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:61:482)
at a.complete (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:40:228)
at a._complete (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:40:529)
at a.complete (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:40:228)
at a._complete (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:40:529)
at a.complete (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:40:228)
at a._complete (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:40:529)
at a.complete (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:40:228)
at a._subscribe (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:58:221)
at a.b._trySubscribe (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:45:318)
at a.b.subscribe (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:45:144)
at b.call (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:251:285)
at b.subscribe (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:45:113)
at b.call (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:136:13)
at b.subscribe (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:45:113)
at b.call (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:171:13)
at b.subscribe (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:45:113)
at p (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:23:77)
at a._innerSub (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:239:187)
at a._next (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:239:51)
at a.next (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:40:64)
at a.notifyNext (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:60:68)
at a._next (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:61:263)
at a.next (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:40:64)
at a.next (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:48:322)
at a._group (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:180:204)
at a._next (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:179:215)
at a.next (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:40:64)
at a.notifyNext (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:60:68)
at a._next (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:61:263)
at a.next (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:40:64)
at a.notifyNext (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:139:422)
at a._next (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:61:263)
at a.next (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:40:64)
at a._next (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:40:393)
at a.next (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:40:64)
at a.notifyNext (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:60:68)
at a._next (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:61:263)
at a.next (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:40:64)
at a._next (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:106:294)
at a.next (/Users/hermanmeerlo/.atom/packages/nuclide/node_modules/rxjs/bundles/Rx.min.js:40:64)
at TextEditor.editor_.save (/Users/hermanmeerlo/.atom/packages/nuclide/modules/atom-ide-ui/pkg/atom-ide-code-format/lib/CodeFormatManager.js:143:18)
at Pane.module.exports.Pane.saveItem (<embedded>:26342:24)
at Pane.saveItem (<embedded>:25565:65)
at Pane.module.exports.Pane.saveActiveItem (<embedded>:26325:25)
at Workspace.saveActivePaneItem (<embedded>:24035:46)
at atom-workspace.core:save (<embedded>:15779:38)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (<embedded>:18901:35)
at <embedded>:18639:65
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (<embedded>:66514:22)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (<embedded>:66305:28)
at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (<embedded>:15166:42)
at HTMLDocument.<anonymous> (<embedded>:15069:65)
I am getting this too but do not have nuclide installed
My stack trace...
TypeError: Cannot read property 'line' of undefined
at buildPointArrayFromPrettierErrorAndRange (/Users/mattapperson/.atom/packages/prettier-atom/dist/executePrettier/handleError.js:16:37)
at setErrorMessageInLinter (/Users/mattapperson/.atom/packages/prettier-atom/dist/executePrettier/handleError.js:32:29)
at /Users/mattapperson/.atom/packages/prettier-atom/node_modules/lodash/lodash.min.js:49:114
at executePrettierOnBufferRange (/Users/mattapperson/.atom/packages/prettier-atom/dist/executePrettier/executePrettierOnBufferRange.js:45:5)
at callAppropriatePrettierExecutor (/Users/mattapperson/.atom/packages/prettier-atom/dist/formatOnSave/index.js:22:91)
at r (/Users/mattapperson/.atom/packages/prettier-atom/node_modules/lodash/lodash.min.js:5:165)
at /Users/mattapperson/.atom/packages/prettier-atom/node_modules/lodash/lodash.min.js:97:162
at r (/Users/mattapperson/.atom/packages/prettier-atom/node_modules/lodash/lodash.min.js:5:165)
at /Users/mattapperson/.atom/packages/prettier-atom/node_modules/lodash/lodash.min.js:63:325
at /Users/mattapperson/.atom/packages/prettier-atom/node_modules/lodash/lodash.min.js:49:144
at /Users/mattapperson/.atom/packages/prettier-atom/dist/formatOnSave/index.js:29:12
at attemptWithErrorNotification (/Users/mattapperson/.atom/packages/prettier-atom/dist/atomInterface/index.js:122:10)
at safeFormatOnSaveIfAppropriate (/Users/mattapperson/.atom/packages/prettier-atom/dist/formatOnSave/index.js:28:10)
at lazyFormatOnSave (/Users/mattapperson/.atom/packages/prettier-atom/dist/main.js:39:15)
at /Users/mattapperson/.atom/packages/prettier-atom/dist/main.js:120:14
at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:25:20)
at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:141:34)
at TextBuffer.module.exports.TextBuffer.saveAs (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:1119:26)
at TextBuffer.module.exports.TextBuffer.save (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:1108:25)
at TextEditor.module.exports.TextEditor.save (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:925:32)
at Pane.module.exports.Pane.saveItem (/Applications/Atom.app/Contents/Resources/app/src/pane.js:780:24)
at Pane.saveItem (/Applications/Atom.app/Contents/Resources/app/src/pane.js:3:65)
at Pane.module.exports.Pane.saveActiveItem (/Applications/Atom.app/Contents/Resources/app/src/pane.js:763:25)
at Workspace.saveActivePaneItem (/Applications/Atom.app/Contents/Resources/app/src/workspace.js:1548:46)
at atom-workspace.core:save (/Applications/Atom.app/Contents/Resources/app/src/register-default-commands.js:236:38)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:265:35)
at /Applications/Atom.app/Contents/Resources/app/src/command-registry.js:3:65
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:610:22)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:401:28)
at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:100:42)
at HTMLDocument.
hmmm it seems not all errors have the error.loc.start error signature, and this implementation does not take that into account. Some are just error.loc = {line: 5, column: 8}
it now tries to use the linter package which is not compatible with nuclide
I need to look more into this, I will try and make it work with nuclide diagnostics
hmmm it seems not all errors have the error.loc.start error signature, and this implementation does not take that into account. Some are just
error.loc = {line: 5, column: 8}
Woops, okay, willfix, thanks for investigating this! I made a separate issue for this here: https://github.com/prettier/prettier-atom/issues/229
@hmeerlo According to this post https://github.com/prettier/prettier-atom/issues/228#issuecomment-313715801 you should be able to just leave linter disabled and nuclide diagnostics will automatically stand-in for it. Do you think maybe that this is the case, and that #229 is actually the only problem here?
I just published 0.36.1, can you see if that resolves the issue?
@steelbrain Do you know if I have to do anything special to get nuclide to work with linter? Can users just leave linter disabled and somehow nuclide inserts itself and uses the linter API?
@robwise Yep! Nuclide tries to work with linter providers out of the box, so if you install Nuclide it'll try to use every Linter provider you have, you can disable this in Nuclide settings tho or you can just disable Linter. Either works
@robwise 0.36.1 works fine for me without installing Linter and therefore relying on nuclide-diagnostics. Thanks for the quick fix!
@hmeerlo Awesome, okay closing this issue for now!
Why the linter dependency all of the sudden? Is it just for displaying errors? Or are we actually linting in prettier now?
I saw the new linter dependency and almost cried. We came to prettier to avoid eslint!
Who said anything about eslint?
I am asking why this plugin now depends on the linter package? I don't see it documented anywhere.
Is it just for displaying errors?
Yeah it's just an atom package that displays errors, nothing to do with eslint
Hooray. Thanks!
I'm using nuclide and I get this error... Seem like still tries to use linter

@gperdomor It's not an error, just hit no and it should work fine. This detection behavior is from the package-deps repo so I can't rewrite it here: https://github.com/steelbrain/package-deps
Just adding this also happens for Atom's new IDE atom-ide-ui which comes with a conflicting package atom-ide-diagnostics. Atom handles it gracefully though by asking the user to disable one or the other.
@augbog does prettier-atom still work okay? Which one should people disable to get it to work?
Most helpful comment
Just adding this also happens for Atom's new IDE
atom-ide-uiwhich comes with a conflicting packageatom-ide-diagnostics. Atom handles it gracefully though by asking the user to disable one or the other.