@sxzz/eslint-config
A opinionated ESLint config preset for JavaScript, TypeScript, Vue 2 or Vue 3,
and Prettier.
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!
- Ignores common files like
dist
, node_modules
, coverage
, and files in .gitignore
. - Reasonable defaults, best practices, only one-line of config
- Reasonable strict, but with better code quality.
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(
[
],
{
prettier: true,
markdown: true,
vue: true,
unocss: false,
},
)
Presets
import {
presetJavaScript,
presetJsonc,
presetLangsExtensions,
presetBasic,
presetAll,
} from '@sxzz/eslint-config'
export default presetAll
See preset.ts for more details.
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.
License
MIT License © 2021-PRESENT 三咲智子