Since v1.39.0 (PR #323), configs with nested array file patterns (AND globs) are skipped by processConfigFiles. While this fixed the invalid config output from #322, it silently drops all rules from any ESLint config that uses extends inside a config object with files because ESLint's defineConfig turns that combination into AND-pattern nested arrays.
This is a very common pattern in ESLint flat configs:
import { defineConfig } from 'eslint/config'
import tseslint from 'typescript-eslint'
import react from 'eslint-plugin-react'
export default defineConfig([
// Rules from tseslint are silently dropped by migrate
{ files: ['**/*.ts'], extends: [tseslint.configs.recommended] },
// Rules from react are silently dropped by migrate
{ files: ['**/*.{jsx,tsx}'], extends: [react.configs.flat.recommended] },
])
ESLint's defineConfig resolves extends by creating AND-pattern file arrays (e.g., [["**/*.ts", "**/*.{js,ts}"]]). processConfigFiles filters these out, returning an empty array, and buildConfig then skips the entire config via if (validFiles.length === 0) continue.
Reproduction:
// eslint.config.js
import { defineConfig } from 'eslint/config'
import tseslint from 'typescript-eslint'
export default defineConfig([
{
files: ['**/*.ts'],
extends: [tseslint.configs.recommended],
rules: { '@typescript-eslint/no-explicit-any': 'error' },
},
])
Run npx @oxlint/migrate --type-aware eslint.config.js and you'll see that the typescript-eslint rules will be missing from the output.
Since
v1.39.0(PR #323), configs with nested array file patterns (AND globs) are skipped byprocessConfigFiles. While this fixed the invalid config output from #322, it silently drops all rules from any ESLint config that usesextendsinside a config object withfilesbecause ESLint'sdefineConfigturns that combination into AND-pattern nested arrays.This is a very common pattern in ESLint flat configs:
ESLint's
defineConfigresolvesextendsby creating AND-pattern file arrays (e.g.,[["**/*.ts", "**/*.{js,ts}"]]).processConfigFilesfilters these out, returning an empty array, andbuildConfigthen skips the entire config viaif (validFiles.length === 0) continue.Reproduction:
Run
npx @oxlint/migrate --type-aware eslint.config.jsand you'll see that thetypescript-eslintrules will be missing from the output.