Repository: eslint/eslint
File: lib/rules/no-restricted-exports.js (JavaScript)

Code before:
                                //  Allow/Disallow `export { default } from "mod"; export { default as default } from "mod";` declarations
                                defaultFrom: {
                                    type: "boolean"
                                },

                                //  Allow/Disallow `export { foo as default } from "mod";` declarations
                                namedFrom: {
                                    type: "boolean"
                                },

                                //  Allow/Disallow `export * as default from "mod"`; declarations
                                namespaceFrom: {
                                    type: "boolean"
                                }
                            },
                            additionalProperties: false
                        }
                    },
                    additionalProperties: false
                }
            ]
        }],

        messages: {
            restrictedNamed: "'{{name}}' is restricted from being used as an exported name.",
            restrictedDefault: "Exporting the 'default' value is restricted."
        }
    },

    create(context) {

        const restrictedNames = new Set(context.options[0] && context.options[0].restrictedNamedExports);
        const restrictDefaultExports = context.options[0] && context.options[0].restrictDefaultExports;

        /**
         * Checks and reports given exported name.
         * @param {ASTNode} node exported `Identifier` or string `Literal` node to check.
         * @returns {void}
         */
        function checkExportedName(node) {
            const name = astUtils.getModuleExportName(node);

            if (restrictedNames.has(name)) {
                context.report({
                    node,
                    messageId: "restrictedNamed",
                    data: { name }
                });
                return;
            }


Review comment (suggestion):
```suggestion
            restrictedDefault: "Exporting 'default' is restricted."
```

`default` is binding, like other exports. I think we can shorten the message to make it more technically correct.

Code after:
                                //  Allow/Disallow `export { default } from "mod"; export { default as default } from "mod";` declarations
                                defaultFrom: {
                                    type: "boolean"
                                },

                                //  Allow/Disallow `export { foo as default } from "mod";` declarations
                                namedFrom: {
                                    type: "boolean"
                                },

                                //  Allow/Disallow `export * as default from "mod"`; declarations
                                namespaceFrom: {
                                    type: "boolean"
                                }
                            },
                            additionalProperties: false
                        }
                    },
                    additionalProperties: false
                }
            ]
        }],

        messages: {
            restrictedNamed: "'{{name}}' is restricted from being used as an exported name.",
            restrictedDefault: "Exporting 'default' is restricted."
        }
    },

    create(context) {

        const restrictedNames = new Set(context.options[0] && context.options[0].restrictedNamedExports);
        const restrictDefaultExports = context.options[0] && context.options[0].restrictDefaultExports;

        /**
         * Checks and reports given exported name.
         * @param {ASTNode} node exported `Identifier` or string `Literal` node to check.
         * @returns {void}
         */
        function checkExportedName(node) {
            const name = astUtils.getModuleExportName(node);

            if (restrictedNames.has(name)) {
                context.report({
                    node,
                    messageId: "restrictedNamed",
                    data: { name }
                });
                return;
            }