correctness/noPrivateImports
correctness · since 2.0.0
No autofixRecommended
biome.json
{
"linter": {
"rules": {
"correctness": {
"noPrivateImports": "error"
}
}
}
}/**
* @package
*/
export const fooPackageVariable = 1;// Attempt to import package private variable from `sub/foo.js` from
// outside its `sub` module:
import { fooPackageVariable } from "./sub/foo.js";
/**
* @private For test purposes only!
*/
export function getTestStuff() {}// Attempt to import a private export. To allow this, you probably want
// to configure an `override` to disable this rule in test files.
// See: https://biomejs.dev/reference/configuration/#overrides
import { getTestStuff } from "./bar.js";// Package-private exports can be imported from inside the same module.
import { fooPackageVariable } from "./foo.js";
// Resources (anything other than JS/TS files) are always exempt.
import { barResource } from "../resources/bar.png";
/** @private */
export const subPrivateVariable = 2;// Private exports are accessible within the same module only, but
// modules can be nested. So the following works because you can always
// import from the index file of a parent module:
import { subPrivateVariable } from "../index.js";Examples from the Biome documentation.
ESLint does not have this rule.
Oxlint does not have this rule.
correctness/noPrivateImports
correctness · since 2.0.0
{
"linter": {
"rules": {
"correctness": {
"noPrivateImports": "error"
}
}
}
}Disallow the use of undeclared environment variables.
Require the TanStack Query QueryClient to be created once, not on every render.
Enforce that onMutate comes before onError and onSettled in the options of TanStack Query mutations.
Enforce a consistent property order in the options of TanStack Query infinite query functions.
Require query keys to include every value that the query function uses.