-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(eslint): disable some eslint rules #229
Conversation
Disable `import/order` and `sort-imports` rules because they conflicts with `perfectionist/sort-imports`. closes #185
|
🦋 Changeset detectedLatest commit: ac08785 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThis pull request updates several dependency versions and revises ESLint configuration files. Changes include patches to the ESLint config package (including disabling conflicting rules), updates to commitlint and other devDependencies in package.json files, a Node.js version bump in .nvmrc, and modifications to ESLint configuration functions (disables, imports, javascript, typescript). The pnpm-workspace.yaml file also sees dependency version updates for eslint and prettier. Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
Scope: all 2 workspace projects This error happened while installing a direct dependency of /tmp/eslint/packages/eslint-config Packages found in the workspace: ✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.changeset/five-parrots-wink.md (1)
5-5
: Grammatical Tweak for Clarity.The wording "disable
import/order
andsort-imports
rules because they conflicts withperfectionist/sort-imports
" contains a subject-verb agreement issue. Changing "conflicts" to "conflict" improves grammatical correctness and clarity.Apply the following diff to fix:
- disable `import/order` and `sort-imports` rules because they conflicts with `perfectionist/sort-imports` + disable `import/order` and `sort-imports` rules because they conflict with `perfectionist/sort-imports`🧰 Tools
🪛 LanguageTool
[grammar] ~5-~5: The pronoun ‘they’ must be used with a non-third-person form of a verb.
Context: ...and
sort-importsrules because they conflicts with
perfectionist/sort-imports`(NON3PRS_VERB)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (11)
.changeset/angry-pandas-tap.md
(1 hunks).changeset/five-parrots-wink.md
(1 hunks).nvmrc
(1 hunks)package.json
(1 hunks)packages/commitlint-config/package.json
(1 hunks)packages/eslint-config/package.json
(3 hunks)packages/eslint-config/src/configs/disables.ts
(3 hunks)packages/eslint-config/src/configs/imports.ts
(0 hunks)packages/eslint-config/src/configs/javascript.ts
(0 hunks)packages/eslint-config/src/configs/typescript.ts
(0 hunks)pnpm-workspace.yaml
(1 hunks)
💤 Files with no reviewable changes (3)
- packages/eslint-config/src/configs/javascript.ts
- packages/eslint-config/src/configs/typescript.ts
- packages/eslint-config/src/configs/imports.ts
✅ Files skipped from review due to trivial changes (3)
- .nvmrc
- .changeset/angry-pandas-tap.md
- pnpm-workspace.yaml
🧰 Additional context used
🪛 LanguageTool
.changeset/five-parrots-wink.md
[grammar] ~5-~5: The pronoun ‘they’ must be used with a non-third-person form of a verb.
Context: ...and
sort-importsrules because they conflicts with
perfectionist/sort-imports`
(NON3PRS_VERB)
🔇 Additional comments (8)
packages/eslint-config/src/configs/disables.ts (2)
7-13
: LGTM: New configuration for bin files.Added specific ESLint rule exceptions for bin files, disabling import-related rules that are typically needed for executable files.
15-21
: Good addition: Resolving rule conflicts.Added configuration to handle conflicts between import sorting rules. This prevents competing rules from interfering with each other.
Let's verify if these rules are actually conflicting:
✅ Verification successful
🌐 Web query:
Do eslint rules 'import/order' and 'perfectionist/sort-imports' conflict with each other?
💡 Result:
Yes, ESLint rules `import/order` (from `eslint-plugin-import`) and `perfectionist/sort-imports` (from `eslint-plugin-perfectionist`) **do conflict** when used together. Here’s a breakdown of why: --- ### 1. **Overlapping Functionality** Both rules enforce import sorting but use **different methodologies**: - `import/order` groups imports by type (e.g., "builtin," "external," "internal") and sorts alphabetically within those groups[2][5]. - `perfectionist/sort-imports` adds stricter sorting (e.g., natural order, line length) and supports additional import types like `"side-effect"` or `"style"`[8][9]. --- ### 2. **Explicit Conflicts** The `eslint-plugin-perfectionist` documentation explicitly warns: > If you use the `sort-imports` rule or the `order` rule from `eslint-plugin-import`, disable them to avoid conflicts[6][8]. For example: ```json { "rules": { "import/order": "off", "sort-imports": "off" } } ``` This is required because both rules attempt to enforce incompatible import structures[3][6]. --- ### 3. **Key Differences** | Feature | `import/order` | `perfectionist/sort-imports` | |------------------------|-----------------------------|------------------------------------| | **Grouping** | Predefined groups (e.g., "builtin")[5] | Custom groups + new types (e.g., "style")[8] | | **Sorting Logic** | Alphabetical | Natural order + line length[8][9] | | **TypeScript Support** | Limited | Enhanced (e.g., type imports)[8] | | **Auto-Fix** | Partial | Full[8] | --- ### 4. **Recommendation** To resolve conflicts: 1. **Disable conflicting rules** when using `perfectionist/sort-imports`[6][8]. 2. Use **one rule exclusively** based on your needs: - Choose `perfectionist/sort-imports` for stricter, customizable sorting. - Use `import/order` for simpler grouping-based sorting. --- For projects already using `eslint-plugin-perfectionist`, its rule supersedes `import/order`, offering more granular control over import organization[8][9]. Citations: - 1: https://eslint.org/docs/latest/rules/sort-imports - 2: https://dev.to/diballesteros/how-to-quickly-configure-eslint-for-import-sorting-2h73 - 3: https://github.com/azat-io/eslint-plugin-perfectionist/issues/141 - 4: https://typescript-eslint.io/rules/consistent-type-imports/ - 5: https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md - 6: https://www.npmjs.com/package/eslint-plugin-perfectionist/v/1.1.0 - 7: https://github.com/vercel/style-guide/issues/76 - 8: https://perfectionist.dev/rules/sort-imports.html - 9: https://unpkg.com/browse/[email protected]/readme.md - 10: https://github.com/lydell/eslint-plugin-simple-import-sort/issues/115
Configuration Properly Resolves Import Sorting Rule Conflicts
The web query confirms that ESLint rules "import/order" and "perfectionist/sort-imports" do indeed conflict. Disabling them (as shown in lines 15‑21 of packages/eslint-config/src/configs/disables.ts) is the appropriate resolution to avoid overlapping behaviors.
• Disabling both rules prevents the conflicts highlighted in the documentation.
• This configuration aligns with best practices when using eslint-plugin-perfectionist.packages/commitlint-config/package.json (1)
29-29
: Verify version compatibility with peer dependency.The
@commitlint/cli
was updated to^19.7.1
while the peer dependency remains at^19.6.0
. This should be compatible, but let's verify the latest version and any breaking changes.✅ Verification successful
🌐 Web query:
What is the latest version of @commitlint/cli and are there any breaking changes between 19.6.0 and 19.7.1?
💡 Result:
The latest version of **@commitlint/cli** is **19.7.1**, released on February 2, 2025[1][4]. This is a patch release with no new features or breaking changes mentioned in its changelog[1][4]. ### Breaking Changes Analysis (19.6.0 → 19.7.1) Based on the provided changelogs: - **No breaking changes** were introduced between these versions[1][4][8] - Both releases appear to be routine maintenance updates described as: ```text "Note: Version bump only for package @commitlint/cli" ``` - Key differences between these versions: | Version | Release Date | Changes | |---------|--------------|---------| | 19.7.1 | 2025-02-02 | Version bump only[1] | | 19.6.x | 2024-11-19 → 2024-12-15 | Version bumps and minor dependency updates[1][8] | For context, recent major breaking changes (like ESM migration and Node.js version requirements) occurred in earlier versions like **v18 → v19**[1][2]. Always check `commitlint.config.js` compatibility when upgrading across major versions[2]. Citations: - 1: https://github.com/conventional-changelog/commitlint/blob/master/@commitlint/cli/CHANGELOG.md - 2: https://commitlint.js.org/support/upgrade.html - 3: https://www.npmjs.com/package/@commitlint/config-conventional - 4: https://www.npmjs.com/package/@commitlint/cli?activeTab=versions - 5: https://github.com/conventional-changelog/commitlint/blob/master/CHANGELOG.md - 6: https://www.npmjs.com/package/@commitlint/cli - 7: https://www.npmjs.com/package/@commitlint/config-conventional?activeTab=versions - 8: https://github.com/conventional-changelog/commitlint/releases - 9: https://www.jsdocs.io/package/@commitlint/cli - 10: https://classic.yarnpkg.com/en/package/@commitlint/cli
Compatibility of @commitlint/cli Verified
The latest version (@commitlint/cli 19.7.1) is a patch release with no breaking changes compared to 19.6.0. This minor version bump maintains backward compatibility with the peer dependency (^19.6.0).
package.json (2)
29-47
: LGTM: Dependencies updated to latest minor versions.All dependency updates are minor version bumps, which should maintain backward compatibility:
- @commitlint/cli: ^19.7.1
- @types/node: ^22.13.1
- cspell: ^8.17.3
- lint-staged: ^15.4.3
- prettier: ^3.5.0
- turbo: ^2.4.0
48-48
: 🌐 Web query:Are there any breaking changes in pnpm 10.2.1 compared to 9.15.4?
💡 Result:
Yes, there are significant breaking changes between pnpm 9.x and 10.x versions (including 10.2.1). Here are the key breaking changes introduced in pnpm 10: ## Security Changes - **Lifecycle scripts disabled by default** Dependencies' lifecycle scripts (like postinstall) no longer execute during installation unless explicitly allowed via `pnpm.onlyBuiltDependencies` in package.json[1][5]. Example: ```json { "pnpm": { "onlyBuiltDependencies": ["fsevents"] } } ``` ## Core Functionality Changes - **Global store structure** Store version bumped to v10 with SHA256 hashing replacing MD5 for: - Lockfile peer dependency hashes - Side effects cache keys - pnpmfile checksums[1] - **Linking behavior** - `pnpm link` now adds overrides to workspace root package.json instead of local projects[1] - Global linking uses `pnpm link` without `-g` flag[1] ## Configuration Defaults - **Public hoisting** Default `public-hoist-pattern` no longer hoists packages containing "eslint" or "prettier"[1] - **Package manager management** `manage-package-manager-versions` enabled by default (manages pnpm version via package.json)[1] ## Environment Changes - **Reduced environment variables** Only these `npm_package_*` vars remain during script execution: ```text name | version | bin | engines | config ``` - **Production installs** Installs all dependencies (including devDependencies) even with `NODE_ENV=production`[1] ## Command Changes - **Global installs blocked** `pnpm add --global pnpm` now fails (use `pnpm self-update` instead)[1] - **Deployment requirements** `pnpm deploy` only works in workspaces with `inject-workspace-packages=true`[1] ## Windows-Specific Changes - **Path length limits** Default `virtual-store-dir-max-length` reduced to 60 characters on Windows[1] These changes reflect pnpm's focus on security hardening (script blocking/SHA256), workspace optimization (linking/deployment improvements), and configuration clarity[1][5][6]. Users upgrading from v9 should review their build scripts and dependency configurations carefully. Citations: - 1: https://github.com/pnpm/pnpm/releases - 2: https://github.com/pnpm/pnpm/issues/9066 - 3: https://pnpm.io/cli/update - 4: https://community.chocolatey.org/packages/pnpm/10.2.1 - 5: https://github.com/pnpm/pnpm/issues/9032 - 6: https://www.npmjs.com/package/pnpm - 7: https://answers.netlify.com/t/corepack-and-pnpm-10-2-0-failing-on-build/138964 - 8: https://classic.yarnpkg.com/en/package/pnpm
packages/eslint-config/package.json (2)
38-40
: 🏁 Script executed:#!/bin/bash # Check TypeScript version in the project grep '"typescript":' package.jsonLength of output: 62
41-41
: Verify breaking changes in major version updates.The following dependencies had major version bumps:
- eslint-config-flat-gitignore: ^1.0.0 → ^2.0.0
- eslint-merge-processors: ^1.0.0 → ^2.0.0
Let's verify the impact of these changes.
Also applies to: 44-45
✅ Verification successful
🌐 Web query:
What are the breaking changes in eslint-config-flat-gitignore 2.0.0 and eslint-merge-processors 2.0.0?
💡 Result:
Based on the provided search results and current information up to February 2025: ### `eslint-config-flat-gitignore` No explicit mention of v2.x exists in available sources[1][3]. The latest documented version focuses on: - **Strict mode by default** (throws errors if `.gitignore`/`.eslintignore` files are missing) - **Deprecation of `.eslintignore`** (recommends declaring ignores directly in `eslint.config.js` instead) - **Multi-root lookup behavior** (automatically searches parent directories for `.gitignore` unless `root: true` is set) --- ### `eslint-merge-processors` No v2.x release is documented[8]. The latest v1.x features: - Merging multiple ESLint processors into one - Basic TypeScript support - No major breaking changes reported --- ### Notable Adjacent Changes While not directly answering your query about those specific packages: 1. **ESLint v9** introduced flat config migration[3][4]: - Removed `.eslintrc.*`/`package.json` configurations - Requires explicit `ignores` patterns instead of `.eslintignore` - Changed processor handling (no auto-configuration) 2. **@antfu/eslint-define-config v2.x**[10]: - Rewritten plugin type definitions - Requires explicit plugin renaming syntax - Stricter rule type enforcement --- **Recommendation**: Check official npm registry pages for these packages to confirm latest versions beyond what’s shown in these historical sources[1][8]. Citations: - 1: https://www.npmjs.com/package/eslint-config-flat-gitignore - 2: https://eslint.org/blog/2016/02/eslint-v2.0.0-released/ - 3: https://seek-oss.github.io/skuba/CHANGELOG.html - 4: https://eslint.org/docs/latest/use/configure/migration-guide - 5: https://eslint.org/docs/latest/use/migrating-to-2.0.0 - 6: https://github.com/eslint/eslint/issues/18093 - 7: https://eslint.org/docs/latest/use/configure/configuration-files - 8: https://npmjs.com/package/eslint-merge-processors - 9: https://lists.apache.org/thread/8qy11zhtp9r2xch5k383g3fv63rjvpjd - 10: https://classic.yarnpkg.com/en/package/@antfu/eslint-define-config
Major Dependency Version Updates Impact
eslint-config-flat-gitignore v2.0.0:
• Now enforces strict mode by default, throwing errors if.gitignore
/.eslintignore
files are missing.
• Deprecates the use of.eslintignore
in favor of declaring ignore patterns directly ineslint.config.js
.
• Implements a multi-root lookup behavior for.gitignore
(unlessroot: true
is specified).eslint-merge-processors v2.0.0:
• No documented breaking changes were found, indicating that its upgrade should be largely backward compatible.Based on the available documentation and web query results, the major version bump for eslint-config-flat-gitignore entails breaking changes that may require adjustments in your ESLint configuration, while eslint-merge-processors appears safe.
.changeset/five-parrots-wink.md (1)
1-3
: Minor Version Update as Expected.The changeset file correctly specifies a minor version update for
@mheob/eslint-config
. This adheres to the expected semantic versioning practice.
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @mheob/[email protected] ### Minor Changes - [#229](#229) ([@mheob](https://github.com/mheob)): disable `import/order` and `sort-imports` rules because they conflicts with `perfectionist/sort-imports` ### Patch Changes - [#229](#229) ([@mheob](https://github.com/mheob)): update dependencies <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Chores** - Removed outdated internal configuration documents related to dependency updates and linting adjustments. - Updated the ESLint configuration package to version 8.1.0 with improvements in dependency management and rule compatibility. - **Documentation** - Revised the changelog to reflect these minor updates and enhancements, ensuring smoother integration of tooling without breaking changes. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Resolves #185
Summary by CodeRabbit