A collection of React Native specific linting rules for stylelint (in a form of a plugin).
Installation and usage
stylelint, if you haven't done so yet):
yarn add stylelint stylelint-react-native --dev
npm install stylelint stylelint-react-native --save-dev
.stylelintrc config file (or open the existing one), add
stylelint-react-native to the plugins array and the rules you need to the rules list. All rules from
stylelint-react-native need to be namespaced with
Please refer to stylelint docs for the detailed info on using this linter plugin.
List of rules
font-weight-no-ignored-values: Disallow valid
font-weightvalues that work on iOS, but are ignored and get mapped to
boldweight on Android.
css- rules (for tools like styled-components)
css-property-no-unknown: Disallow unknown React Native CSS properties.
style- rules (for React Native's built-in styling)
These rules are meant to be used when styling with React Native's built-in styling, or with tools that use React Native's default styling.
style-property-no-unknown: Disallow unknown React Native Style properties.
There work on the plugin's rules is still in progress, so if you feel like it, you're welcome to help out in any of these (the plugin follows stylelint guidelines so most part of this is based on its docs):
- Create, enhance, and debug rules (see stylelint's guide to "Working on rules").
- Improve documentation.
- Chime in on any open issue or pull request.
- Open new issues about your ideas on new rules, or for how to improve the existing ones, and pull requests to show us how your idea works.
- Add new tests to absolutely anything.
- Work on improving performance of rules.
- Contribute to stylelint
- Spread the word.
There is also stackoverflow, which would be the preferred QA forum.