Files
lobe-chat/eslint.config.mjs
T
Innei baf0b56f64 🔧 ci: optimize sync-main-to-canary to merge directly when no conflicts (#12306)
## Summary
- Optimize the main-to-canary sync workflow to directly merge and push
when there are no conflicts, avoiding unnecessary PR creation
- When merge conflicts exist, fall back to creating a PR for manual
resolution
- Add duplicate PR detection to prevent multiple PRs on the same day

## Test plan
- [ ] Push to main with no conflicts on canary → should auto-merge
without PR
- [ ] Push to main with conflicts on canary → should create PR
- [ ] Trigger workflow twice on same day with conflicts → should not
create duplicate PRs

## Summary by Sourcery

CI:
- Update the sync-main-to-canary workflow to merge main into canary
directly on no-conflict updates, only creating a PR when merge conflicts
occur and avoiding duplicate PRs for the same sync date.
2026-02-13 17:39:19 +08:00

96 lines
1.9 KiB
JavaScript

import { fileURLToPath } from 'node:url';
import { eslint } from '@lobehub/lint';
import { flat as mdxFlat } from 'eslint-plugin-mdx';
const tsconfigRootDir = fileURLToPath(new URL('.', import.meta.url));
export default eslint(
{
ignores: [
// dependencies
'node_modules',
// ci
'coverage',
'.coverage',
// test
'jest*',
'*.test.ts',
'*.test.tsx',
// umi
'.umi',
'.umi-production',
'.umi-test',
'.dumi/tmp*',
// production
'dist',
'es',
'lib',
'logs',
// misc
'.next',
// temporary directories
'tmp',
'temp',
'.temp',
'.local',
'docs/.local',
// cache directories
'.cache',
// AI coding tools directories
'.claude',
'.serena',
],
next: true,
react: 'next',
},
{
languageOptions: {
parserOptions: {
tsconfigRootDir,
},
},
},
// Global rule overrides
{
rules: {
'@next/next/no-img-element': 0,
'@typescript-eslint/no-use-before-define': 0,
'@typescript-eslint/no-useless-constructor': 0,
'no-extra-boolean-cast': 0,
'react/no-unknown-property': 0,
'regexp/match-any': 0,
'unicorn/better-regex': 0,
},
},
// MDX files
{
...mdxFlat,
files: ['**/*.mdx'],
rules: {
...mdxFlat.rules,
'@typescript-eslint/no-unused-vars': 1,
'no-undef': 0,
'react/jsx-no-undef': 0,
'react/no-unescaped-entities': 0,
},
},
// Store/image and types/generation - disable sorting
{
files: ['src/store/image/**/*', 'src/types/generation/**/*'],
rules: {
'perfectionist/sort-interfaces': 0,
'perfectionist/sort-object-types': 0,
'perfectionist/sort-objects': 0,
},
},
// CLI scripts
{
files: ['scripts/**/*'],
rules: {
'unicorn/no-process-exit': 0,
'unicorn/prefer-top-level-await': 0,
},
},
);