Last 12 weeks · 11 commits
5 of 6 standards met
Describe the bug Appears related to https://github.com/antfu/eslint-plugin-command/issues/25 but this is when is used with e,g. The following produces the error on keep-sorted; Reproduction see above System Info Used Package Manager yarn Validations [x] Follow our Code of Conduct [x] Read the Contributing Guide. [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate. [x] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead. [x] The provided reproduction is a minimal reproducible of the bug. Contributions [ ] I am willing to submit a PR to fix this issue [ ] I am willing to submit a PR with failing tests (actually just go ahead and do it, thanks!)
Extend keep-sorted to handle TSAsExpression nodes, enabling sorting of objects and arrays annotated with (e.g. ). Also add test coverage for: with with (no export) with 🔗 Linked issue N/A — this is a straightforward enhancement discovered while using the tool. 🧭 Context The command already supports expressions via , but did not recognize assertions (). This meant that object literals and arrays with were silently skipped during sorting, which is inconsistent and unexpected for users. Added to the node types recognized by , including unwrapping logic to reach the underlying or . 📚 Description TypeScript's assertion is commonly used to create deeply readonly literal types (e.g., ). Previously, would not sort these because was not included in the allowed node types for variable declarations or in the unwrap logic. This PR: 1. Adds to — allows the command to locate sorted blocks inside . 2. Adds to the variable declaration guard — prevents the node from being discarded when extracted from . 3. Adds to the unwrap logic** — unwraps to access the inner or for sorting, mirroring the existing behavior. Tests are added for three previously uncovered scenarios to ensure robustness. Thanks for reviewing — let me know if you'd like any adjustments! Also, thank you for building and maintaining this excellent ESLint plugin!
Repository: antfu/eslint-plugin-command. Description: Comment-as-command for one-off codemod with ESLint. Stars: 372, Forks: 18. Primary language: TypeScript. Languages: TypeScript (99.2%), JavaScript (0.8%). License: MIT. Homepage: https://eslint-plugin-command.antfu.me/ Topics: codemod, eslint-plugin. Latest release: v4.0.0 (3w ago). Open PRs: 1, open issues: 5. Last activity: 3w ago. Community health: 85%. Top contributors: antfu, sxzz, 9romise, posva, kvoon3, ddosakura, hyoban, ntnyq, mancuoj, luo2430 and others.