hawkins / prettier-webpack-plugin

Process your Webpack dependencies with Prettier
https://travis-ci.org/hawkins/prettier-webpack-plugin
50 stars 14 forks source link

add `filepath` option #35

Closed pastelInc closed 6 years ago

pastelInc commented 6 years ago

I tried using prettier-plugin-elm with pluginSearchDirs and plugins options.

  plugins: [
    new PrettierPlugin({
      extensions: [ ".ts", ".tsx", ".elm" ],
      pluginSearchDirs: [ path.resolve(__dirname, "node_modules") ],
      plugins: [ "prettier-plugin-elm" ]
    })
  ],

https://prettier.io/docs/en/plugins.html

However, since there is no filepath option, the prettier could not determine parser from filepath. (The default parser babylon was selected)

https://github.com/prettier/prettier/blob/1.14.2/src/main/options.js#L38-L40

Please consider merge so that parser of elm can be specified from filepath.

hawkins commented 6 years ago

Interesting, thanks a ton for opening this!! 🙌

hawkins commented 6 years ago

Just shipped in 1.1.0