• Stars
    star
    148
  • Rank 249,021 (Top 5 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 1 year ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A opinionated ESLint config preset.

@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,
}

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 三咲智子

More Repositories

1

vue-macros

Explore and extend more macros and syntax sugar to Vue.
TypeScript
1,084
star
2

tsdown

An even faster bundler powered by Rolldown.
TypeScript
302
star
3

vue-functional-ref

Functional-style refs for Vue.
TypeScript
186
star
4

element-plus-best-practices

Element Plus Best Practices 最佳实践
TypeScript
176
star
5

stale-dep

Check if your `node_modules` is stale.
TypeScript
149
star
6

ast-explorer

AST Explorer: For most popular front-end languages and parsers.
TypeScript
120
star
7

unplugin-vue

✨ Transform Vue 3 SFC to JavaScript. Supports Vite, esbuild, Rollup and Webpack.
TypeScript
91
star
8

vue-simple-props

Remove emits, slots, and attrs concepts in Vue.
TypeScript
80
star
9

free-hls-live

Free live streaming with Free-HLS (Free HLS 直播姬)
TypeScript
69
star
10

telegram-bot-starter

A starter template for Telegram bots on Serverless, with Vercel, Netlify, Cloudflare, and more support.
TypeScript
53
star
11

unplugin-macros

Macros plugin for bundlers.
TypeScript
44
star
12

ast-kit

A toolkit for easy Babel AST generation and manipulation.
TypeScript
43
star
13

element-plus-next

Element Plus 3. Exploring monorepo.
Vue
41
star
14

unplugin-ast

Manipulate the AST to transform your code.
TypeScript
41
star
15

unws

Unified WebSocket API for Node.js, Bun and modern browsers.
JavaScript
33
star
16

eslint-config-legacy

A ESLint config preset.
JavaScript
30
star
17

unplugin-glob

Imports or exports files using glob match for ES Module.
TypeScript
29
star
18

github-block-tool

TypeScript
28
star
19

vue-vapor-starter

Vue Vapor demo
Vue
28
star
20

vue-rsbuild

Rsbuild + Vue SFC demo
Vue
27
star
21

awesome

Strongly opinionated list of awesome things.
Shell
22
star
22

free-hls.js

一个免费的 HLS 上传工具
JavaScript
19
star
23

monorepo-starter

My minimal monorepo starter.
TypeScript
18
star
24

vite-hyper-config

Use Vite to run Vite's own config.
TypeScript
18
star
25

awesome-element-plus

😎 Awesome lists about Element Plus libraries, templates and resources.
18
star
26

create

Command-line for creating projects from templates.
TypeScript
17
star
27

magic-string-ast

magic-string with Babel AST shortcut.
TypeScript
16
star
28

monoman

Manage monorepo common files.
TypeScript
15
star
29

unplugin-jsx-string

Converts JSX to HTML strings at compile time.
TypeScript
15
star
30

unplugin-vue-jsx

Vue JSX plugin for both Vue 2 and 3. Supports Rollup, Vite, esbuild and Webpack.
TypeScript
13
star
31

ast-walker-scope

Traverse Babel AST with scope information.
TypeScript
12
star
32

vue5

Put Vue 2 and Vue 3 into one project.
TypeScript
11
star
33

sponsors

💰 Sponsors of @sxzz
TypeScript
11
star
34

unplugin-starter

Starter template for unplugin.
TypeScript
10
star
35

sxzz

@sxzz 's GitHub profile.
Shell
9
star
36

config

The configuration files for @sxzz.
Shell
9
star
37

jsr-api

An alternative API service of https://jsr.io
TypeScript
9
star
38

prettier-config

Prettier preset of @sxzz.
JavaScript
7
star
39

eip1193-types

TypeScript definitions for EIP-1193 and MetaMask.
TypeScript
7
star
40

element-plus-solidjs

TypeScript
7
star
41

talks

Slides & code for @sxzz talks
Vue
6
star
42

esbuild-plugin-transform

Pipe transformation plugins for esbuild.
TypeScript
6
star
43

element-plus-react

Element Plus for React
TypeScript
6
star
44

birdpass

Get your Birdpass!
Vue
5
star
45

ts-lib-starter

My minimal TypeScript library starter.
TypeScript
5
star
46

jike-plus

A Browser Extension for Jike
TypeScript
5
star
47

swc-plugin-vue2-jsx

Vue 2 JSX plugin of SWC. (Archived)
TypeScript
5
star
48

bound-book-bot

TypeScript
4
star
49

repo-master

A GitHub CLI for PRs, issues, and reproduction.
TypeScript
4
star
50

uncomp

Universal Component
TypeScript
4
star
51

jike-tool

即刻工具箱
TypeScript
4
star
52

unplugin-combine

Unified plugin that combines other plugins into one plugin.
TypeScript
3
star
53

lesson-schedule

课程表 (Made when I was 17)
JavaScript
3
star
54

ancient-blog

👦 A blog I made when I was 15.
JavaScript
3
star
55

kg-downloader

全民 K 歌下载器
TypeScript
3
star
56

nuxt-page-finish

TypeScript
3
star
57

nuxt-functional-ref

Vue
3
star
58

babel-vue-resolve-types

TypeScript
3
star
59

hmr-demo

TypeScript
3
star
60

vue-jsx-playground

A playground for Vue JSX.
Vue
3
star
61

unplugin-lightningcss

TypeScript
2
star
62

blog-vue

👦 My first Vue app when I was 16.
Vue
2
star
63

unplugin-vue-named-export

Named export for Vue SFC.
TypeScript
2
star
64

articles

2
star
65

element-plus-tauri-starter

Starter template for Tauri and Element Plus.
TypeScript
2
star
66

rspack-enforce-issue

JavaScript
2
star
67

redirects

Redirects for my domains.
TypeScript
2
star
68

sxzz.github.io-old

JavaScript
2
star
69

chrome-extension-template

JavaScript
2
star
70

simple-trojan-rust

Rust
2
star
71

vitest-glob-test

TypeScript
1
star
72

sxzz.github.io

1
star
73

volar-tsconfig-order

TypeScript
1
star
74

fuck-jike-image

TypeScript
1
star
75

contribute

Contribution Guide
1
star
76

workshop

1
star
77

optima-jsx

TypeScript
1
star
78

tsx-vscode-ext

JavaScript
1
star
79

renovate-config

Renovate Config
1
star
80

eslint-plugin-sxzz

A collection of ESLint rules.
TypeScript
1
star