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

Refactor codebase to follow standard structure

Open bradzacher opened this issue 7 years ago • 0 comments
trafficstars

The codebase is pretty unwieldy as is - all the code is defined across two files. It'd be good (and less intimidating for new contributors) if the code could be refactored to more of a "best practice" structure.

A good example is either https://github.com/benmosher/eslint-plugin-import, or https://github.com/nzakas/eslint-plugin-typescript.

Both of these roughly structure the code into:

/
|
+ - + src/
    |
    + - rules/ # each rule, defined in its own file
    |
    + - settings/ # config for the shared plugin settings
    |
    + - index.js # import all of the rule defs and export a "rules" object mapping the names to the configs.

At the same time, could address #157, so that the plugin config is "decoupled" from the rule config.

Considering there is also already babel running as part of the build, would it be worth instead converting the codebase to typescript? Considering apollo is a typescript shop, it seems like it would be a good fit.

Issue Labels

  • [ ] has-reproduction
  • [X] feature
  • [ ] docs
  • [ ] blocking
  • [ ] good first issue

/label refactor /label discussion

bradzacher avatar Jun 29 '18 02:06 bradzacher