no-restricted-exports
eslint
No autofix
eslint.config.js
export default [
{
rules: {
"no-restricted-exports": "error",
},
},
];/*eslint no-restricted-exports: ["error", {
"restrictedNamedExports": ["foo", "bar", "Baz", "a", "b", "c", "d", "e", "👍"]
}]*/
export const foo = 1;
export function bar() {}
export class Baz {}
const a = {};
export { a };
function someFunction() {}
export { someFunction as b };
export { c } from "some_module";
export { "d" } from "some_module";
export { something as e } from "some_module";
export { "👍" } from "some_module";function foo() {}
export { foo as default };export { default } from "some_module";/*eslint no-restricted-exports: ["error", {
"restrictedNamedExports": ["foo", "bar", "Baz", "a", "b", "c", "d", "e", "👍"]
}]*/
export const quux = 1;
export function myFunction() {}
export class MyClass {}
const a = {};
export { a as myObject };
function someFunction() {}
export { someFunction };
export { c as someName } from "some_module";
export { "d" as " d " } from "some_module";
export { something } from "some_module";
export { "👍" as thumbsUp } from "some_module";export default function foo() {}/*eslint no-restricted-exports: ["error", {
"restrictedNamedExportsPattern": "bar$"
}]*/
export const abc = 1;Examples from the ESLint documentation.
no-restricted-exports
eslint
export default [
{
rules: {
"no-restricted-exports": "error",
},
},
];no-restricted-exports
eslint plugin · nursery
{
"rules": {
"no-restricted-exports": "error"
}
}Biome does not have this rule.
Require return statements to either always or never specify values
Disallow dangling underscores in identifiers
Enforce getter and setter pairs in objects and classes
Disallow unmodified loop conditions