Note that this package uses npm version 7.7.0 or higher as the main package manager, but the documentations also include instructions to work with Yarn (classic / v1).
Installation
Add the package as development dependency to your project:
1# With npm...
2npm install --save-dev @svengreb/remark-preset-lint34# or Yarn.
5yarn add --dev @svengreb/remark-preset-lint
Note that peer dependencies, like the remark-lint package itself, are only installed automatically when using a npm version equal or higher than 7.0.0, otherwise they must be installed separately like described in the peer dependencies section below.
See the Node distribution index for more information about which npm version is bundled with which Node version.
As of npm version 7.0.0, peer dependencies areinstalled automatically and does not require any additional steps.
npm versions >=5.0.0 <7.0.0
For npm version equal to or higher than 5.0.0 (pre-bundled with Node.js 8) but less than 7.0.0, all peer dependencies can be auto-installed using the pre-bundled npx package:
If you’re using a npm version less than 5.0.0, the npx package is not pre-bundled, but users can either simply install the npx package globally to run the above command or use the install-peerdeps helper package locally/globally to let it handle the installation of all peer dependencies:
1# Install and use the "install-peerdeps" helper package locally...
2npm install install-peerdeps
3./node_modules/.bin/install-peerdeps --dev @svengreb/remark-preset-lint45# ...or globally.
6npm install --global install-peerdeps
7install-peerdeps --dev @svengreb/remark-preset-lint
To install all peer dependencies manually without npx or any helper package, the npm info command can be used to get a list of all packages and their versions:
1# List the names and versions of all peer dependencies...2npm info "@svengreb/remark-preset-lint" peerDependencies
34# ...and install each listed package manually.5npm install PACKAGE@VERSION
Using Yarn instead of npm
If you’re not using npm but Yarn, peer dependencies can be installed by either adding them manually or using the install-peerdeps helper package:
1# Either add all packages manually by listing all required names and their versions and install them manually...
2yarn info @svengreb/remark-preset-lint peerDependencies3yarn add --dev remark-lint #...45# ...or use the "install-peerdeps" helper package.
6yarn add --dev install-peerdeps
7yarn run install-peerdeps --dev @svengreb/remark-preset-lint
Usage
The package can be used as rule preset by adding it to the plugins within your .remarkrc.js or .remarkrcconfiguration file: