-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add env option to required-fields rule config #75
Add env option to required-fields rule config #75
Conversation
a407f71
to
934fad4
Compare
I'm also interested by this change. I've tried @PepperTeasdale change, and it works as expected. |
wow, apologies for taking so long to get this. this looks good — i was wondering if you could expand a little on the case around supporting |
No problem @jnwng . My use case is that our clients are writing queries in |
934fad4
to
e99980d
Compare
Allows .graphql and .gql literal files to be linted with the required-fields rule.
e99980d
to
6160158
Compare
@jnwng 💇♂️ I went ahead and added a test case to verify that my change didn't cause a regression. It still doesn't add any tests that the literal |
…hub.com/PepperTeasdale/eslint-plugin-graphql into PepperTeasdale-add-required-fields-rule-to-literal-env
@PepperTeasdale i didn't have an answer to your question about how to deal with testing the processing of i'd like to give this one more day for me (or yourself, if you can get these tests running) before merging — if the code that i wrote can parse and validate rules properly, i'd like to have them both go in at the same time. if its not straightforward, i'll merge this and open an issue to make sure we provide some guidance on making sure we're not regressing in our does that sound reasonable? |
nevermind i got the tests running. PTAL @PepperTeasdale! |
test/makeProcessors.js
Outdated
describe('processors', () => { | ||
it('should define processors', () => { | ||
function execute(file) { | ||
const cli = new CLIEngine({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥 I was looking for something just like this, but didn't know this existed.
@jnwng That's awesome! If you think it's worth it, I can start another branch and take a crack at backfilling some other tests in the literal env (I believe people consider this the best practice for writing queries, so would be nice to add more coverage, IMO). LGTM! |
@PepperTeasdale that would be awesome! thanks so much for working with me on this, and apologies again for taking so long to turn everything around. will merge and release once CI passes |
Awesome! |
@jnwng 👀 please
Allows .graphql and .gql literal files to be linted with the required-fields rule. Resolves #74
Note: Neglected to update the README when I removed a few broken rules from the
literal
env and just threw the update in here, since I was already at it.TODO: