eslint-plugin-react-native icon indicating copy to clipboard operation
eslint-plugin-react-native copied to clipboard

TypeError: this.styleSheets[styleSheetName].filter is not a function

Open Romick2005 opened this issue 3 years ago • 1 comments

I have in one of my file the following line: const hasOwnProperty = Object.prototype.hasOwnProperty;

This cause eslint rule check to failure with error: TypeError: this.styleSheets[styleSheetName].filter is not a function

Rule: "react-native/no-unused-styles"
    at StyleSheets.markAsUsed (/node_modules/eslint-plugin-react-native/lib/util/stylesheet.js:37:8)
    at /node_modules/eslint-plugin-react-native/lib/rules/no-unused-styles.js:57:23
    at Set.forEach (<anonymous>)

Romick2005 avatar Sep 20 '22 14:09 Romick2005

Not sure if it helps you or someone else, but in my case i had to lint ignore the android and ios folders.

Added this to my .eslintignore file

android
ios

Matzielab avatar Apr 13 '23 06:04 Matzielab