Disallow unknown React Native CSS properties.
This rule is meant to be used with tools that allow you to write CSS when using React Native, e.g. styled-components, React Native CSS modules, etc.
const Header = styled.div`
heigth: 100%;
`;
/** ↑
* These properties */
This rule considers properties supported by css-to-react-native to be known.
This rule ignores variables ($sass
, @less
, --custom-property
).
The following patterns are considered violations:
.text {
word-wrap: break-word;
}
.text {
colr: blue;
}
.text {
my-property: 1;
}
const Button = styled.a`
colr: blue;
`;
The following patterns are not considered violations:
.text {
color: green;
}
.text {
align-self: center;
}
.text {
elevation: 6;
}
.text {
box-shadow: 1px 2px 3px red;
}
const Button = styled.a`
color: green;
`;
Given:
["/^my-/", "custom"];
The following patterns are not considered violations:
.text {
my-property: 10px;
}
.text {
my-other-property: 10px;
}
.text {
custom: 10px;
}
const Button = styled.a`
my-property: 10px;
`;