cletusw / eslint-plugin-local-rules

A plugin for ESLint that allows you to use project-specific rules
MIT License
158 stars 9 forks source link

feat: allow specification of plugin config #11

Closed philipbulley closed 1 year ago

philipbulley commented 2 years ago

I found the need to specify processors for some rules I've been writing, but realised it wasn't (yet) possible to do this with this package.

This PR is backwards compatible, you can continue to specify rules directly as the export. If you want to specify any additional plugin config, you can do so by specifying rules under a rules property and then specify any other plugin config props as siblings:


module.exports = {
  rules: {
    // ...
  },
  processors: {
    // ...
  },
};
cletusw commented 2 years ago

I'm going to have to think about this one since it broadens the project scope. Did you try using https://github.com/taskworld/eslint-plugin-local which already allows the full plugin API (IIUC)?

philipbulley commented 2 years ago

Thanks, I wasn't aware of eslint-plugin-local. It works a charm for usage of processors. If you're not keen on enabling plugin config support, here's an alternate PR to help others like me (https://github.com/cletusw/eslint-plugin-local-rules/pull/12).

cletusw commented 1 year ago

README link to eslint-plugin-local added. Closing.