chore: update eslint-plugin-eslint-comments to v4.6.0 and eslint-plugin-unicorn to v62.0.0#596
chore: update eslint-plugin-eslint-comments to v4.6.0 and eslint-plugin-unicorn to v62.0.0#596aladdin-add wants to merge 4 commits intomainfrom
Conversation
6ae713b to
2606d60
Compare
| const knownProps = props | ||
| .filter((prop) => orderMap.has(getKeyName(prop))) | ||
| .sort( | ||
| .toSorted( |
There was a problem hiding this comment.
it's reported by the new eslint-plugin-unicorn.
There was a problem hiding this comment.
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-commentsandeslint-plugin-unicorn) and replacedeslint-plugin-markdownwith@eslint/markdown. - Refactored
eslint.config.tsto a newer structure usingdefineConfig, 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.
| extends: [ | ||
| prettier, | ||
| 'js/recommended', | ||
| tseslint.configs.recommended, | ||
| 'n/recommended', |
There was a problem hiding this comment.
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).
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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:
eslint.config.tsto usedefineConfigfromeslint/configand 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-commentsplugins directly. [1] [2] [3]eslint-plugin-markdownto@eslint/markdown, and frompluginNton. [1] [2]Dependency Updates:
package.json, including@eslint-community/eslint-plugin-eslint-commentsto v4.6.0,eslint-plugin-unicornto v62.0.0, and replacedeslint-plugin-markdownwith@eslint/markdown. [1] [2]Code Modernization:
meta-property-ordering.tsandno-identical-tests.tsto use the modern.toSorted()method instead of.sort(), improving code clarity and avoiding mutation. [1] [2]