1.3.0 • Published 9 months ago
@sarast/eslint-config v1.3.0
@sarast/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 @sarast/eslint-config
Require Node.js >= 18.18, and ESLint >= 9.5.0.
Usage
import { sarast } from '@sarast/eslint-config';
export default sarast(
[
/* 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
// - Prettier support
// - UnoCSS support (`uno.config.ts` is required)
presetAll,
} from '@sarast/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:
- Use Prettier instead of ESLint Stylistic.
- Support both Vue 2 and Vue 3.
- More stricter rules.
Credit
This eslint config is inspired by:
@sxzz/eslint-config
, created by Kevin Deng 三咲智子@antfu/eslint-config
, created by Anthony Fu- Vite, created by Evan You and Vite community
License
MIT License © 2024-PRESENT Sardor Astanov
1.3.0
9 months ago
1.2.2
9 months ago
1.2.0
9 months ago
1.2.1
9 months ago
1.1.9
10 months ago
1.1.8
10 months ago
1.1.7
10 months ago
1.1.6
10 months ago
1.1.5
10 months ago
1.1.4
10 months ago
1.1.3
10 months ago
1.1.2
10 months ago
1.1.1
11 months ago
1.1.0
11 months ago
1.0.0
11 months ago
0.0.13
1 year ago
0.0.14
1 year ago
0.0.15
1 year ago
0.0.16
12 months ago
0.0.12
1 year ago
0.0.11
1 year ago
0.0.10
1 year ago
0.0.9
1 year ago
0.0.8
1 year ago
0.0.7
2 years ago
0.0.6
2 years ago
0.0.5
2 years ago
0.0.4
2 years ago
0.0.3
2 years ago