Commit activity
Last 12 weeks · 0 commits
Community health
4 of 6 standards met
Recent PRs & issues
Describe the bug Several built-in commands rewrite code into output with different runtime behavior or invalid syntax. With 4.0.0 ( ) and ESLint 10.14.0: Running exits cleanly and rewrites to: Before , prints: After , prints: Causes in : : returns for any operand that is not an or a string , so member expressions, calls, numbers, and nested non- expressions are dropped. escapes ` `${\\n\t\u...to-string-literal.tsextractIdentifiers${identifier}${...}+ (expr)JSON.stringify\n\\nto-ternary.tsctx.getTextOf(consequent)ExpressionStatement;normalizeStatementExpressionStatementif (c) return 1; else return 2;c ? return 1; : return 2;to-arrow.tsfn.generator/// to-arrowfunction* gen() { yield 1; }const gen = () => { yield 1; }findNodeBelowsrc/commands/_utils.tsconst a = [1, , 3];TypeError: Cannot read properties of null (reading 'loc')nullArrayExpression.elements` are not skipped. Reproduction https://gist.github.com/trackoor/203c95d87020e7f1c801fb43e300cc4f System Info Used Package Manager npm 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!) Credit: https://ucsbplse.github.io/
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!)
Recent fixes
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: made-in-common/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 (3mo ago). Open PRs: 1, open issues: 6. Last activity: 22h ago. Community health: 62%. Top contributors: antfu, sxzz, 9romise, posva, kvoon3, ddosakura, hyoban, ntnyq, mancuoj, luo2430 and others.