Skip to main content

Stylelint driver

Provides Stylelint support by dynamically generating a .stylelintrc.js config file.


  • stylelint ^13.0.0


Can be listened to on the StylelintDriver instance.

onCreateIgnoreFilecontext: ConfigContext, path: Path, config: { ignore: string[] }Called before the ignore file is written.


In your configuration module, install the driver, stylelint, and any plugins.

yarn add @beemo/driver-stylelint stylelint

Create a file at configs/stylelint.ts (or js) in which to house your stylelint configuration.

import { StylelintConfig } from '@beemo/driver-stylelint';
const config: StylelintConfig = {
rules: {
'color-no-invalid-hex': true,
// ...
export default config;


In your consuming project, enable the driver by adding stylelint to your drivers config.

import { BeemoConfig } from '@beemo/core';
const config: BeemoConfig = {
module: '<config-module>',
drivers: ['stylelint'],
export default config;

Ignoring paths#

Instead of using an .stylelintignore dotfile, you can define an ignore property in your configuration module's configs/stylelint.ts file, or a project's .config/beemo/stylelint.ts file. This property accepts an array of strings. For example:



import { StylelintConfig } from '@beemo/driver-stylelint';
const config: StylelintConfig = {
// ...
ignore: ['lib/', '*.min.js', '*.map'],
export default config;

This feature follows the same configuration lifecycle as .stylelintrc.js, with the added benefit of conditional logic, and being generated at runtime!