Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: autofix.ci

on:
pull_request:
push:
branches: [ "main" ]

permissions:
contents: write

jobs:
autofix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'

- run: npm ci

- name: Run fixes
run: |
# --ignore-unknown stops it from crashing on things like favicon.svg
npx prettier --write "src/**/*.{ts,tsx,js,jsx,json,css,md}" "public/**/*" "*.{js,ts,json,md}" --ignore-unknown

# ESLint targets your source code logic
npx eslint src --ext .ts,.tsx --fix
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

ESLint v9 --ext flag removed migration guide

💡 Result:

Why --ext “disappeared” in ESLint v9

With flat config (eslint.config.js, default in v9), ESLint originally rejected --ext (you’d see “Invalid option '--ext' … you’re using eslint.config.js”). (github.com)
The intended replacement was to use files globs in your flat config. (npmjs.com)


Migration (recommended): replace --ext with files in eslint.config.js

If you previously had something like:

npx eslint --ext .ts,.tsx .

Remove --ext and add a “selector” object near the top of eslint.config.js:

// eslint.config.js
export default [
  { files: ["**/*.ts", "**/*.tsx"] },

  // ...the rest of your config objects
];

Then run:

npx eslint .

This is the approach documented by the ESLint config migrator (@eslint/migrate-config). (npmjs.com)


If you must use --ext from the CLI (no config file)

ESLint v9.21.0 reintroduced --ext specifically to support linting arbitrary extensions without a config file, shown together with --no-config-lookup. (eslint.org)

Example:

npx eslint --no-config-lookup --rule '{"no-unused-vars":"error"}' --ext '.jsx'

(eslint.org)

Citations:


🏁 Script executed:

# Check ESLint version in the repository
find . -type f \( -name "package.json" -o -name "package-lock.json" -o -name "yarn.lock" \) -not -path "*/node_modules/*" | head -5

Repository: BeyteFlow/ReadmeGenAI

Length of output: 99


🏁 Script executed:

# Check for ESLint configuration files
find . -type f \( -name ".eslintrc*" -o -name "eslint.config.*" \) | head -10

Repository: BeyteFlow/ReadmeGenAI

Length of output: 84


🏁 Script executed:

cat package.json | grep -A 2 -B 2 "eslint"

Repository: BeyteFlow/ReadmeGenAI

Length of output: 341


🏁 Script executed:

cat eslint.config.mjs

Repository: BeyteFlow/ReadmeGenAI

Length of output: 529


Use glob pattern instead of deprecated --ext flag.

ESLint v9 initially removed the --ext flag with flat config support. While the flag was reintroduced in v9.21.0, since the version is unpinned (^9), using an explicit glob pattern ensures compatibility across all v9 versions and is the recommended approach with flat config.

Proposed fix
-          npx eslint src --ext .ts,.tsx --fix
+          npx eslint "src/**/*.{ts,tsx}" --fix
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
npx eslint src --ext .ts,.tsx --fix
npx eslint "src/**/*.{ts,tsx}" --fix
🤖 Prompt for AI Agents
In @.github/workflows/autofix.yml at line 30, Replace the deprecated --ext usage
in the CI workflow command `npx eslint src --ext .ts,.tsx --fix` with an
explicit glob pattern so ESLint runs across TypeScript files on all v9 versions;
update the command to target files via a glob like src/**/*.{ts,tsx} (retain the
--fix flag) to ensure compatibility with flat config and unpinned ESLint
versions.


- uses: autofix-ci/action@v1
if: always()
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.github/
node_modules/
dist/
build/
*.lock
70 changes: 0 additions & 70 deletions __tests__/apiGenerate.test.ts

This file was deleted.

Loading
Loading