Skip to content

Latest commit

 

History

History
115 lines (88 loc) · 1.48 KB

File metadata and controls

115 lines (88 loc) · 1.48 KB

css-property-no-unknown

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).

Options

true

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;
`;

Optional secondary options

ignoreProperties: ["/regex/", "string"]

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;
`;