antfu / eslint-config

Anthony's ESLint config preset
https://eslint-config.antfu.me/
MIT License
3.94k stars 436 forks source link

Merge prettier plugins for formatters #613

Closed suppayami closed 3 weeks ago

suppayami commented 4 weeks ago

Clear and concise description of the problem

Currently for each supported formatters, the rules overrides plugins field from options.prettierOptions. This makes it hard to use any other prettier plugins, such as prettier-plugin-tailwindcss.

Suggested solution

Merge plugins from prettierOptions with final prettier rules, for example:

antfu({
  formatters: {
    astro: true,
    prettierOptions: {
      plugins: ['prettier-plugin-tailwindcss'],
    },
  },
})

Alternative

Alternative would be this PR, but supporting suggested solution would be easier for most users https://github.com/antfu/eslint-config/pull/592

Additional context

No response

Validations

antfu commented 4 weeks ago

Sounds good, PR welcome :)