Getting Started

Configuration

Configure @eienjs/eslint-config options, auto-detected features, and rule presets.

The default export eienjs() (also exported as a named function) accepts an options object as its first argument to toggle integrations, customize stylistic preferences, and override rules.

eslint.config.js
import { eienjs } from '@eienjs/eslint-config';

export default eienjs({
  adonisjs: true,
  formatters: true,
  typescript: {
    erasableSyntaxOnly: true,
    tsconfigPath: 'tsconfig.json',
  },
});

Configuration Options Overview

OptionTypeDefaultDescription
gitignoreboolean | FlatGitignoreOptionstrueRespect .gitignore files via eslint-config-flat-gitignore.
ignoresstring[] | ((originals: string[]) => string[])[]Extend or modify global ignore patterns.
javascriptOptionsOverridesEnabledCore JavaScript rules (always enabled; supports overrides).
typescriptboolean | OptionsTypescriptAuto-detectedTypeScript rules, type-aware linting, and erasable syntax checks.
stylisticboolean | (StylisticConfig & OptionsOverrides)trueCode formatting rules powered by @stylistic/eslint-plugin.
adonisjsboolean | OptionsAdonisJSfalseAdonisJS rules and directory-specific overrides.
nuxtboolean | OptionsNuxtfalseNuxt 3/4 rules, page/layout checks, and config key sorting.
vueboolean | OptionsVueAuto-detectedVue 3 SFC rules (<script setup lang="ts"> by default).
astroboolean | OptionsOverridesfalseAstro component rules and parser setup.
formattersboolean | OptionsFormattersfalseExternal Prettier formatters for CSS, HTML, XML, SVG, Markdown, and Astro.
unicornboolean | OptionsUnicorntrueeslint-plugin-unicorn rules (snake_case filenames by default).
perfectionistboolean | OptionsOverridestrueNatural sorting for imports and exports via eslint-plugin-perfectionist.
importsboolean | OptionsOverridestrueImport hygiene rules via eslint-plugin-import-lite and eslint-plugin-antfu.
nodebooleantrueNode.js rules via eslint-plugin-n.
jsdocbooleantrueJSDoc formatting and validation rules.
regexpboolean | (OptionsRegExp & OptionsOverrides)trueRegular expression rules via eslint-plugin-regexp.
testboolean | OptionsOverridestrueVitest and no-only-tests rules for test files.
jsoncboolean | OptionsOverridestrueJSON/JSONC/JSON5 linting plus package.json and tsconfig.json sorting.
yamlboolean | OptionsOverridestrueYAML linting and formatting via eslint-plugin-yml.
tomlboolean | OptionsOverridestrueTOML linting and formatting via eslint-plugin-toml.
markdownboolean | OptionsMarkdowntrueLints Markdown files and code blocks inside Markdown.
pnpmboolean | OptionsPnpmAuto-detectedLints package.json and pnpm-workspace.yaml when workspace file exists.
componentExtsstring[][]Additional file extensions treated as components (e.g. ['vue']).
isInEditorbooleanAuto-detectedDisables disruptive auto-fixes when running inside an IDE.
autoRenamePluginsbooleantrueRenames plugin prefixes (import-lite → import, vitest → test, yml → yaml).

Auto-Detection Behavior

Several features are automatically enabled based on your project environment unless explicitly set to true or false:

  • TypeScript (typescript): Enabled when typescript or @typescript/native-preview is installed in your dependencies.
  • Vue (vue): Enabled when vue, nuxt, vitepress, or @slidev/cli is installed.
  • pnpm Workspace (pnpm): Enabled when a pnpm-workspace.yaml file is found in the current or parent directories.
  • Editor Mode (isInEditor): Enabled when running inside VS Code, JetBrains IDEs, Vim/Neovim, or Zed (and disabled automatically during CI, Git hooks, or lint-staged).

Passing Global Flat Config Properties

In addition to preset options, the first argument of eienjs() accepts top-level flat config properties (name, languageOptions, linterOptions, processor, plugins, rules, settings) to apply globally:

eslint.config.js
import { eienjs } from '@eienjs/eslint-config';

export default eienjs({
  adonisjs: true,
  rules: {
    'no-console': 'warn',
  },
});
Do not pass files in the first argument of eienjs(), as the first argument is reserved for global configuration. Attempting to pass files throws an error. Instead, chain .append() or pass additional flat config objects—see Composer & Overrides.