This is a work-in-progress to migrate Relay linting rules from Artsy and from eslint-plugin-relay to TSLint.
Add tslint-plugin-relay as a devDependency using yarn add -D tslint-plugin-relay. Then open your TSLint config file and "tslint-plugin-relay" to your extends list.
{
"extends": [
- "tslint:recommended"
+ "tslint:recommended",
+ "tslint-plugin-relay"
],Now you can add rules from this repo to the rules dictionary. See this blog post for more information on sharing rules and configurations across projects.
Helps enforce type safety and adherence to the following TypeScript/Relay conventions:
QueryRenderercomponents must include type parameters (includes fix).QueryRenderercomponents must usegraphqltagged template strings for theirqueryprop.- calls to
commitMutationmust usegraphqltagged template strings for theirmutationoption. - calls to
commitMutationmust include type parameters (includes fix). - calls to
commitMutationmust use full object literal syntax for theirmutationoption.
"relay-operation-generics": [
true,
{ "artifactDirectory": "__generated__", "makeRelative": false }
]git clone https://github.com/relay-tools/tslint-plugin-relay.git
cd tslint-plugin-relay
yarn install
# Open VS Code with `code .`(We're still figuring out a testing strategy. See #2.)
yarn release