Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sxzz/eslint-config
A opinionated ESLint config preset.
https://github.com/sxzz/eslint-config
config eslint eslint-config eslint-flat-config flat sxzz
Last synced: 5 days ago
JSON representation
A opinionated ESLint config preset.
- Host: GitHub
- URL: https://github.com/sxzz/eslint-config
- Owner: sxzz
- License: mit
- Created: 2023-02-28T13:54:32.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T16:32:48.000Z (about 1 month ago)
- Last Synced: 2024-10-29T17:23:00.543Z (about 1 month ago)
- Topics: config, eslint, eslint-config, eslint-flat-config, flat, sxzz
- Language: TypeScript
- Homepage: https://eslint-config.sxzz.moe
- Size: 896 KB
- Stars: 156
- Watchers: 1
- Forks: 12
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome - config
README
# @sxzz/eslint-config [![npm](https://img.shields.io/npm/v/@sxzz/eslint-config.svg)](https://npmjs.com/package/@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](https://eslint.org/docs/latest/use/configure/configuration-files-new), 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
```bash
npm i -D @sxzz/eslint-config
```Require Node.js >= 18.18, and ESLint >= 9.5.0.
## Usage
```js
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
```js
// 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](./src/presets.ts) for more details.
## Comparing to [`@antfu/eslint-config`](https://github.com/antfu/eslint-config)
Most of the rules are the same, but there are some differences:
- Use [Prettier](https://prettier.io/) instead of [ESLint Stylistic](https://github.com/eslint-stylistic/eslint-stylistic).
- Support both Vue 2 and Vue 3.
- Support Vue Reactivity Transform.
- More stricter rules.## Sponsors
## License
[MIT](./LICENSE) License © 2021-PRESENT [三咲智子](https://github.com/sxzz)