FormidableLabs / FormidableLabs/eslint-plugin-react-native-a11y

Error with any custom components aliased as Image

Open
#92 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
306
Forks
29
PR merge metrics
No merged PRs in 30d

Description

When importing the component under an alias of Image or a named export { Image } I get the following error. Looks like the Eslint rule is looking for any component named Image and applying this rule. Is it possible to get the eslint rule to only apply to Images imported directly from react-native?

```
Found an element which will be inverted. Add the accessibilityIgnoresInvertColors propeslint(react-native-a11y/has-valid-accessibility-ignores-invert-colors)
```

Code:
Image.tsx
```
import React from 'react'
import { Image as RNImage, ImageProps } from 'react-native'

const Image = (props: ImageProps) => (

)

export default Image
```

And example area you would have an error
App.tsx
```
import Image from 'components/Image'
const App = () => // this will error saying you are not providing accessibilityIgnoresInvertColors for the image.
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.