Getting Started
💿 Installation
You'll first need to install ESLint:
bash
npm install --save-dev eslint
bash
pnpm add --save-dev eslint
bash
yarn add --dev eslint
Next, install eslint-plugin-ninja
:
bash
npm install --save-dev eslint-plugin-ninja
bash
pnpm add --save-dev eslint-plugin-ninja
bash
yarn add --dev eslint-plugin-ninja
⚙️ Usage
Add ninja
to the plugins section of your .eslintrc
configuration file or import eslint-plugin-ninja
in your eslint.config.js
. Then configure the rules you want to use under the rules section.
Legacy Config
json
// .eslintrc
{
"plugins": ["ninja"],
"extends": ["plugin:ninja/recommended"],
"rules": {
"ninja/align": 2,
"ninja/prefer-emoji": 1
}
}
Flat Config
js
// eslint.config.js
import ninja from 'eslint-plugin-ninja'
export default {
plugins: {
ninja,
},
extends: ['plugin:ninja/recommended'],
rules: {
'ninja/align': 'error',
'ninja/prefer-emoji': 'warn',
},
}