kristerkari / stylelint-react-native

A collection of React Native specific linting rules for stylelint (in a form of a plugin).
MIT License
57 stars 1 forks source link

How to make it work for me? #54

Open ThoughtZer opened 3 years ago

ThoughtZer commented 3 years ago
const stylelint = require('stylelint');

const code = `
  import { StyleSheet } from 'react-native';

  StyleSheet.create({
    foo: {
      COLR: 'red'
    }
  })
`;

const options = {
  config: {
    rules: {
      'react-native/style-property-no-unknown': true,
    },
    plugins: ['stylelint-react-native'],
  },
  code,
  syntax: 'css-in-js',
};

stylelint.lint(options).then((output) => {
  console.log(output.results[0].warnings); // []
});

Did i do something wrong?