-
Notifications
You must be signed in to change notification settings - Fork 24
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
Feature/add support for custom image module with image alias #93
Feature/add support for custom image module with image alias #93
Conversation
hey @FrederickEngelhardt -- thanks for the PR. although this is an edge case I like the overall concept here and I'd be happy to add support in. right now while testing, it looks like there are a couple of issues that need to be addressed. not sure why this is no longer reported when it used to be before?
also really sorry but after merging another PR first, you'll now need to rebase on top of latest |
d86f125
to
a2363e5
Compare
@jpdriver Sorry for the delay. Ended up cherry-picking my changes and bringing them over from master. This PR should be good. Those errors you were receiving should be resolved. Only thing to note is the module import syntax (which nobody should be doing now) is not supported. Example of cases where the errors will not work. import * as RN from 'react-native
const { Image } = RN
// or
const RN = require('react-native')
const {Image} = RN Otherwise aliases such as RNImage or anything you name it as from react-native lib will work. import React from 'react'
import { Image as RNImage } from 'react-native'
const CustomImage = () => {
return <RNImage />
}
export default CustomImage |
…t that references all config options
078c879
to
40b806f
Compare
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.
Thanks!
In response to #92
Use case:
Example:
Sample image component
This PR also support module import linting
This PR will not include resolutions for aliasing named Imports such as
Perhaps this can be handled at a later date...
Proposal:
Adds ability to check for A11y for
react-native
Images and any Image aliased component that are identified. Otherwise the linter will not check and exists out early.Changes:
has-valid-accessibility-ignores-invert-colors
so far) but the boilerplate is there for generation of these labels. To me, it feels much cleaner seeing these use cases cleanly identified in sentences rather than seeing large amounts of JSX. Following this structure you can now add a title to anit
block instead of it becoming JSX.Demo Tutorial
Run the following commands
rm -rf node_modules
// not necessary but it might be beneficialyarn cache clean
// essentialyarn add --dev github:FrederickEngelhardt/eslint-plugin-react-native-a11y#v2.01-rc1
// this branch was rebased off this current branch with thelib/
files built using node 12 and committed to the branch.accessibilityIgnoresInvertColors
errors unless it's imported fromreact-native
Troubleshooting
.babelrc
to use node 12. Node 4 seems a bit low for a react-native dependency. Thoughts?Let me know what you think of this PR. Thanks!