Skip to main content

js/useDefaultExportBasename

MISSING DOCUMENTATION

Examples

Invalid

export default function test() {}

 foo.ts:1:24 lint/js/useDefaultExportBasename  FIXABLE  ━━━━━━━━━━━━━━━━━━━

  The filename and the name of a default function should match.

    export default function test() {}
                            ^^^^

  The filename should be test.ts or the function name should be foo.

  Safe fix


export default class Test {}

 foo.ts:1:21 lint/js/useDefaultExportBasename  FIXABLE  ━━━━━━━━━━━━━━━━━━━

  The filename and the name of a default class should match.

    export default class Test {}
                         ^^^^

  The filename should be Test.ts or the class name should be Foo.

  Safe fix

Valid

export default function foo() {}
export default class Foo {}
export default 'rome';