@nx/linter:workspace-rule

Create a new Workspace Lint Rule.

This command will generate a new workspace lint rule called my-custom-rule. The new rule will be generated in tools/eslint-rules/rules folder:

nx g @nx/linter:workspace-rule my-custom-rule

Nx 15 and lower use @nrwl/ instead of @nx/

Usage

nx generate workspace-rule ...

By default, Nx will search for workspace-rule in the default collection provisioned in workspace.json.

You can specify the collection explicitly as follows:

nx g @nx/linter:workspace-rule ...
Nx 15 and lower use @nrwl/ instead of @nx/

Show what will be generated without writing to disk:

nx g workspace-rule ... --dry-run

Options

directory

dirRequired
string
Default: rules

Create the rule under this directory within tools/eslint-rules/ (can be nested).

name

Required
string

The name of the new rule.