Skip to content

chore: update eslint-plugin-eslint-comments to v4.6.0 and eslint-plugin-unicorn to v62.0.0#596

Open
aladdin-add wants to merge 4 commits intomainfrom
chore/eslint-plugin-unicorn
Open

chore: update eslint-plugin-eslint-comments to v4.6.0 and eslint-plugin-unicorn to v62.0.0#596
aladdin-add wants to merge 4 commits intomainfrom
chore/eslint-plugin-unicorn

Conversation

@aladdin-add
Copy link
Contributor

@aladdin-add aladdin-add commented Jan 31, 2026

This pull request updates the ESLint configuration to use the latest plugins and best practices, modernizes the codebase with newer JavaScript methods, and updates dependencies for better compatibility and features. The changes focus on improving maintainability and aligning with current ESLint standards.

ESLint Configuration Modernization:

  • Refactored eslint.config.ts to use defineConfig from eslint/config and updated the configuration structure for better clarity and maintainability. Now uses the latest @eslint/js, @eslint/markdown, eslint-plugin-unicorn, and @eslint-community/eslint-plugin-eslint-comments plugins directly. [1] [2] [3]
  • Updated the base and plugin configuration to use new plugin imports and configuration formats, such as switching from eslint-plugin-markdown to @eslint/markdown, and from pluginN to n. [1] [2]
  • Improved TypeScript and JavaScript rule handling by merging recommended configs and extending with Prettier and other plugin recommendations. [1] [2]
  • Adjusted rules for markdown files and TypeScript, including disabling strict mode and unused variable rules where appropriate.

Dependency Updates:

  • Upgraded major dependencies in package.json, including @eslint-community/eslint-plugin-eslint-comments to v4.6.0, eslint-plugin-unicorn to v62.0.0, and replaced eslint-plugin-markdown with @eslint/markdown. [1] [2]

Code Modernization:

  • Updated usage of array sorting in meta-property-ordering.ts and no-identical-tests.ts to use the modern .toSorted() method instead of .sort(), improving code clarity and avoiding mutation. [1] [2]

@aladdin-add aladdin-add force-pushed the chore/eslint-plugin-unicorn branch from 6ae713b to 2606d60 Compare February 1, 2026 01:22
@aladdin-add aladdin-add marked this pull request as ready for review February 1, 2026 01:30
Copilot AI review requested due to automatic review settings February 1, 2026 01:31
@aladdin-add aladdin-add requested a review from bmish February 1, 2026 01:31
const knownProps = props
.filter((prop) => orderMap.has(getKeyName(prop)))
.sort(
.toSorted(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's reported by the new eslint-plugin-unicorn.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the project’s ESLint setup and related dependencies to newer plugin versions and config patterns, while also modernizing a couple of internal implementations to avoid array mutation.

Changes:

  • Bumped ESLint plugin dependencies (notably @eslint-community/eslint-plugin-eslint-comments and eslint-plugin-unicorn) and replaced eslint-plugin-markdown with @eslint/markdown.
  • Refactored eslint.config.ts to a newer structure using defineConfig, updated plugin imports, and adjusted markdown handling.
  • Switched internal sorting logic in two rules to use non-mutating Array.prototype.toSorted().

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
package.json Updates ESLint-related devDependencies, including moving to @eslint/markdown and updating plugin versions.
eslint.config.ts Modernizes flat config structure, plugin wiring, and markdown processing configuration.
lib/rules/no-identical-tests.ts Replaces mutating .sort() with .toSorted() when generating cache keys.
lib/rules/meta-property-ordering.ts Uses .toSorted() to avoid mutating the sorted list of properties.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +38 to +42
extends: [
prettier,
'js/recommended',
tseslint.configs.recommended,
'n/recommended',
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

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

tseslint.configs.recommended is a config array (it was previously iterated over in this file). Passing it as a single element inside extends creates a nested array, which can lead to ESLint ignoring the config or erroring when loading the flat config. Consider expanding it into individual configs (e.g., spreading into the top-level config list, or otherwise ensuring each entry is applied as a flat config object).

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

1 participant