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
);