A opinionated ESLint config preset for JavaScript, TypeScript, Vue 2 or Vue 3, and Prettier.
package.json
, tsconfig.json
...dist
, node_modules
, coverage
, and files in .gitignore
.npm i -D @sarast/eslint-config
Require Node.js >= 18.18, and ESLint >= 9.5.0.
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
},
);
// 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.
@antfu/eslint-config
Most of the rules are the same, but there are some differences:
This eslint config is inspired by:
@sxzz/eslint-config
, created by Kevin Deng 三咲智子
@antfu/eslint-config
, created by Anthony Fu
MIT License © 2024-PRESENT Sardor Astanov