Skip to content

Latest commit

 

History

History
45 lines (32 loc) · 1020 Bytes

ts-modules-only-named.md

File metadata and controls

45 lines (32 loc) · 1020 Bytes

ts-modules-only-named

Requires all exports from the main entrypoint to the package to be named exports.

By default, the main entrypoint is assumed to be src/index.ts. However, if your package's main entrypoint is elsewhere, you'll need to specify so in your .eslintrc configuration file as follows (for example, if the entrypoint is index.ts):

{
  "settings": {
    "main": "index.ts"
  }
}

Examples

All examples are representative of the main entrypoint.

Good

export /* package contents */{};
export /* package contents */{};
export const package = {
  /* package contents */
};

Bad

export default {
  /* package contents */
};

Also encompasses ts-config-no-default, as the rules are similar enough to not exist separately for linting purposes.