ESLint plugin to disallow the use of Dimensions.get('window') in react-native.
Install the plugin with npm:
npm install eslint-plugin-no-dimensions
In your .eslintrc file, add no-dimensions to your plugins and rules:
{
"plugins": [
"no-dimensions"
],
"rules": {
"no-dimensions/no-dimensions": "error"
}
}
To release a new version, run the following commands:
npm login
npm run release
This rule checks for usage of Dimensions.get('window')
and suggests using useWindowDimensions()
instead.
This project is licensed under the MIT License.