Socket
Socket
Sign inDemoInstall

@sxzz/eslint-config

Package Overview
Dependencies
271
Maintainers
1
Versions
87
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @sxzz/eslint-config

ESLint config for @sxzz.


Version published
Weekly downloads
1.9K
increased by43.61%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

@sxzz/eslint-config npm

Flat ESLint config for JavaScript, TypeScript, Vue 2, Vue 3, Prettier.

Legacy Version

Features

  • Format with Prettier.
  • Designed to work with TypeScript, Vue 2 and 3 out-of-box.
  • Support JSON(5), YAML, Markdown...
  • Sort imports, package.json, tsconfig.json...
  • ESLint Flat config, compose easily!
  • Reasonable defaults, best practices, only one-line of config

Install

npm i -D @sxzz/eslint-config

Require Node.js >= 18.18, and ESLint >= 8.56.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.

VSCode

{
  "eslint.experimental.useFlatConfig": true,
}

Comparing to @antfu/eslint-config

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

  • Use Prettier instead of ESLint Stylistic.
  • Support both Vue 2 and Vue 3.
  • Support Vue Reactivity Transform.
  • More stricter rules.

Sponsors

License

MIT License © 2021-PRESENT 三咲智子

FAQs

Last updated on 04 Mar 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc