初始化

This commit is contained in:
2026-02-22 18:56:10 +08:00
commit 26677972a6
3112 changed files with 255972 additions and 0 deletions

View File

@@ -0,0 +1,156 @@
import type { Linter } from 'eslint';
const restrictedImportIgnores = [
'**/vite.config.mts',
'**/tailwind.config.mjs',
'**/postcss.config.mjs',
];
const customConfig: Linter.Config[] = [
// shadcn-ui 内部组件是自动生成的,不做太多限制
{
files: ['packages/@core/ui-kit/shadcn-ui/**/**'],
rules: {
'vue/require-default-prop': 'off',
},
},
{
files: [
'app/**',
'packages/effects/**/**',
'packages/utils/**/**',
'packages/types/**/**',
'packages/locales/**/**',
],
ignores: restrictedImportIgnores,
rules: {
'perfectionist/sort-interfaces': 'off',
'perfectionist/sort-objects': 'off',
},
},
{
files: ['**/**.vue'],
ignores: restrictedImportIgnores,
rules: {
'perfectionist/sort-objects': 'off',
},
},
{
// apps内部的一些基础规则
files: ['app/**'],
ignores: restrictedImportIgnores,
rules: {
'no-restricted-imports': [
'error',
{
patterns: [
{
group: ['#/api/*'],
message:
'The #/api package cannot be imported, please use the @core package itself',
},
{
group: ['#/layouts/*'],
message:
'The #/layouts package cannot be imported, please use the @core package itself',
},
{
group: ['#/locales/*'],
message:
'The #/locales package cannot be imported, please use the @core package itself',
},
{
group: ['#/stores/*'],
message:
'The #/stores package cannot be imported, please use the @core package itself',
},
],
},
],
'perfectionist/sort-interfaces': 'off',
},
},
{
// @core内部组件不能引入@easyflow/* 里面的包
files: ['packages/@core/**/**'],
ignores: restrictedImportIgnores,
rules: {
'no-restricted-imports': [
'error',
{
patterns: [
{
group: ['@easyflow/*'],
message:
'The @core package cannot import the @easyflow package, please use the @core package itself',
},
],
},
],
},
},
{
// @core/shared内部组件不能引入@easyflow/* 或者 @easyflow-core/* 里面的包
files: ['packages/@core/base/**/**'],
ignores: restrictedImportIgnores,
rules: {
'no-restricted-imports': [
'error',
{
patterns: [
{
group: ['@easyflow/*', '@easyflow-core/*'],
message:
'The @easyflow-core/shared package cannot import the @easyflow package, please use the @core/shared package itself',
},
],
},
],
},
},
{
// 不能引入@easyflow/*里面的包
files: [
'packages/types/**/**',
'packages/utils/**/**',
'packages/icons/**/**',
'packages/constants/**/**',
'packages/styles/**/**',
'packages/stores/**/**',
'packages/preferences/**/**',
'packages/locales/**/**',
],
ignores: restrictedImportIgnores,
rules: {
'no-restricted-imports': [
'error',
{
patterns: [
{
group: ['@easyflow/*'],
message:
'The @easyflow package cannot be imported, please use the @core package itself',
},
],
},
],
},
},
{
files: ['**/**/playwright.config.ts'],
rules: {
'n/prefer-global/buffer': 'off',
'n/prefer-global/process': 'off',
'no-console': 'off',
},
},
{
files: ['internal/**/**', 'scripts/**/**'],
rules: {
'no-console': 'off',
},
},
];
export { customConfig };