--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: invalid.json --- # Input ```cjs export default function f() {}; ``` # Diagnostics ``` invalid.json:1:8 lint/style/noDefaultExport ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid default exports. > 1 │ export default function f() {}; │ ^^^^^^^ i Default exports cannot be easily discovered inside an editor and don't encourage the use of consistent names through a code base. i Use a named export instead. ``` # Input ```cjs export default class C {}; ``` # Diagnostics ``` invalid.json:1:8 lint/style/noDefaultExport ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid default exports. > 1 │ export default class C {}; │ ^^^^^^^ i Default exports cannot be easily discovered inside an editor and don't encourage the use of consistent names through a code base. i Use a named export instead. ``` # Input ```cjs export default function () {}; ``` # Diagnostics ``` invalid.json:1:8 lint/style/noDefaultExport ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid default exports. > 1 │ export default function () {}; │ ^^^^^^^ i Default exports cannot be easily discovered inside an editor and don't encourage the use of consistent names through a code base. i Use a named export instead. ``` # Input ```cjs export default class {}; ``` # Diagnostics ``` invalid.json:1:8 lint/style/noDefaultExport ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid default exports. > 1 │ export default class {}; │ ^^^^^^^ i Default exports cannot be easily discovered inside an editor and don't encourage the use of consistent names through a code base. i Use a named export instead. ``` # Input ```cjs export default X; ``` # Diagnostics ``` invalid.json:1:8 lint/style/noDefaultExport ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid default exports. > 1 │ export default X; │ ^^^^^^^ i Default exports cannot be easily discovered inside an editor and don't encourage the use of consistent names through a code base. i Use a named export instead. ``` # Input ```cjs export default { f() {} }; ``` # Diagnostics ``` invalid.json:1:8 lint/style/noDefaultExport ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid default exports. > 1 │ export default { f() {} }; │ ^^^^^^^ i Default exports cannot be easily discovered inside an editor and don't encourage the use of consistent names through a code base. i Use a named export instead. ``` # Input ```cjs export { X as default }; ``` # Diagnostics ``` invalid.json:1:15 lint/style/noDefaultExport ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid default exports. > 1 │ export { X as default }; │ ^^^^^^^ i Default exports cannot be easily discovered inside an editor and don't encourage the use of consistent names through a code base. i Use a named export instead. ``` # Input ```cjs export { X as 'default' }; ``` # Diagnostics ``` invalid.json:1:15 lint/style/noDefaultExport ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid default exports. > 1 │ export { X as 'default' }; │ ^^^^^^^^^ i Default exports cannot be easily discovered inside an editor and don't encourage the use of consistent names through a code base. i Use a named export instead. ``` # Input ```cjs export { default } from './module'; ``` # Input ```cjs export { X as default } from './module'; ``` # Diagnostics ``` invalid.json:1:15 lint/style/noDefaultExport ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid default exports. > 1 │ export { X as default } from './module'; │ ^^^^^^^ i Default exports cannot be easily discovered inside an editor and don't encourage the use of consistent names through a code base. i Use a named export instead. ``` # Input ```cjs export { X as 'default' } from './module'; ``` # Diagnostics ``` invalid.json:1:15 lint/style/noDefaultExport ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid default exports. > 1 │ export { X as 'default' } from './module'; │ ^^^^^^^^^ i Default exports cannot be easily discovered inside an editor and don't encourage the use of consistent names through a code base. i Use a named export instead. ```