All Projects → keplersj → jest-runner-stylelint

keplersj / jest-runner-stylelint

Licence: other
Stylelint runner for Jest

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to jest-runner-stylelint

Jest Styled Components Stylelint
Run stylelint on your styled-components styles at runtime.
Stars: ✭ 25 (+38.89%)
Mutual labels:  stylelint, jest
Postcss Less
PostCSS Syntax for parsing LESS
Stars: ✭ 93 (+416.67%)
Mutual labels:  stylelint, less
Wemake Vue Template
Bleeding edge vue template focused on code quality and developer happiness.
Stars: ✭ 645 (+3483.33%)
Mutual labels:  stylelint, jest
Vscode Stylelint
A Visual Studio Code extension to lint CSS/SCSS/Less with stylelint
Stars: ✭ 260 (+1344.44%)
Mutual labels:  stylelint, less
Front End Guide
📚 Study guide and introduction to the modern front end stack.
Stars: ✭ 14,073 (+78083.33%)
Mutual labels:  stylelint, jest
Static Site Boilerplate
A better workflow for building modern static websites.
Stars: ✭ 1,633 (+8972.22%)
Mutual labels:  stylelint, less
React Ssr Starter
All have been introduced React environment
Stars: ✭ 20 (+11.11%)
Mutual labels:  stylelint, jest
dva-typescript-antd-starter-kit
A admin dashboard application demo based on antd by typescript and dva
Stars: ✭ 61 (+238.89%)
Mutual labels:  stylelint, less
Express Webpack React Redux Typescript Boilerplate
🎉 A full-stack boilerplate that using express with webpack, react and typescirpt!
Stars: ✭ 156 (+766.67%)
Mutual labels:  stylelint, jest
Nextjs Ts
Opinionated Next JS project boilerplate with TypeScript and Redux
Stars: ✭ 134 (+644.44%)
Mutual labels:  stylelint, jest
sonar-css-plugin
SonarQube CSS / SCSS / Less Analyzer
Stars: ✭ 46 (+155.56%)
Mutual labels:  stylelint, less
react-component-library-lerna
Build your own React component library managed with lerna, presented with storybook and published in private npm registry.
Stars: ✭ 55 (+205.56%)
Mutual labels:  stylelint, jest
noov.js
📦 noov.js for react ssr solution
Stars: ✭ 18 (+0%)
Mutual labels:  jest
nuxt-boilerplate
Nuxt.js Boilerplate
Stars: ✭ 25 (+38.89%)
Mutual labels:  jest
generator-yeomify-landing
Yeoman generator for landing project powered by Gulp
Stars: ✭ 29 (+61.11%)
Mutual labels:  less
jest-preset-preact
Jest preset for testing Preact apps
Stars: ✭ 14 (-22.22%)
Mutual labels:  jest
gradle-upgrade-interactive
CLI to interactively upgrade gradle dependencies, inspired by yarn.
Stars: ✭ 44 (+144.44%)
Mutual labels:  jest
GFontsSpace
Preview: https://pankajladhar.github.io/GFontsSpace
Stars: ✭ 88 (+388.89%)
Mutual labels:  jest
muilessium
UI Framework for simple websites - landings, blogs, etc.
Stars: ✭ 16 (-11.11%)
Mutual labels:  less
vscode-less
🔌 Less intellisense for Variables and Mixins in all Less files.
Stars: ✭ 21 (+16.67%)
Mutual labels:  less

Build Status npm version codecov Mentioned in Awesome Jest

jest-runner-stylelint

Stylelint runner for Jest

Usage

Install

Install jest, jest-runner-stylelint, and stylelint

npm install --save-dev jest jest-runner-stylelint stylelint

# or with yarn

yarn add --dev jest jest-runner-stylelint stylelint

Configure stylelint

You must have stylelint configured before it'll lint any of your files. Please follow the stylelint documentation on configuration to create your config.

Add it to your Jest config

Using Built-in Preset

This package includes a Jest preset which configures Jest to run stylelint on all files supported by styleint. To use it set the following in your package.json:

{
  "jest": {
    "preset": "jest-runner-stylelint"
  }
}

or jest.config.js:

module.exports = {
  preset: "jest-runner-stylelint",
};

Manually

In your package.json

{
  "jest": {
    "runner": "stylelint",
    "moduleFileExtensions": [
      "css",
      "sass",
      "scss",
      "less",
      "sss",
      "htm",
      "html",
      "md",
      "markdown",
      "mdx",
      "js",
      "jsx",
      "ts",
      "tsx",
      "vue"
    ],
    "testMatch": [
      "**/*.css",
      "**/*.sass",
      "**/*.scss",
      "**/*.less",
      "**/*.sss",
      "**/*.htm",
      "**/*.html",
      "**/*.md",
      "**/*.markdown",
      "**/*.mdx",
      "**/*.js",
      "**/*.jsx",
      "**/*.ts",
      "**/*.tsx",
      "**/*.vue"
    ]
  }
}

Or in jest.config.js

module.exports = {
  runner: "stylelint",
  moduleFileExtensions: [
    "css",
    "sass",
    "scss",
    "less",
    "sss",
    "htm",
    "html",
    "md",
    "markdown",
    "mdx",
    "js",
    "jsx",
    "ts",
    "tsx",
    "vue",
  ],
  testMatch: [
    "**/*.css",
    "**/*.sass",
    "**/*.scss",
    "**/*.less",
    "**/*.sss",
    "**/*.htm",
    "**/*.html",
    "**/*.md",
    "**/*.markdown",
    "**/*.mdx",
    "**/*.js",
    "**/*.jsx",
    "**/*.ts",
    "**/*.tsx",
    "**/*.vue",
  ],
};

Run Jest

npx jest

# or with yarn

yarn jest

Toggle --fix in watch mode

jest-stylelint-runner comes with a watch plugin that allows you to toggle the --fix value while in watch mode without having to update your configuration.

To use this watch plugin simply add this to your Jest configuration.

{
  watchPlugins: ['jest-runner-stylelint/watch-fix'],
}

After this run Jest in watch mode and you will see the following line in your watch usage menu.

 › Press F to override Stylelint --fix.

Options

This project uses cosmiconfig, so you can provide config via:

  • a jest-runner-stylelint property in your package.json
  • a jest-runner-stylelint.config.js JS file
  • a .jest-runner-stylelintrc JSON file

In package.json

{
  "jest-runner-stylelint": {
    "cliOptions": {
      // Options here
    }
  }
}

or in jest-runner-stylelint.config.js

module.exports = {
  cliOptions: {
    // Options here
  },
};

cliOptions

Follow the stylelint documentation on configuration to create your cli options.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].