Skip to content

Guide

Install

shell
npm i eslint-plugin-ntnyq -D
shell
yarn add eslint-plugin-ntnyq -D
shell
pnpm add eslint-plugin-ntnyq -D

Basic Usage

Highly recommended to use eslint.config.mjs as config file.

eslint.config.mjs
ts
// @ts-check

import  from 'eslint-plugin-ntnyq'

/**
 * @type {import('eslint').Linter.Config[]}
 */
export default [
  // other configs
  .....,
]

The recommended config enables a subset of the rules that should be most useful to most users.

See src/configs/recommended.ts for more details.

Advanced Usage

Override/add specific rules configurations.

See also: http://eslint.org/docs/user-guide/configuring.

eslint.config.mjs
ts
// @ts-check

import {  } from 'eslint-plugin-ntnyq'

/**
 * @type {import('eslint').Linter.Config[]}
 */
export default [
  // other configs
  ({
    : 'ntnyq/recommended',
    : ['**/*.?([cm])[jt]s?(x)'],
    : {
      'ntnyq/no-member-accessibility': 'error',
    },
  }),
]

Options of createConfig

All fields of ESLint Linter.Config are supported, but bellow fields have default value:

files

The files to be linted.

  • Type: string[]
  • Required: false
  • Default: ['**/*.?([cm])[jt]s?(x)']

languageOptions.parser

The parser to use, this is set by default and can't be overridden.

plugins

The plugins to use.

  • Type: Record<string, ESLint.Plugin>
  • Required: false
  • Default: key ntnyq set to this plugin