0.4.4 • Published 3 years ago

@sewing-kit/plugin-stylelint v0.4.4

Weekly downloads
83
License
MIT
Repository
github
Last release
3 years ago

@sewing-kit/plugin-stylelint

This package provides a sewing-kit plugin that runs stylelint as part of the sewing-kit lint command.

Installation

yarn add @sewing-kit/plugin-stylelint --dev

stylelint()

The stylelint function returns a sewing-kit plugin. This plugin applies to the workspace, not an individual project.

import {createWorkspace} from '@sewing-kit/core';
import {stylelint} from '@sewing-kit/plugin-stylelint';

export default createWorkspace((workspace) => {
  workspace.use(stylelint());
});

By default stylelint runs over css files. You can modify the files that are processed by passing in a files glob to the plugin's options.

export default createWorkspace((workspace) => {
  // Run stylelint on css and scss files
  workspace.use(stylelint({files: '**/*.{css,scss}'}));
});

Hooks

This plugin adds the following hooks to LintWorkspaceConfigurationCustomHooks:

  • stylelintFlags: an object of options to convert into command line flags for the eslint command. These options are camelcase versions of their CLI counterparts.

    import {createWorkspaceLintPlugin} from '@sewing-kit/core';
    
    const plugin = createWorkspaceLintPlugin(({hooks}) => {
      hooks.configure.hook((configure) => {
        // Modify the maximum number of allowed warnings from the default of 0
        configure.stylelintFlags?.hook((flags) => ({
          ...flags,
          maxWarnings: 5,
        }));
      });
    });
0.4.4

3 years ago

0.4.3

3 years ago

0.4.1

3 years ago

0.4.2

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.2.0-alpha.1

3 years ago

0.1.10

3 years ago

0.1.9

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago