# @shopify/loom-plugin-stylelint

> loom plugin for linting with stylelint

Latest version **2.0.1** (published 2022-08-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install @shopify/loom-plugin-stylelint
pnpm add @shopify/loom-plugin-stylelint
yarn add @shopify/loom-plugin-stylelint
bun add @shopify/loom-plugin-stylelint
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2022-08-23 |
| First published | 2021-09-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | ^12.22.0 \|\| ^14.17.0 \|\| >=16.0.0 |
| Dependencies | 1 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Shopify Inc. |
| Maintainers | wcandillon, jplhomer, marytal, themallen, nathanpjf, shopify-dep, goodforonefare, lemonmade, vsumner, wizardlyhel, antoine.grant, tsov, andyw8-shopify, henrytao, hannachen, andrewapperley, iainmcampbell, vividviolet, bpscott |

## Links

- npm: https://www.npmjs.com/package/@shopify/loom-plugin-stylelint
- Repository: https://github.com/Shopify/loom
- Homepage: https://github.com/Shopify/loom/blob/main/packages/loom-plugin-stylelint/README.md
- Issues: https://github.com/Shopify/loom/issues
- npm.io page: https://npm.io/package/@shopify/loom-plugin-stylelint

## Dependencies (1)

- [@shopify/loom](https://npm.io/package/@shopify/loom.md) ^1.0.2

## Recent versions

- 2.0.1 (latest) — 2022-08-23
- 0.6.0-alpha.0 (beta) — 2021-10-12
- 2.0.0 — 2021-12-03
- 1.0.1 — 2021-11-23
- 1.0.0 — 2021-10-22
- 0.6.0-alpha.4 — 2021-10-15
- 0.6.0-alpha.3 — 2021-10-15
- 0.6.0-alpha.2 — 2021-10-15
- 0.6.0-alpha.1 — 2021-10-13
- 0.5.0 — 2021-09-13

## README

# `@shopify/loom-plugin-stylelint`

This package provides a `loom` plugin that runs [stylelint](https://stylelint.io) as part of the `loom lint` command.

This package does not make any assumptions about what version of stylelint or what ruleset you should use. You will need to install `stylelint` as a peerDependency and you will need to [configure stylelint](https://stylelint.io/user-guide/configure) yourself. We recommend using the presets provided by [`@shopify/stylelint-plugin`](https://github.com/Shopify/web-configs/tree/main/packages/stylelint-plugin).

## Installation

```sh
yarn add @shopify/loom-plugin-stylelint stylelint --dev
```

## Usage

Add `stylelint` to your loom worksace plugins.

```js
import {createWorkspace} from '@shopify/loom';
import {stylelint} from '@shopify/loom-plugin-stylelint';

// `createWorkspace` may be `createPackage`, or `createApp` if your workspace
// consists of a single project
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.

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

### Running only Stylelint when linting

To run only the Stylelint linting step, you can use `--isolate-step`:

```sh
loom lint --isolate-step=Stylelint
```

### Hooks

This plugin adds the following hooks to `LintWorkspaceConfigurationCustomHooks`:

- `stylelintFlags`: an object of options to convert into command line flags for the `stylelint` command. These options are camelcase versions of their [CLI counterparts](https://stylelint.io/user-guide/usage/cli/).

  ```js
  import {createWorkspacePlugin} from '@shopify/loom';

  function demoPlugin() {
    return createWorkspacePlugin('Demo', ({tasks: {lint}}) => {
      lint.hook(({hooks}) => {
        hooks.configure.hook((configure) => {
          // Modify the maximum number of allowed warnings from the default of 0
          configure.stylelintFlags?.hook((flags) => ({
            ...flags,
            maxWarnings: 5,
          }));
        });
      });
    });
  }
  ```

---
_Source: https://npm.io/package/@shopify/loom-plugin-stylelint · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
