chore: init project
This commit is contained in:
56
internal/lint-configs/eslint-config/src/index.ts
Normal file
56
internal/lint-configs/eslint-config/src/index.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
import type { Linter } from 'eslint';
|
||||
|
||||
import {
|
||||
command,
|
||||
comments,
|
||||
ignores,
|
||||
importPluginConfig,
|
||||
javascript,
|
||||
jsdoc,
|
||||
jsonc,
|
||||
node,
|
||||
perfectionist,
|
||||
prettier,
|
||||
regexp,
|
||||
test,
|
||||
typescript,
|
||||
unicorn,
|
||||
vue,
|
||||
} from './configs';
|
||||
import { customConfig } from './custom-config';
|
||||
|
||||
type FlatConfig = Linter.FlatConfig;
|
||||
|
||||
type FlatConfigPromise =
|
||||
| FlatConfig
|
||||
| FlatConfig[]
|
||||
| Promise<FlatConfig>
|
||||
| Promise<FlatConfig[]>;
|
||||
|
||||
async function defineConfig(config: FlatConfig[] = []) {
|
||||
const configs: FlatConfigPromise[] = [
|
||||
vue(),
|
||||
javascript(),
|
||||
ignores(),
|
||||
prettier(),
|
||||
typescript(),
|
||||
jsonc(),
|
||||
importPluginConfig(),
|
||||
node(),
|
||||
perfectionist(),
|
||||
comments(),
|
||||
jsdoc(),
|
||||
unicorn(),
|
||||
test(),
|
||||
regexp(),
|
||||
command(),
|
||||
...customConfig,
|
||||
...config,
|
||||
];
|
||||
|
||||
const resolved = await Promise.all(configs);
|
||||
|
||||
return resolved.flat();
|
||||
}
|
||||
|
||||
export { defineConfig };
|
Reference in New Issue
Block a user