eslint-plugin-prefer-type-alias

0.1.0 • Public • Published

eslint-plugin-prefer-type-alias

GitHub license NPM Version NPM Downloads build:

What's this?

Prefer a type alias over an interface declaration in TypeScript.

Examples

// correct
type A = { a: string };
 
type A = { a: string } & { b: number };
 
type A = { a: string } & B & C;
// incorrect
interface A {
  a: string;
}
 
interface A extends B {
  a: string;
}

Getting started

Install

$ yarn add -D @typescript-eslint/eslint-plugin eslint-plugin-prefer-type-alias
# or 
$ npm i -D @typescript-eslint/eslint-plugin eslint-plugin-prefer-type-alias

Edit .eslintrc.js

module.exports = {
  extends: [
    "plugin:@typescript-eslint/recommended",
    "plugin:prefer-type-alias/recommended"
  ]
};

LICENSE

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i eslint-plugin-prefer-type-alias

Weekly Downloads

10,073

Version

0.1.0

License

MIT

Unpacked Size

10.3 kB

Total Files

7

Last publish

Collaborators

  • otofu-square