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.
Disallow dangling underscores in identifiers
Require return statements to either always or never specify values
Disallow variable declarations from shadowing variables declared in the outer scope