17.1.4 • Published 26 days ago

nx-stylelint v17.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
26 days ago

Nx Stylelint

Stylelint executors and generators for Nx.

Build LICENSE npm version

🚀 Features

Nx Stylelint provides a set of power ups on Nx to lint your projects with Stylelint.

  • Executor: Provides a executor to lint your styles with stylelint.
  • Generators: Helping you to configure your projects.
  • Configuration: Per Project configuration of stylelint extending a workspace configuration.
  • Only Affected: Uses Nx to support linting only affected projects.
  • Cache: Uses Nx to cache already linted projects.

📦 Installation

using npm

npm i -D nx-stylelint

using yarn

yarn add -D nx-stylelint

using pnpm

pnpm add -D nx-stylelint

🛠️ Configuring Stylelint for a project

To add a stylelint configuration to a project you just have to run the nx-stylelint:configuration generator.

nx g nx-stylelint:configuration --project <projectName>

The generator adds a .stylelintrc.json at the project root which extends the root .stylelintrc.json and adds a stylelint target to the project.

At the first run the generator installs all required dependencies and creates a .stylelintrc.json file at the workspace root. It also adds the stylelint target to the cacheable operations of the default task runner and adds the root .stylelintrc.json to the implicit dependencies in the nx.json file.

🎯 Run Stylelint for affected projects

To run Stylelint for all affected projects run:

nx affected --target=stylelint

📖 Documentation

nx-stylelint:init generator

Add stylelint configuration and dependencies to the workspace.

Options

skipFormat

Skip formatting files.

Type: boolean

Default: false

nx-stylelint:configuration generator

Add stylelint configuration to a project.

Usage

Add configuration to a project:

nx g nx-stylelint:configuration --project projectName

Options

format

Stylelint Output formatter (https://stylelint.io/user-guide/usage/options#formatter).

Type: string

Possible values: compact, json, string, tap, unix, verbose

Default: string

project

The name of the project.

Type: string

skipFormat

Skip formatting files.

Type: boolean

Default: false

style

The style extension which is used for style files. Will be added to the lintFilePatterns which contains CSS files as a default value.

Type: string

Possible values: css, scss, less

Default: css

nx-stylelint:lint executor

Run stylelint on a project.

Options can be configured in workspace.json when defining the executor, or when invoking it.

Options

config

Path of the stylelint configuration file.

Type: string

Example: packages/lib/.stylelintrc.json

fix

Fixes linting errors (may overwrite linted files).

Type: boolean

Default: false

force

Succeeds even if there were linting errors.

Type: boolean

Default: false

format

Stylelint Output formatter (https://stylelint.io/user-guide/usage/options#formatter).

Type: string

Possible values: compact, json, string, tap, unix, verbose

Default: string

lintFilePatterns

One or more files/dirs/globs to pass directly to Stylelint's lint() method.

Type: array

maxWarnings

Number of warnings to trigger a nonzero exit code.

Type: number

Default: -1

outputFile

File to write the report to.

Type: string

silent

Hide output text.

Type: boolean

Default: false

18.0.0-beta.1

26 days ago

18.0.0-beta.3

26 days ago

18.0.0-beta.2

26 days ago

18.0.0-beta.0

29 days ago

17.2.0-beta.0

3 months ago

17.1.4

3 months ago

17.1.3-beta.0

3 months ago

17.1.3-beta.2

3 months ago

17.1.3-beta.1

3 months ago

17.1.3-beta.3

3 months ago

17.1.3

3 months ago

17.1.2

3 months ago

17.1.1

4 months ago

17.1.0

5 months ago

17.1.0-beta.1

5 months ago

17.1.0-beta.0

5 months ago

17.1.0-beta.2

5 months ago

16.0.0-beta.0

7 months ago

17.0.1

7 months ago

17.0.0

7 months ago

16.0.1

7 months ago

16.0.0

7 months ago

15.0.0-beta.0

1 year ago

15.0.0

1 year ago

14.0.2

2 years ago

13.5.3

2 years ago

14.0.0

2 years ago

14.0.1

2 years ago

13.5.1

2 years ago

13.5.2

2 years ago

13.4.0

2 years ago

13.5.0

2 years ago

13.4.0-beta.1

2 years ago

13.3.0

2 years ago

13.2.0

2 years ago

13.1.1

2 years ago

13.2.1

2 years ago

13.1.2

2 years ago

13.1.0

2 years ago

13.2.0-beta.3

2 years ago

13.2.0-beta.1

2 years ago

13.2.0-beta.2

2 years ago

13.2.0-beta.0

2 years ago

13.0.0-beta.4

2 years ago

13.0.0-beta.3

2 years ago

13.0.0-beta.0

2 years ago

13.0.0-beta.2

2 years ago

13.0.0-beta.1

2 years ago

13.0.0

2 years ago

13.0.1

2 years ago

12.3.1

3 years ago

12.3.0

3 years ago

12.1.2

3 years ago

12.1.0

3 years ago

12.2.0

3 years ago

12.1.1

3 years ago

12.1.1-beta.0

3 years ago

12.1.0-beta.0

3 years ago

12.2.0-beta.0

3 years ago

12.0.0

3 years ago

11.2.1

3 years ago

11.2.0

3 years ago

11.1.1

3 years ago

11.1.0

3 years ago

11.0.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.1

3 years ago