简体中文 | English
Typed ESLint Flat Config for Vue 3, uni-app, TypeScript and Node.js, with optional framework integrations.
Documentation · Official website
- ESLint 10 with native Flat Config only.
- Separate complete configurations for Vue 3 and UniApp; plain Vue projects do not receive UniApp globals,
.nvueparsing, or manifest behavior. - TypeScript uses
recommendedTypeCheckedand Project Service without the complete strict or stylistic presets. - Exported
.ts,.mts, and.ctsboundaries are treated as SDK public APIs;.tsxretains full type safety and normal component return inference. - SDKs and applications share one JavaScript, TypeScript, Import, and RegExp policy.
package.jsonandtsconfig*.jsonsorting is enabled by default; React, Angular, Markdown, and Lodash compose explicitly from./configs.- Schema-generated
RuleOptionsprovides precise rule-name and option completion.
- Node.js
^22.18.0or^24.18.0 - ESLint
^10.0.0 - TypeScript
^6.0.0
pnpm add -D eslint typescript @fast-china/eslint-configCreate eslint.config.mjs in the Vue 3 project:
import { vueConfig } from "@fast-china/eslint-config";
import { defineConfig } from "eslint/config";
export default defineConfig([
...vueConfig,
{
name: "project/custom",
rules: {},
},
]);pnpm exec eslint .Type-aware source files must belong to the project tsconfig. The Vue configuration does not include uni-app capabilities.
Use the independent uni-app entry rather than stacking both complete configurations:
import { uniAppConfig } from "@fast-china/eslint-config";
import { defineConfig } from "eslint/config";
export default defineConfig([
...uniAppConfig,
{
name: "project/custom",
rules: {},
},
]);For framework-independent Node.js projects:
import { createBaseConfigs } from "@fast-china/eslint-config";
export default createBaseConfigs({ environment: "node" });Append project configuration after the shared preset; leave rules: {} empty until project-specific rules are needed. Use the configuration factories to customize the runtime environment. Fast repositories maintaining local rule copies continue following their own AGENTS.md synchronization policy.
@fast-china/eslint-config: named exports for both complete configurations, the project factories,defineRules,ProjectConfigOptions, andRuleOptions; no default export or legacy aliases are provided.@fast-china/eslint-config/configs: framework and optional feature fragments.@fast-china/eslint-config/constants: file globs and UniApp globals.@fast-china/eslint-config/rules: typed raw rule records.
Prettier does not run as an ESLint rule. The defaults only load eslint-config-prettier to disable conflicting rules; projects install and run Prettier separately.
Each rule-reference category lists repository-explicit rules before third-party preset rules, and every rule includes direct incorrect and correct code examples.
pnpm install --frozen-lockfile
pnpm typegen
pnpm checkContributing · Security policy
Copyright © 2018-Now 小方. This project uses Apache License 2.0. Use, modification, distribution and commercial use are permitted subject to its terms.
When redistributing, provide the license, mark modified files and preserve applicable copyright, attribution and supplied NOTICE information as required. This summary does not replace the license or impose additional UI attribution.
Users are responsible for the legal compliance and authorization of their own modifications, deployment, data processing and operations. This reminder is not an additional license condition.
Except as required by applicable law or agreed in writing, the software is provided on an "AS IS" basis. Sections 7 and 8 govern warranty disclaimers and liability limits. Providing the project does not endorse downstream activities or assume users' contractual commitments. This statement does not exclude liability that cannot lawfully be excluded.
