Zendro-dev / graphql-server-model-codegen

Command line utility to auto-generate the structure files for a graphql server
MIT License
1 stars 2 forks source link

Add ESLint support #150

Open davelsan opened 4 years ago

davelsan commented 4 years ago

Description

I think it could be beneficial for the team to add ESLint to both graphql-server and graphql-server-model-codegen projects. ESLint has integrations with popular IDEs and can make development more pleasant.

I would start with a set of minimal ESLint rules and see how it works for us. If there are any intrusive rules, we can disable or override them.

Implementation

Integrations

Microsoft's vscode has an ESLint extension available that provides visual feedback in the editor and can be configured to fix all errors on save.

"editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
}

The command eslint.executeAutofix can also be mapped as a keyboard shortcut, either using the interface via config:

{
  "key": "<add-key-combo-here>",
  "command": "eslint.executeAutofix"
}