jest-preset-kyt-styled

Jest preset for linting styles in CSS-in-JS projects

Usage no npm install needed!

<script type="module">
  import jestPresetKytStyled from 'https://cdn.skypack.dev/jest-preset-kyt-styled';
</script>

README

jest-preset-kyt-styled

Jest preset for Stylelint-ing files in CSS-in-JS projects. Internally, uses these packages from the styled-components project:

Installation

$ yarn add --dev jest jest-preset-kyt-styled

// or

$ npm i --save-dev --save-exact jest jest-preset-kyt-styled

Setup

In your local Jest config - for instance, jest.config.js:

module.exports = {
  preset: 'jest-preset-kyt-styled',
  // By default, looks for files named `styled.js` in `src` (NYT convention)
  // change this value to match your project files that contain CSS-in-JS
  testMatch: ['<rootDir>/src/**/**/styled.js'],
};