Skip to content

What should the filename be of a file with no default exports? #2572

@Istanful

Description

@Istanful

The rules state that a file with a default export should exactly match the name of the default export. What should the filename be of a file with no default export? Should such a file exist at all?

Consider the following file:

export function getItem(key) {
  return localStorage.getItem(key);
}

export function setItem(key, value) {
  return localStorage.setItem(key, value);
}

In this case the guidelines does not seem to have a clear answer. I would lean towards localStorage.js, but I could see how LocalStorage.js could be considered as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions