Additional eslint rules about relay best practices
You'll first need to install ESLint:
npm i eslint --save-dev
Next, install @kejistan/eslint-plugin-relay
:
npm install @kejistan/eslint-plugin-relay --save-dev
Add @kejistan/relay
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": ["@kejistan/relay"]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"@kejistan/relay/check-generic-annotations": "error",
"@kejistan/relay/no-external-imports": "error"
}
}
- check-generic-annotations Check that functions which require generic annotations are specifying the right generated type
- no-external-imports Forbid imports of relay code generated by other files