Open Stephen2 opened 1 week ago
Progress of the issue based on the Contributor Workflow
[ ] 1. The issue provides a reproduction available on GitHub, Stackblitz or CodeSandbox
For example, you can start off by editng the 'basic' example on Stackblitz. Please make sure the graphql-eslint version under package.json matches yours.
For example, you can start off by editng the 'basic' example on Stackblitz.
Please make sure the graphql-eslint version under package.json matches yours.
package.json
[ ] 2. A failing test has been provided
[ ] 3. A local solution has been provided
[ ] 4. A pull request is pending review
Describe the bug
The rule @graphql-eslint/require-id-when-available doesn't seem to receive it's options when passed in
@graphql-eslint/require-id-when-available
options
To Reproduce Steps to reproduce the behavior:
Setup a rule like: '@graphql-eslint/require-id-when-available': ['error', { fieldName: 'foo' }],
'@graphql-eslint/require-id-when-available': ['error', { fieldName: 'foo' }],
The field looked for and reported on is still only id.
id
I got more logging by editing the minified dist file cjs/rules/require-id-when-available.js:
cjs/rules/require-id-when-available.js
const { fieldName = DEFAULT_ID_FIELD_NAME } = context.options[0] || {}; console.log("options", { o: context.options, c: JSON.stringify(context), })
Which produces:
options { o: [], c: '{"id":"@graphql-eslint/require-id-when-available","options":[]}' }
Options aren't passed through, so I can't specify alternative names than id to look for
Expected behavior
I can pass options through to the rule.
Environment:
@graphql-eslint/eslint-plugin
Additional context
Issue workflow progress
Progress of the issue based on the Contributor Workflow
[ ] 1. The issue provides a reproduction available on GitHub, Stackblitz or CodeSandbox
[ ] 2. A failing test has been provided
[ ] 3. A local solution has been provided
[ ] 4. A pull request is pending review
Describe the bug
The rule
@graphql-eslint/require-id-when-available
doesn't seem to receive it'soptions
when passed inTo Reproduce Steps to reproduce the behavior:
Setup a rule like:
'@graphql-eslint/require-id-when-available': ['error', { fieldName: 'foo' }],
The field looked for and reported on is still only
id
.I got more logging by editing the minified dist file
cjs/rules/require-id-when-available.js
:Which produces:
Options aren't passed through, so I can't specify alternative names than
id
to look forExpected behavior
I can pass options through to the rule.
Environment:
@graphql-eslint/eslint-plugin
: @graphql-eslint/eslint-plugin@3.20.1Additional context