This is a work-in-progress to migrate Relay linting rules from [Artsy](https://github.com/artsy/reaction/blob/7e0b8bc25b18e7e2335d1f0165cce88336da5d1c/tslint/relayOperationGenericsRule.js) and from [eslint-plugin-relay](https://github.com/relayjs/eslint-p
npm install tslint-plugin-relayThis 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.
``diff`
{
"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.
#### relay-operation-generics
Helps enforce type safety and adherence to the following TypeScript/Relay conventions:
- QueryRenderer components must include type parameters (includes fix).QueryRenderer
- components must use graphql tagged template strings for their query prop.commitMutation
- calls to must use graphql tagged template strings for their mutation option.commitMutation
- calls to must include type parameters (includes fix).commitMutation
- calls to must use full object literal syntax for their mutation option.
`json`
"relay-operation-generics": [
true,
{ "artifactDirectory": "__generated__", "makeRelative": false }
]
`shcode .
git clone https://github.com/relay-tools/tslint-plugin-relay.git
cd tslint-plugin-relay
yarn installOpen VS Code with
`
(We're still figuring out a testing strategy. See #2.)
`sh``
yarn release