Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to export only a single function/class from a file #4

Open
michalstocki opened this issue Sep 19, 2017 · 0 comments
Open

Allow to export only a single function/class from a file #4

michalstocki opened this issue Sep 19, 2017 · 0 comments

Comments

@michalstocki
Copy link
Contributor

Invalid code examples 👎

export function doA() {
}

export function doB() {
}
export function doA() {
}

export const doB = () => {
};
export function doA() {
}

export class ClassA  {
  doB() {
    doA();
  }
};

Valid code examples 👍

export function doA() {
}

function doB() {
}
export function doA() {
}

const doB = () => {
};
export class ClassA  {
  doB() {
    doA();
  }
};

function doA() {
}

But allow multiple interfaces or consts:

export interface MyStructure {
  param1:OtherStructure;
}

export interface OtherStructure {
  param2:MyOtherStructure;
  param3:string;
}
export const MOUSE_EVENT_TYPES:string[] = ['click','mouseup','mousedown'];
export const TOUCH_EVENT_TYPES:string[] = ['touchstart', 'touchend', 'touchcancel'];
export const EVENT_NAMES:string[] = [...MOUSE_EVENT_TYPES, ...TOUCH_EVENT_TYPES];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant