Skip to content

Conversation

Copy link

Copilot AI commented Nov 8, 2025

Remove @eslint/compat dependency ✅

Plan:

  • Explore repository and understand current usage of @eslint/compat
  • Verify that all plugins now support flat config natively
  • Remove fixupPluginRules from configs/javascript.js
  • Remove fixupPluginRules from configs/typescript.js
  • Remove fixupConfigRules and FlatCompat from configs/recommended.js
  • Remove @eslint/compat from package.json (both peerDependencies and devDependencies)
  • Test that ESLint still works correctly
  • Remove package-lock.json (project uses pnpm)
  • Update pnpm-lock.yaml
  • Add package-lock.json to .gitignore
  • Run code review
  • Run security check

Summary of Changes:

This PR successfully removes the @eslint/compat compatibility layer as all ESLint plugins now have native flat config support.

Files Modified:

  1. configs/javascript.js

    • Removed import { fixupPluginRules } from '@eslint/compat'
    • Changed fixupPluginRules(stylisticEslint)stylisticEslint
    • Changed fixupPluginRules(_import)_import
  2. configs/typescript.js

    • Removed import { fixupPluginRules } from '@eslint/compat'
    • Changed fixupPluginRules(typescriptEslint)typescriptEslint
    • Changed fixupPluginRules(stylisticEslint)stylisticEslint
    • Changed fixupPluginRules(_import)_import
  3. configs/recommended.js

    • Removed import path from 'node:path'
    • Removed import { fileURLToPath } from 'node:url'
    • Removed import { fixupConfigRules } from '@eslint/compat'
    • Removed import { FlatCompat } from '@eslint/eslintrc'
    • Added import typescriptEslint from '@typescript-eslint/eslint-plugin'
    • Replaced FlatCompat usage with direct plugin imports:
      • js.configs.recommended (direct use)
      • ...typescriptEslint.configs['flat/recommended'] (spread array)
    • Removed intermediate compat.extends() wrapper
  4. package.json

    • Removed "@eslint/compat": ">= 1" from peerDependencies
    • Removed "@eslint/compat": "^1.4.1" from devDependencies
  5. pnpm-lock.yaml

    • Removed @eslint/compat package and its dependencies
  6. .gitignore

    • Added package-lock.json to prevent npm lock file from being committed

Verification:

✅ ESLint runs successfully on TypeScript files (test/index.ts)
✅ ESLint runs successfully on JavaScript files (eslint.config.js, index.js, configs/)
✅ Plugin exports correctly with all configs intact
✅ No remaining references to @eslint/compat in codebase
✅ Security scan passed with 0 alerts
✅ Works correctly with pnpm package manager

Technical Details:

All three plugins now have native flat config support:

The compatibility layer is no longer needed and has been successfully removed.

Original prompt

This section details on the original issue you should resolve

<issue_title>@eslint/compat から脱却する</issue_title>
<issue_description>互換レイヤをいつまでも使い続けるわけにもいかない</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@kakkokari-gtyih
Copy link
Contributor

@copilot 現在package managerにはpnpmを使用しています。npmのpackage-lock.jsonは使用しないでください。

Copilot AI changed the title [WIP] Remove dependency on @eslint/compat Remove @eslint/compat compatibility layer Nov 8, 2025
Copilot AI requested a review from kakkokari-gtyih November 8, 2025 10:09
Copilot finished work on behalf of kakkokari-gtyih November 8, 2025 10:09
Copy link
Author

Copilot AI commented Nov 8, 2025

@copilot 現在package managerにはpnpmを使用しています。npmのpackage-lock.jsonは使用しないでください。

Fixed in a208642. Removed package-lock.json, updated pnpm-lock.yaml, and added package-lock.json to .gitignore.

Copilot finished work on behalf of kakkokari-gtyih November 8, 2025 10:14
@kakkokari-gtyih
Copy link
Contributor

多分なんかいまいち

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@eslint/compat から脱却する

2 participants