@dhzh/eslint-config
v2.0.4
Published
tinywaves's ESLint config
Readme
@dhzh/eslint-config
An ESLint flat config preset for TypeScript-first projects with built-in support for React, Vue, JSON, YAML, TOML, Tailwind CSS, UnoCSS, and formatting rules.
Included Configs
| Config | Source | Powered by |
|---|---|---|
| React | src/configs/react.ts | @eslint-react/eslint-plugin eslint-plugin-react-hooks eslint-plugin-react-refresh eslint-plugin-react-compiler eslint-plugin-react-google-translate |
| Vue | src/configs/vue.ts | @eslint/js typescript-eslint eslint-plugin-vue eslint-merge-processors eslint-processor-vue-blocks |
| Stylistic | src/configs/stylistic.ts | @stylistic/eslint-plugin eslint-plugin-antfu |
| TypeScript | src/configs/typescript.ts | typescript-eslint |
| JavaScript | src/configs/javascript.ts | @eslint/js eslint-plugin-antfu |
| Node.js | src/configs/node.ts | eslint-plugin-n |
| JSON and package.json | src/configs/json.ts | eslint-plugin-jsonc eslint-plugin-package-json |
| Unicorn | src/configs/unicorn.ts | eslint-plugin-unicorn |
| Imports | src/configs/imports.ts | eslint-plugin-import-x eslint-plugin-unused-imports eslint-plugin-simple-import-sort eslint-plugin-antfu |
| Format | src/configs/format.ts | eslint-plugin-format @prettier/plugin-xml |
| Tailwind CSS | src/configs/tailwindcss.ts | eslint-plugin-tailwindcss |
| UnoCSS | src/configs/unocss.ts | @unocss/eslint-config |
| YAML | src/configs/yml.ts | eslint-plugin-yml |
| TOML | src/configs/toml.ts | eslint-plugin-toml toml-eslint-parser |
| RegExp | src/configs/regexp.ts | eslint-plugin-regexp |
| ESLint comments | src/configs/eslint-comments.ts | @eslint-community/eslint-plugin-eslint-comments |
| Testing | Planned | eslint-plugin-vitest eslint-plugin-jest eslint-plugin-no-only-tests |
| Markdown | Planned | @eslint/markdown |
| JSDoc | Planned | eslint-plugin-jsdoc |
| Ignores and language options | src/configs/ignores.ts, src/configs/language-options.ts | Built-in config composition |
Requirements
- Node.js
^22.13.0 || >=24 - ESLint
^10.2.1 - ESM-only package consumption
Quick Start
CLI Wizard
Use the CLI to create or migrate your flat config setup:
pnpm dlx @dhzh/eslint-config@latestThe wizard updates:
package.jsoneslint.config.*.vscode/settings.json.npmignore
Manual Setup
Install the package and ESLint:
pnpm i -D eslint @dhzh/eslint-configThen create eslint.config.mjs:
// eslint.config.mjs
import { defineConfig } from '@dhzh/eslint-config';
export default defineConfig();Customization
defineConfig() accepts configs, ignorePatterns, and sourceType.
// eslint.config.mjs
import { defineConfig } from '@dhzh/eslint-config';
export default defineConfig({
ignorePatterns: ['dist', 'coverage'],
configs: {
json: {
packageJsonRequireType: false,
},
yml: {
quotes: 'double',
},
imports: {
closeOrder: false,
},
},
});For the full option surface, check src/types/index.ts and the config implementations under src/configs.
Rows marked as Planned are not wired into the current published config yet.
License
MIT License © 2022 Lyle Zheng
