Skip to content

Force the exported function to be at the top of a file #3

@michalstocki

Description

@michalstocki

Invalid code samples 👎

function doSomething() {
}

export function doOtherThing() {
   doSomething();
}
const doSomething = () => {
};

export function doOtherThing() {
   doSomething();
}
function doSomething() {
}

export class MyClass() {
  public doAll() {
    doSomething();
  }
}

Valid code samples 👍

export function doOtherThing() {
   doSomething();
}

function doSomething() {
}
export class MyClass() {
  public doAll() {
    doSomething();
  }
}

function doSomething() {
}
const MY_CONST = '';
const MY_CONST_LIST = [];

export class MyClass(){
  public doAll() {
    doSomething();
  }
}

function doSomething(){
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions