Home

Awesome

@sxzz/eslint-config npm

A opinionated ESLint config preset for JavaScript, TypeScript, Vue 2 or Vue 3, and Prettier.

Features

Install

npm i -D @sxzz/eslint-config

Require Node.js >= 18.18, and ESLint >= 9.5.0.

Usage

import { sxzz } from '@sxzz/eslint-config'
export default sxzz(
  [
    /* your custom config */
  ],
  // Features: it'll detect installed dependency and enable necessary features automatically
  {
    prettier: true,
    markdown: true,
    vue: true, // auto detection
    unocss: false, // auto detection
  },
)

Presets

// eslint.config.js
import {
  presetJavaScript, // Ignore common files and include javascript support
  presetJsonc, // Includes basic json(c) file support and sorting json keys
  presetLangsExtensions, // Includes markdown, yaml + `presetJsonc` support
  presetBasic, // Includes `presetJavaScript` and typescript support

  // Includes
  // - `presetBasic` (JS+TS) support
  // - `presetLangsExtensions` (markdown, yaml, jsonc) support
  // - Vue support
  // - UnoCSS support (`uno.config.ts` is required)
  // - Prettier support
  presetAll,
} from '@sxzz/eslint-config'

export default presetAll

See preset.ts for more details.

Comparing to @antfu/eslint-config

Most of the rules are the same, but there are some differences:

Sponsors

<p align="center"> <a href="https://cdn.jsdelivr.net/gh/sxzz/sponsors/sponsors.svg"> <img src='https://cdn.jsdelivr.net/gh/sxzz/sponsors/sponsors.svg'/> </a> </p>

License

MIT License © 2021-PRESENT 三咲智子