Skip to content

Latest commit

Β 

History

1,010 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

@ntnyq/eslint-config

ESLint flat config preset for modern frontend projects (TypeScript, Vue, JSON, Markdown, YAML, TOML, and more).

CI NPM VERSION NPM NEXT VERSION NPM DOWNLOADS LICENSE

πŸ“‹ Requirements

  • Node.js ^22.23.0 || >=24.15.0
  • ESLint ^10.4.0

Tip

Need legacy runtime support?

  • Node.js v18: use v4
  • Node.js < 20.19.0: use v5
  • Node.js < 22.23.0: use v6

✨ Features

  • πŸš€ Works out of the box with ESLint flat config.
  • πŸ” Auto-detects and enables configs by your dependencies and file types.
  • 🧩 Covers common frontend files: TS, Vue SFC, JSON, Markdown, YAML, TOML.
  • 🎨 Keeps formatting tool friendly (Prettier or oxfmt).
  • πŸ“ˆ Supports scaling from single apps to monorepos.

πŸ“¦ Install

# pnpm
pnpm add -D eslint typescript @ntnyq/eslint-config

# npm
npm i -D eslint typescript @ntnyq/eslint-config

# yarn
yarn add -D eslint typescript @ntnyq/eslint-config

# bun
bun add -D eslint typescript @ntnyq/eslint-config

⚑ Quick start

  1. Create eslint.config.mjs in project root.
  2. Add npm scripts.
  3. Run lint.
// eslint.config.mjs
// @ts-check

import { defineESLintConfig } from '@ntnyq/eslint-config'

export default defineESLintConfig()
{
  "scripts": {
    "lint": "eslint .",
    "lint:fix": "eslint . --fix"
  }
}
pnpm lint

🧰 Common Frontend Setups

πŸ’š Vite + Vue 3 + TypeScript

// eslint.config.mjs
import { defineESLintConfig } from '@ntnyq/eslint-config'

export default defineESLintConfig({
  vue: true,
  typescript: {
    tsconfigPath: './tsconfig.app.json',
  },
})

βš›οΈ Vite + React + TypeScript

// eslint.config.mjs
import { defineESLintConfig } from '@ntnyq/eslint-config'

export default defineESLintConfig({
  vue: false,
  typescript: {
    tsconfigPath: './tsconfig.json',
  },
})

πŸ—οΈ Monorepo (apps + packages)

// eslint.config.mjs
import { defineESLintConfig } from '@ntnyq/eslint-config'

export default defineESLintConfig(
  {
    typescript: true,
    vue: true,
  },
  [
    {
      files: ['apps/web/**'],
      rules: {
        'no-console': 'warn',
      },
    },
    {
      files: ['packages/**'],
      rules: {
        'no-console': 'off',
      },
    },
  ],
)

βš™οΈ Configuration Patterns

πŸŽ›οΈ Enable or disable modules

import { defineESLintConfig } from '@ntnyq/eslint-config'

export default defineESLintConfig({
  svgo: true,
  astro: true,
  jsdoc: false,
  unicorn: false,
})

πŸ› οΈ Override built-in rules

import { defineESLintConfig } from '@ntnyq/eslint-config'

export default defineESLintConfig({
  vue: {
    overrides: {
      'vue/slot-name-casing': 'off',
    },
  },
  typescript: {
    overrides: {
      '@typescript-eslint/no-unused-vars': 'warn',
    },
  },
})

🧱 Add project-specific flat config blocks

import { defineESLintConfig } from '@ntnyq/eslint-config'

export default defineESLintConfig({}, [
  {
    files: ['**/scripts/**'],
    rules: {
      'no-console': 'off',
    },
  },
])

🎨 Formatter Integration

Use one formatter strategy in a project:

  • Prettier path: install prettier and optional @ntnyq/prettier-config
  • Oxfmt path: install oxfmt

πŸ’… Prettier example

pnpm add -D prettier @ntnyq/prettier-config
// prettier.config.mjs
// @ts-check

import { defineConfig } from '@ntnyq/prettier-config'

export default defineConfig()

πŸ§‘β€πŸ’» VS Code example

{
  "eslint.enable": true,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit",
    "source.organizeImports": "never",
    "source.sortImports": "never"
  }
}

🧩 Optional Configs (Disabled by Default)

  • astro
  • eslintPlugin
  • html
  • pnpm
  • svelte
  • svgo
  • unusedImports

Enable them explicitly in defineESLintConfig({ ... }) when needed.

πŸ”Ž Inspect Final Rules

🧠 Advanced API

🏷️ Versioning Policy

This project follows Semantic Versioning with opinionated lint rules:

  • Treated as breaking: Node.js engine changes, major plugin incompatibility, broad refactors.
  • Treated as non-breaking: enabling/disabling rules, rule option tuning, dependency bumps.

πŸ™ Credits

πŸ“„ License

MIT License Β© 2023-PRESENT ntnyq

About

πŸ“¦ An opinionated ESLint config preset.

Topics

Resources

Stars

20 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages