relay-tools / tslint-plugin-relay Goto Github PK
View Code? Open in Web Editor NEWtslint plugin for relay-compiler-language-typescript tool
License: MIT License
tslint plugin for relay-compiler-language-typescript tool
License: MIT License
eslint-plugin-relay
does this here: https://github.com/relayjs/eslint-plugin-relay/blob/master/src/rule-graphql-syntax.js
The rule appears to do the following:
${...}
substitutions in graphql
-tagged strings.graphql.parse
works on the query.This build failed due to Danger not having access to the environment variable. See #9.
Now that TSLint is deprecated in favor of ESLint, is there any interest in porting this project to ESLint? I realize that may sound odd because eslint-plugin-relay exists, but that project appears to be intended for Flow-based projects. I'd be happy to see if that project is interested in adopting the TypeScript rules from here, but if they don't want to, is there any interest in retargeting this project for ESLint so those migrating from TSLint can retain Relay linting?
eslint-plugin-relay does this here: https://github.com/relayjs/eslint-plugin-relay/blob/master/src/rule-compat-uses-vars.js
It enforces conventions used by Relay Compatibility Mode. It does the following:
@relay(mask: false)
for locally-defined fragments (fragments that aren't defined in fragment containers).exlint-plugin-relay does this here: https://github.com/relayjs/eslint-plugin-relay/blob/master/src/rule-graphql-naming.js
The required message is:
Container fragment names must be `<ModuleName>_<propName>`. '
I think this might already be covered by the Relay compiler (or at least, with the Artsy Relay config). Still, a linter that gave in-editor underlining, errors, and auto-fixing would be worth it.
I'm going to look at eslint-plugin-relay's rules and see what makes sense to port over. I'll list them here and work away on them.
Edit: here's a list of their rules:
I'll check them off as I browse rules.
How do we test custom linting rules? This will be important as we add new rules and accept contribution from external contributors.
eslint-plugin-relay does this here: https://github.com/relayjs/eslint-plugin-relay/blob/master/src/rule-no-future-added-value.js
It appears to just prohibit the literal '%future added value'
in queries.
After we do #1.
eslint-plugin-relay does this here: https://github.com/relayjs/eslint-plugin-relay/blob/master/src/rule-generated-flow-types.js
Not a high priority for me personally because I don't use Flow, but we should have this available for users who do.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.