Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

⏱️ ci: Cut the ESLint Config Sweep to the Rules That Can Regress (#15890)

Danny Avila6e3295eefbe7
diff --git a/.github/workflows/static-checks.yml b/.github/workflows/static-checks.yml
index 8812e95902..fe3c49e9ab 100644
--- a/.github/workflows/static-checks.yml
+++ b/.github/workflows/static-checks.yml
@@ -812,8 +812,16 @@ jobs:
run: |
run_sweep() {
set +e
+ # Two rules are switched off for the sweep only: `prettier/prettier`
+ # reformats every file (formatting drift is caught per changed file
+ # by the Static checks job and is not a config regression), and
+ # `import/no-cycle` walks the whole import graph from every file
+ # while config/circular-deps.mjs already owns cycle detection.
+ # Together they were ~85% of a full-tree lint.
timeout -k 15 "$ESLINT_SWEEP_BUDGET_SECONDS" \
- node_modules/.bin/eslint --config "$1" api client packages -f json -o "$2"
+ node_modules/.bin/eslint --config "$1" api client packages -f json -o "$2" \
+ --rule 'prettier/prettier: off' \
+ --rule 'import/no-cycle: off'
local status=$?
set -e
# 124 = timeout sent TERM; 137 = it escalated to KILL.
@@ -841,6 +849,13 @@ jobs:
# flat-config files/ignores patterns and plugin imports resolve
# relative to the config's own directory, so a temp-dir copy would
# scope to nothing and the comparison would pass vacuously.
+ # An unchanged config cannot regress: the head sweep above already
+ # proved this workflow still runs it, so a second identical sweep
+ # would only double the job's runtime.
+ if git diff --quiet "$BASE_SHA" HEAD -- eslint.config.mjs; then
+ echo "::notice title=ESLint sweep::eslint.config.mjs is unchanged from base; skipping the regression comparison."
+ exit 0
+ fi
trap 'rm -f eslint.config.base.mjs' EXIT
if ! git show "$BASE_SHA:eslint.config.mjs" > eslint.config.base.mjs 2>/dev/null; then
echo "::notice title=ESLint sweep::No eslint.config.mjs at base ref; skipping regression comparison."
diff --git a/eslint.config.mjs b/eslint.config.mjs
index 02a2e5d3ab..7c7f9d0e70 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -150,7 +150,8 @@ export default [
},
],
'no-console': 'off',
- 'import/no-cycle': 'error',
+ // Import cycles are checked by config/circular-deps.mjs over the bundler graph;
+ // `import/no-cycle` re-walked that graph from every file (80% of a full-tree lint).
'import/no-self-import': 'error',
'import/extensions': 'off',
'no-promise-executor-return': 'off',
@@ -194,9 +195,6 @@ export default [
...globals.node,
},
},
- rules: {
- 'import/no-cycle': 'off',
- },
},
{
files: [
@@ -238,9 +236,7 @@ export default [
})),
{
files: ['**/*.ts', '**/*.tsx'],
- // e2e specs are not part of `client/tsconfig.json`'s program, so typed
- // linting them errors with "file not found in project"; they still get
- // the non-type-checked recommended rules from the block above.
+ // e2e specs keep only the non-type-checked recommended rules from the block above.
ignores: ['packages/**/*', 'client/vite.config.ts', 'e2e/**/*'],
plugins: {
'@typescript-eslint': typescriptEslintEslintPlugin,
@@ -250,9 +246,6 @@ export default [
parser: tsParser,
ecmaVersion: 5,
sourceType: 'script',
- parserOptions: {
- project: './client/tsconfig.json',
- },
},
rules: {
// i18n
@@ -275,8 +268,6 @@ export default [
},
],
'@typescript-eslint/no-explicit-any': 'off',
- '@typescript-eslint/no-unnecessary-condition': 'off',
- '@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
// React
'react/no-unknown-property': 'warn',
@@ -284,7 +275,6 @@ export default [
'react-hooks/exhaustive-deps': 'warn',
// General
'no-constant-binary-expression': 'off',
- 'import/no-cycle': 'off',
},
},
{
@@ -294,9 +284,6 @@ export default [
parser: tsParser,
ecmaVersion: 'latest',
sourceType: 'module',
- parserOptions: {
- project: './packages/data-provider/tsconfig.json',
- },
},
rules: {
'@typescript-eslint/no-unused-vars': [
@@ -333,9 +320,6 @@ export default [
parser: tsParser,
ecmaVersion: 5,
sourceType: 'script',
- parserOptions: {
- project: './config/translations/tsconfig.json',
- },
},
},
{
@@ -343,9 +327,6 @@ export default [
languageOptions: {
ecmaVersion: 5,
sourceType: 'script',
- parserOptions: {
- project: './packages/data-provider/tsconfig.spec.json',
- },
},
},
{
@@ -353,9 +334,6 @@ export default [
languageOptions: {
ecmaVersion: 5,
sourceType: 'script',
- parserOptions: {
- project: './packages/data-provider/tsconfig.spec.json',
- },
},
},
{
@@ -363,9 +341,6 @@ export default [
languageOptions: {
ecmaVersion: 5,
sourceType: 'script',
- parserOptions: {
- project: './packages/api/tsconfig.spec.json',
- },
},
},
{
@@ -375,9 +350,6 @@ export default [
parser: tsParser,
ecmaVersion: 'latest',
sourceType: 'module',
- parserOptions: {
- project: './packages/data-schemas/tsconfig.json',
- },
},
rules: {
'@typescript-eslint/no-unused-vars': [