0.0.9 • Published 1 year ago

eslint-plugin-react-strict-dom v0.0.9

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

eslint-plugin-react-strict-dom

A plugin to restrict styles to those that are supported on both web and native.

How to fix?

If the lint rule complains about a invalid style property, the following options exist:

  • Remove the invalid style.
  • Allow the invalid style, ignore the lint warning, and accept the runtime warning.
  • Split the component or its styles into separate *.web.js and *.native.js files.

Examples

✅ Examples of valid code for this rule:

You can either replace this with a valid property:

// Foo.js
const styles = stylex.create({
  root: {
    textAlign: 'center',
  },
});

❌ Examples of invalid code for this rule:

// Foo.js
const styles = css.create({
  root: {
    justifySelf: 'center', // `justifySelf` is not supported on native
  },
});

If you have to use a property on web that is unsupported on native, fork the implementation based on the platforms:

// Foo.web.js
// The plugin will ignore `*.web.js` files.
const styles = stylex.create({
  root: {
    justifySelf: 'center'
  },
});

// Foo.native.js
const styles = stylex.create({
  root: {
    textAlign: 'center'
  },
});

License

React Strict DOM is MIT licensed.

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago