@wrckt/nx-htmlhint
v18.3.2
Published
<div align="center">
Downloads
245
Readme
nx-htmlhint
Nx plugin to use HTMLHint in your Nx workspace.
🚀 Features
nx-htmlhint provides a set tools for Nx to lint your projects' html with HTMLHint.
- Executor: Provides an executor to lint your html with HTMLHint.
- Generators: Helping you to configure your projects.
- Configuration: Per project configuration or worksace configurations.
- Only Affected: Uses Nx to support linting only affected projects.
- Cache: Uses Nx to cache already linted projects.
📦 Installation
using npm
npm i -D @wrckt/nx-htmlhint
using yarn
yarn add -D @wrckt/nx-htmlhint
using pnpm
pnpm add -D @wrckt/nx-htmlhint
🛠️ Configuring HTMLHint for a project
To add a HTMLHint configuration to a project you just have to run the @wrckt/nx-htmlhint:configuration
generator.
nx g @wrckt/nx-htmlhint:configuration --project <projectName>
The generator adds a .htmlhintrc
at the project root and adds a htmlhint target to the project.
At the first run the generator installs all required dependencies. It also configures the namedInputs
for the htmlhint targets.
Examples
Run @wrckt/nx-htmlhint for a project
nx htmlhint <projectName>
Run @wrckt/nx-htmlhint for all projects
nx run-many --target=htmlhint
Run @wrckt/nx-htmlhint for affected projects
nx affected --target=htmlhint
📖 Documentation
@wrckt/nx-htmlhint:configuration
generator
Add htmlhint configuration to a project.
Usage
Add configuration to a project:
nx g @wrckt/nx-htmlhint:configuration --projectName projectName
Options
|Option|Value|Description|
|------------|------------|------------|
|projectName
|string
|The name of the project.|
|withConfig
|boolean
|Adds individual .htmlhintrc to project.|
|skipFormat
|boolean
|Skip formatting files.|
nx-htmlhint:lint
executor
Run htmlhint on a project.
Target Options can be configured in project.json
or when the executor is invoked.
See: https://nx.dev/configuration/projectjson#targets
Options
|Option|Value|Default|Description|
|----|----|----|----|
|lintFilePattern
|string
|| Single file/dir/glob to pass directly to HTMLHint executor|
|config
|string
|| Path to a .htmlhint configuration file.|
|rules
|string[]
|| List of rules to be applied by linter.|
|rulesdir
|string
|| Path to file or directory containing custom rules to be applied by linter.|
|ignore
|string[]
|| A list of patterns of files or folders to ignore.|
|noColor
|boolean
|false
|Force enabling/disabling of color.|
|warn
|boolean
|false
| Only warn on error. Process will always exit with code 0.|
Compatibility with Nx and HTMLHint
nx-htmlhint depends on Nx and HTMLHint. This table provides the compatibility matrix between versions of nx-htmlhint, Nx and HTMLHint.
| nx-htmlhint Version | Nx Version | HTMLHint Version |
| --------------------- | ---------------------- | ---------------------- |
| ^17.0.0 \|\| ^18.0.0
| ^17.0.0 \|\| ^18.0.0
| ^1.1.4
|