tslint plugin for relay-compiler-language-typescript tool
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
rules
.gitignore
.npmignore
.travis.yml
CHANGELOG.md
LICENSE
README.md
dangerfile.ts
package.json
tsconfig.json
tslint-base.json
tslint-config.json
tslint.json
wallaby.js
yarn.lock

README.md

tslint-plugin-relay Build Status

This is a work-in-progress to migrate Relay linting rules from Artsy and from eslint-plugin-relay to TSLint.

How do I use this?

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.

Rules

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.
  • calls to commitMutation must use graphql tagged template strings for their mutation option.
  • calls to commitMutation must include type parameters (includes fix).
  • calls to commitMutation must use full object literal syntax for their mutation option.
"relay-operation-generics": [
  true,
  { "artifactDirectory": "__generated__", "makeRelative": false }
]

How do I work on this?

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.)

How do I deploy this?

yarn release