@marginallyuseful/soll-eslint-plugin
v0.0.1-05b9ce9b
Published
ESLint plugin for soll — enforces workspace-root-relative import paths
Readme
@marginallyuseful/soll-eslint-plugin
ESLint plugin for soll. Enforces workspace-root-relative imports of the form
<prefix><root-relative-path> (default -/) for every local import — anything
that resolves to a file inside the workspace.
Install
npm install -D @marginallyuseful/soll-eslint-plugin
# or: bun add -D @marginallyuseful/soll-eslint-pluginThe plugin depends on @marginallyuseful/soll-native. Platform-specific binaries
are distributed as optional dependencies; reinstall your package manager's
lockfile to ensure the right binary is fetched for your platform.
Usage (flat config)
// eslint.config.mjs
import sollPlugin from "@marginallyuseful/soll-eslint-plugin";
export default [
{
plugins: { soll: sollPlugin },
rules: {
"soll/prefer-root-relative-imports": "error",
},
},
];Or use the bundled preset:
import sollPlugin from "@marginallyuseful/soll-eslint-plugin";
export default [{ plugins: { soll: sollPlugin } }, ...sollPlugin.configs.recommended];Rule: soll/prefer-root-relative-imports
Reports any local import whose specifier doesn't equal <prefix><resolved-root-relative-path>. Fully autofixable. See the design spec for full semantics.
Options
type Options = {
prefix?: string; // default: "-/"
unresolved?: "skip" | "report"; // default: "skip"
};