eslint-types / eslint-define-config

Provide a defineConfig function for .eslintrc.js files
MIT License
361 stars 26 forks source link

Fix incorrect definitions for react/require-default-props #213

Closed controversial closed 1 year ago

controversial commented 1 year ago

See the documentation for this rule’s options.

Neither the classes option nor the functions option accepts an object value, so the previous type definition here is incorrect and broken.

Example of correctly written eslint config being assigned an erroneous type error:

config-error

 

I also added a @deprecated label for the option that is listed as such in the documentation.

Shinigami92 commented 1 year ago

The rules/*.d.ts files are auto-generated

Please forward this issue to https://github.com/jsx-eslint/eslint-plugin-react/blob/31282dd27c8488efdb53967271d31c79d3072f74/lib/rules/require-default-props.js#L43-L52

There you can see that the enum is wrapped in an allow and I think this needs to be removed

a working example can be found here: https://github.com/jsx-eslint/eslint-plugin-react/blob/31282dd27c8488efdb53967271d31c79d3072f74/lib/rules/jsx-sort-props.js#L370-L373

For the deprecation, please check if this can be achieved via json-schema as well

controversial commented 1 year ago

Thanks for the note; I filed https://github.com/jsx-eslint/eslint-plugin-react/issues/3604.

Shinigami92 commented 1 year ago

Checked, but the newest commit it still not released, so I wait for 7.34