Skip to content

Add pluginPaths support for plugin resolution and resilient plugin loading#751

Merged
dbale-arg merged 5 commits intodevelopfrom
codex/add-support-for-pluginpaths-in-solhint
Mar 10, 2026
Merged

Add pluginPaths support for plugin resolution and resilient plugin loading#751
dbale-arg merged 5 commits intodevelopfrom
codex/add-support-for-pluginpaths-in-solhint

Conversation

@dbale-arg
Copy link
Collaborator

Motivation

  • Allow Solhint to resolve plugins from additional locations (editor integrations, external projects) instead of depending solely on the current working directory.
  • Preserve existing npm-installed plugin behavior while enabling explicit resolution from user-provided pluginPaths in .solhint.json.

Description

  • Added pluginPaths support to lib/rules/index.js, normalizing pluginPaths as either a string or an array and building resolution paths including process.cwd(), each configured pluginPath, and each <pluginPath>/node_modules.
  • Switched plugin loading to use require.resolve(packageName, { paths }) followed by require(...) so Node resolution searches the configured locations without global hacks.
  • Made plugin load failures non-fatal by emitting a warning and returning an empty plugin list so core rules and other plugins still run; also support ESM-style default export as well as direct array exports.
  • Updated config schema in lib/config/config-schema.js to accept pluginPaths as string | string[] and added/updated tests in test/common/plugin-loading.js and test/common/config-validator.js to cover the requested cases.

Testing

  • Ran the focused tests with npm test -- test/common/plugin-loading.js test/common/config-validator.js and all tests passed.
  • Ran lint checks with npx eslint lib/rules/index.js lib/config/config-schema.js test/common/plugin-loading.js test/common/config-validator.js and there were no lint errors after formatting fixes.

Codex Task

@dbale-arg dbale-arg marked this pull request as ready for review March 10, 2026 20:24
@dbale-arg dbale-arg merged commit 87106c7 into develop Mar 10, 2026
10 checks passed
dbale-arg pushed a commit that referenced this pull request Mar 17, 2026
Lists all merged PRs from Jan 20, 2026 through Mar 17, 2026:
- #749, #750, #741, #739 (fixes)
- #751 (pluginPaths enhancement)
- #740, #745 (chores)

https://claude.ai/code/session_019Fh9mDiLK59CAXGBM6LCfW
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.

1 participant