
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
jest-runner-stylelint
Advanced tools
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
You must have stylelint configured before it'll lint any of your files. Please follow the stylelint documentation on configuration to create your config.
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",
};
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",
],
};
npx jest
# or with yarn
yarn jest
--fix
in watch modejest-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.
This project uses cosmiconfig, so you can provide config via:
jest-runner-stylelint
property in your package.json
jest-runner-stylelint.config.js
JS file.jest-runner-stylelintrc
JSON fileIn package.json
{
"jest-runner-stylelint": {
"cliOptions": {
// Options here
}
}
}
or in jest-runner-stylelint.config.js
module.exports = {
cliOptions: {
// Options here
},
};
Follow the stylelint documentation on configuration to create your cli options.
FAQs
Stylelint runner for Jest
The npm package jest-runner-stylelint receives a total of 6,082 weekly downloads. As such, jest-runner-stylelint popularity was classified as popular.
We found that jest-runner-stylelint demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.