Skip to content

feat: warn on banned syntax when @silvermine/toolbox is installed#133

Merged
yokuze merged 1 commit intomasterfrom
operator-warn
Feb 25, 2026
Merged

feat: warn on banned syntax when @silvermine/toolbox is installed#133
yokuze merged 1 commit intomasterfrom
operator-warn

Conversation

@onebytegone
Copy link
Contributor

Adds a local inline ESLint plugin that warns consumers to prefer toolbox helpers over native JS patterns. Rules are only active when @silvermine/toolbox is resolvable in the consuming project.

@onebytegone onebytegone requested a review from yokuze February 24, 2026 19:06

const hasSilvermineToolbox = (() => {
try {
require.resolve('@silvermine/toolbox');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love the idea of this but I think the reality is a bit tricky.

This will resolve even if @silvermine/toolbox is not a direct dependency of the project being linted; it'll resolve if it's just anywhere in the dependency tree, right? if so, the projects that don't directly use @silvermine/toolbox would also start seeing these warnings, which seems to be against the intention of this check.

Unfortunately, the only way I can think of to check whether it is a direct dependency is to somehow find the root project's package.json and check. Probably not a good option.

Instead of this automated check, should we just enable these by default and leave it up to the project to disable them if they really don't intend to use @silvermine/toolbox?

Copy link
Contributor

@yokuze yokuze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks alright overall. Just the one question.

Adds a local inline ESLint plugin that warns consumers to prefer toolbox
helpers over native JS patterns.
@yokuze yokuze merged commit b7e789d into master Feb 25, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants