eslint-plugin-vue icon indicating copy to clipboard operation
eslint-plugin-vue copied to clipboard

Add `defaultOptions` to all rules

Open FloEdelmann opened this issue 11 months ago • 0 comments

ESLint v9.17.0 introduced defaultOptions:

  • Documentation: https://eslint.org/docs/latest/extend/custom-rules#option-defaults
  • RFC: https://github.com/eslint/rfcs/tree/main/designs/2023-rule-options-defaults

Even though earlier ESLint versions don't have official support for this property (i.e. context.options returns the raw user-provided options rather than merged user options and default options), adding it shouldn't hurt.

In the future, we could write our own helper function to merge user options and default options and thus standardize how rules normalize the user-provided options. Also, we could automate (parts of) the rule docs' "Options" sections.

FloEdelmann avatar Jan 07 '25 16:01 FloEdelmann