You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, my colleague discovered that incorrect Relay imports are not reported as expected. Failing test (well, should be failing but it's not):
{code: ` import type {invalid as MyComponent_user} from './__generated__/MyComponent_user.graphql' class MyComponent extends React.Component<{user: MyComponent_user}> { render() { return <div />; } } createFragmentContainer(MyComponent, { user: graphql\`fragment MyComponent_user on User {id}\`, }); `,errors: [{message: 'TODO: invalid type imported'}]},
Notice that the imported type invalid as MyComponent_user doesn't exist. In fact, this rule doesn't require the import at all and it is happy even if you delete the import type line completely. Seems like it takes into account only the property name used in props definition but not the imports. I believe this is not intended and it's a bug because seems like there are tests to cover this but they don't work as I would expect - the import is irrelevant for them:
Hello, my colleague discovered that incorrect Relay imports are not reported as expected. Failing test (well, should be failing but it's not):
Notice that the imported type
invalid as MyComponent_user
doesn't exist. In fact, this rule doesn't require the import at all and it is happy even if you delete theimport type
line completely. Seems like it takes into account only the property name used in props definition but not the imports. I believe this is not intended and it's a bug because seems like there are tests to cover this but they don't work as I would expect - the import is irrelevant for them:eslint-plugin-relay/test/test.js
Lines 232 to 233 in 267d5e6
cc @kassens, thanks for checking it and confirming/rejecting it
The text was updated successfully, but these errors were encountered: