This package has been deprecated

Author message:

This package is deprecated. Please migrate to @shopify/loom-plugin-stylelint

@sewing-kit/plugin-stylelint
TypeScript icon, indicating that this package has built-in type declarations

0.4.4 • Public • Published

@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,
        }));
      });
    });

Readme

Keywords

none

Package Sidebar

Install

npm i @sewing-kit/plugin-stylelint

Weekly Downloads

26

Version

0.4.4

License

MIT

Unpacked Size

7.56 kB

Total Files

10

Last publish

Collaborators

  • bpscott
  • lemonmade
  • shopify-dep