Repository navigation
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 56 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (6)
ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThis change adds the ChangesSingle-quoted expansion rule
Estimated code review effort: 2 (Simple) | ~15 minutes Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
9a64120 to
d17ba08
Compare
c95a38c to
9055747
Compare
9055747 to
05416a3
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Empty backtick command substitutions are valid but currently evade the documented detection behavior.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds a ShellCheck SC2016-inspired rule detecting expansion-like syntax inside single-quoted Bash strings.
Changes:
- Implements and tests the new rule.
- Enables it as a recommended warning.
- Adds rule documentation and README coverage.
| File | Description |
|---|---|
src/rules/no-expansions-in-single-quotes.ts |
Implements expansion detection. |
src/rules/no-expansions-in-single-quotes.spec.ts |
Adds rule tests. |
src/index.ts |
Registers and configures the rule. |
src/index.spec.ts |
Verifies rule exposure. |
README.md |
Lists the new rule. |
docs/rules/no-expansions-in-single-quotes.md |
Documents behavior and usage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
5ef65a7 to
73c371e
Compare
d661677 to
b7e6d3d
Compare
c3ed575 to
cb27d20
Compare
b334e7d to
3aa6691
Compare
3aa6691 to
383ff55
Compare
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n-single-quotes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rule only listed shell/bash in meta.languages, so ESLint rejected it when used with the shell/posix or shell/mksh language. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
383ff55 to
205682a
Compare

Adds
shell/no-expansions-in-single-quotes, which mirrors ShellCheck SC2016. Expansions don't happen inside single quotes, so'$var'is almost always a mistake.Behavior
$name,${...},$(...), or a backtick pair.$1, so awk and sed programs likeawk '{print $1}'stay clean.$followed by a digit or punctuation ('costs $5').$'...'strings."warn", not"error", because single-quoting literal$text is sometimes intentional (for example, text passed to another program).Documentation
Adds
docs/rules/no-expansions-in-single-quotes.md, following the format of the@eslint/json,@eslint/css, and@eslint/markdownrule docs: description, background, rule details with incorrect and correct examples, options, when not to use it, and the ShellCheck reference. The rule'smeta.docs.urlpoints at that file, and its README table entry links to it.Testing
9 RuleTester cases and 5 documentation checks (191 total); build, lint, and format checks pass.
🤖 Generated with Claude Code
Stack created with GitHub Stacks CLI • Give Feedback 💬
Summary by CodeRabbit
New Features
no-expansions-in-single-quotesrule, which warns about variable, parameter, command, and backtick-style expansions inside single-quoted strings.Documentation