Skip to content

Root entry

APISignature or typeDefaults and behavior
vueConfigConfig[]Complete Vue 3 configuration without project overrides
uniAppConfigConfig[]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.RulesRecordReturns the object unchanged, adding rule-name and option type checking
ProjectConfigOptions{ environment?: "browser" | "node" | "universal" }Application source defaults to the browser environment
RuleOptionsGenerated rule configuration typesCovers 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

InputTypeRequired / defaultDescription
optionsProjectConfigOptionsOptional; defaults to {}Application runtime environment; injects only browser globals by default.

Returns

ValueTypeDescription
configsConfig[]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

InputTypeRequired / defaultDescription
optionsProjectConfigOptionsOptional; defaults to {}Application runtime environment; injects only browser globals by default.
...overridesConfig[]Optional; multiple arguments allowedProject Flat Config overrides appended after built-in configuration.

Returns

ValueTypeDescription
configsConfig[]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

InputTypeRequired / defaultDescription
optionsProjectConfigOptionsOptional; defaults to {}Application runtime environment; injects only browser globals by default.
...overridesConfig[]Optional; multiple arguments allowedProject Flat Config overrides appended after built-in configuration.

Returns

ValueTypeDescription
configsConfig[]Flat Config array ready for a UniApp project.