-
Notifications
You must be signed in to change notification settings - Fork 2
Migrate to Eslint v9 #16
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
Open
conarti
wants to merge
40
commits into
master
Choose a base branch
from
feat/migrate-to-eslint-9
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First iteration - just migrate 'as is'
|
Hello! How to solve this issue?
|
Owner
Author
|
@iksent Hello. You have to use |
- Add RULE_NAMES constants to config for better maintainability - Remove utils.ts and move rule naming to config - Simplify create-plugin by removing enhanceWithImportOrder - Remove mergeConfigs dependency - Add import-order rule to main plugin rules - Update all import-order configs to use RULE_NAMES constants - Improve type safety and developer experience 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Create rules/import-order/configs.ts with centralized rule configurations - Remove duplicate configurations from configs/import-order files - Update create-plugin to use direct rule configs instead of extracting from configs - Remove shared.ts as it's no longer needed - Improve DRY principle and maintainability - Ensure single source of truth for import-order rule configurations 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Update import-order config names to use proper plugin namespace - Change from @conarti/sort-imports/* to @conarti/feature-sliced/import-order/* - Maintain consistency with plugin naming convention 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…name Fixed bug where rules did not catch imports from segments of other layers when the slice name was the same in both layers. The isSameSlice check now properly includes layer verification by reusing the isSameLayer variable, preventing false positives like: - pages/policies importing from entities/policies/api - pages/policies importing from entities/policies/lib Added test cases for both layers-slices and public-api rules to ensure cross-layer imports with same slice names are properly caught. Closes #18 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Updated all test files to use the new ESLint v9 flat config format: - Changed parserOptions to languageOptions in all test files - Updated parser from require.resolve() to require() - Updated ESLint config test to use overrideConfigFile and overrideConfig - Updated config-lib utility to generate flat config format All 193 tests now pass successfully. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Replaced deprecated TSESLint.RuleTester with @typescript-eslint/rule-tester - Fixed TypeScript type compatibility issues with type assertions - All type checks now pass successfully - Tests remain functional with proper flat config support This resolves the deprecation warnings and ensures compatibility with ESLint v9. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Replaced custom RuleModule interface with official RuleModule<MessageIds, Options> - Removed 'as any' casts from test files by using correct type signature - Fixed type inference in public-api tests by removing explicit type annotation This ensures full type safety and compatibility with @typescript-eslint/rule-tester. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Rewrote tests to use relative paths instead of alias imports - Removed dependency on CWD_MOCK_PATH for critical business logic tests - Added separate skipped test suite for cwd functionality - All 41 tests now pass, 2 tests skipped pending @typescript-eslint/rule-tester cwd support The skipped tests verify that rules work correctly with custom cwd and alias resolution, which is currently not supported by @typescript-eslint/rule-tester. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Updated skipped test comment with link to the upstream issue requesting custom cwd support in @typescript-eslint/rule-tester. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Rewrote tests to remove dependency on custom cwd for critical tests - Removed tests with absolute file paths that rely on cwd resolution - Added separate skipped test suites for cwd-dependent functionality - Fixed setValidationLevel helper to include required ignoreInFilesPatterns field Changes: - absolute-relative: removed 4 cwd-dependent tests, added skipped suite with those tests - public-api: removed 2 cwd-dependent tests, added skipped suite, fixed Options type in helper All tests now pass (187 passed, 8 skipped total across all rules). The skipped tests verify functionality with custom cwd and alias resolution, currently not supported by @typescript-eslint/rule-tester. See: typescript-eslint/typescript-eslint#11668 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Remove explicit ESLint.Plugin type that conflicts with @typescript-eslint/utils strict typing. TypeScript now infers the correct type automatically, eliminating the need for type assertions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
…ions When converting imports like `@/entities/node/api.ts` to public API format, the rule was incorrectly suggesting `@/entities/node.ts` instead of the correct `@/entities/node`. This happened because after removing the segment path (e.g., `/api`), the file extension `.ts` remained in the resulting path. Solution: Strip common file extensions (.ts, .js, .tsx, .jsx, etc.) from the final public API path after removing the segment. Fixes #17 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Replace hardcoded list of file extensions with a universal regex pattern that removes any file extension (.xxx format) from directory paths. This makes the rule work with any file type (.svelte, .astro, .php, etc.) instead of being limited to specific extensions. Changed from: /\.(ts|js|tsx|jsx|mts|cts|mjs|cjs|vue)$/ Changed to: /\.\w+$/ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi! If you’d like to test the new version of the plugin with me, you’re welcome to join. Feel free to report any issues in this PR.
Usage:
npm i -D @conarti/eslint-plugin-feature-sliced@nexteslint.config.js:Planned tasks before publishing the stable version:
@xsupportpeerDependenciesand check other fields inpackage.jsontseslint.config(...)factory