Root entry
| API | Signature or type | Defaults and behavior |
|---|---|---|
vueConfig | Config[] | Complete Vue 3 configuration without project overrides |
uniAppConfig | Config[] | Complete UniApp configuration without project overrides |
createBaseConfigs | (options?: ProjectConfigOptions) => Config[] | environment: browser; for framework-neutral projects |
createVueProjectConfigs | (options?: ProjectConfigOptions, ...overrides: Config[]) => Config[] | Vue 3, Vue SFC, and Vue JSX/TSX |
createUniAppProjectConfigs | (options?: ProjectConfigOptions, ...overrides: Config[]) => Config[] | Also handles .nvue, UniApp globals, and manifests |
defineRules | <Rules extends RuleOptions>(rules: Rules) => Rules & Linter.RulesRecord | Returns the object unchanged, adding rule-name and option type checking |
ProjectConfigOptions | { environment?: "browser" | "node" | "universal" } | Application source defaults to the browser environment |
RuleOptions | Generated rule configuration types | Covers current plugin rule names and options |
js
import { vueConfig } from "@fast-china/eslint-config";
import { defineConfig } from "eslint/config";
export default defineConfig([
...vueConfig,
{
name: "project/custom",
rules: {},
},
]);Add project-specific rules to rules: {} as needed; leaving it empty preserves the shared defaults.
defineConfig() is ESLint's official helper. Project configuration appended after vueConfig takes precedence, preserving the shared baseline while providing an explicit customization point.
createBaseConfigs Create
Creates complete framework-neutral JavaScript and TypeScript configuration.
Signature
ts
export const createBaseConfigs = ({ environment = "browser" }: ProjectConfigOptions = {}): Config[];Example
js
import { createBaseConfigs } from "@fast-china/eslint-config";
import { defineConfig } from "eslint/config";
export default defineConfig([
...createBaseConfigs({ environment: "browser" }),
{
name: "project/custom",
files: ["src/**/*.{js,ts,vue}"],
rules: {
"no-console": "warn",
},
},
]);Input
| Input | Type | Required / default | Description |
|---|---|---|---|
options | ProjectConfigOptions | Optional; defaults to {} | Application runtime environment; injects only browser globals by default. |
Returns
| Value | Type | Description |
|---|---|---|
configs | Config[] | Flat Config array usable directly in eslint.config.*. |
createVueProjectConfigs Create
Creates complete Vue 3 configuration for .vue and Vue JSX/TSX without UniApp capabilities.
Signature
ts
export const createVueProjectConfigs = ({ environment = "browser" }: ProjectConfigOptions = {}, ...overrides: Config[]): Config[];Example
js
import { createVueProjectConfigs } from "@fast-china/eslint-config";
import { defineConfig } from "eslint/config";
export default defineConfig([
...createVueProjectConfigs({ environment: "browser" }),
{
name: "project/custom",
files: ["src/**/*.{js,ts,vue}"],
rules: {
"no-console": "warn",
},
},
]);Input
| Input | Type | Required / default | Description |
|---|---|---|---|
options | ProjectConfigOptions | Optional; defaults to {} | Application runtime environment; injects only browser globals by default. |
...overrides | Config[] | Optional; multiple arguments allowed | Project Flat Config overrides appended after built-in configuration. |
Returns
| Value | Type | Description |
|---|---|---|
configs | Config[] | Flat Config array ready for a Vue 3 project. |
createUniAppProjectConfigs Create
Creates complete configuration for .vue, .nvue, Vue JSX/TSX, UniApp globals, and manifests.
Signature
ts
export const createUniAppProjectConfigs = ({ environment = "browser" }: ProjectConfigOptions = {}, ...overrides: Config[]): Config[];Example
js
import { createUniAppProjectConfigs } from "@fast-china/eslint-config";
import { defineConfig } from "eslint/config";
export default defineConfig([
...createUniAppProjectConfigs({ environment: "browser" }),
{
name: "project/custom",
files: ["src/**/*.{js,ts,vue}"],
rules: {
"no-console": "warn",
},
},
]);Input
| Input | Type | Required / default | Description |
|---|---|---|---|
options | ProjectConfigOptions | Optional; defaults to {} | Application runtime environment; injects only browser globals by default. |
...overrides | Config[] | Optional; multiple arguments allowed | Project Flat Config overrides appended after built-in configuration. |
Returns
| Value | Type | Description |
|---|---|---|
configs | Config[] | Flat Config array ready for a UniApp project. |
