jscheid / prettier.el

Prettier code formatting for Emacs.
GNU General Public License v3.0
164 stars 11 forks source link

Don't override parser set explicitly #61

Closed jscheid closed 3 years ago

asbish commented 3 years ago

Thank you very much for doing this. I've tried this and checked that the overridden parser configured in .prettierrc.js was definitely used. However, the file's mode-line shows different parser so I have a recommendation; how about putting detecting the parser code in bestParser like this?

function bestParser(prettier, parsers, options, filepath) {
  if (options["parser"]) {
    return options["parser"];
  }
  // ...
}
jscheid commented 3 years ago

@asbish ah, good catch!

jscheid commented 3 years ago

@asbish thanks for the careful review!