Skip to content

Quickstart

Using the @nhtio/eslint-config is simple and easy. Just follow the steps below:

Prerequisites

Installation

You can install @nhtio/eslint-config directly from your preferred package manager

sh
npm i @nhtio/eslint-config@latest -D
sh
pnpm add @nhtio/eslint-config@latest -D
sh
yarn add @nhtio/eslint-config@latest -D

Then create the eslint configuration file at the root of your project:

javascript
import { recommended } from '@nhtio/eslint-config/recommended'
export default recommended;
javascript
const recommended = require('@nhtio/eslint-config/recommended')
module.exports = recommended;

Optionally, you can add the following to the scripts property of your package.json:

json
{
    ...
    "scripts": {
        ...
        "lint": "eslint .", 
        ...
    }
    ...
}

Customization

If you would like to append custom rules to the configuration, you can use the configure function from the @nhtio/eslint-config package as follows:

javascript
import { configure } from '@nhtio/eslint-config'
export default configure(
    // your rules here
);
javascript
const configure = require('@nhtio/eslint-config')
module.exports = configure(
    // your rules here
);

Custom JSDoc Tags

The config enforces JSDoc/TypeDoc documentation on exported symbols and validates tag names against the full TypeDoc tag vocabulary. If your project uses additional custom tags beyond what TypeDoc defines, use withCustomJsdocTags to extend the allowed set without disabling the rule:

javascript
import { configure, withCustomJsdocTags } from '@nhtio/eslint-config'
export default configure(
    withCustomJsdocTags(['myCustomTag', 'anotherTag']),
);
javascript
const { configure, withCustomJsdocTags } = require('@nhtio/eslint-config')
module.exports = configure(
    withCustomJsdocTags(['myCustomTag', 'anotherTag']),
);