Some checks failed
CI / Test (ubuntu-latest) (push) Has been skipped
CI / Lint (ubuntu-latest) (push) Has been skipped
CI / Check (ubuntu-latest) (push) Has been skipped
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Has been skipped
Deploy Website on push / Deploy Push Playground Ftp (push) Has been skipped
Deploy Website on push / Deploy Push Docs Ftp (push) Has been skipped
Deploy Website on push / Deploy Push Antd Ftp (push) Has been skipped
Deploy Website on push / Deploy Push Element Ftp (push) Has been skipped
Deploy Website on push / Deploy Push Naive Ftp (push) Has been skipped
Release Drafter / update_release_draft (push) Has been skipped
Deploy Website on push / Rerun on failure (push) Has been skipped
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
45 lines
730 B
TypeScript
45 lines
730 B
TypeScript
import type { Linter } from 'eslint';
|
|
|
|
import {
|
|
ignores,
|
|
javascript,
|
|
jsonc,
|
|
node,
|
|
perfectionist,
|
|
pnpm,
|
|
typescript,
|
|
vue,
|
|
yaml,
|
|
} from './configs';
|
|
import { customConfig } from './custom-config';
|
|
|
|
type FlatConfig = Linter.Config;
|
|
|
|
type FlatConfigPromise =
|
|
| FlatConfig
|
|
| FlatConfig[]
|
|
| Promise<FlatConfig>
|
|
| Promise<FlatConfig[]>;
|
|
|
|
async function defineConfig(config: FlatConfig[] = []) {
|
|
const configs: FlatConfigPromise[] = [
|
|
vue(),
|
|
javascript(),
|
|
ignores(),
|
|
typescript(),
|
|
jsonc(),
|
|
node(),
|
|
perfectionist(),
|
|
yaml(),
|
|
pnpm(),
|
|
...customConfig,
|
|
...config,
|
|
];
|
|
|
|
const resolved = await Promise.all(configs);
|
|
|
|
return resolved.flat();
|
|
}
|
|
|
|
export { defineConfig };
|