0.1.0 • Published 5 years ago

eslint-plugin-prefer-type-alias v0.1.0

Weekly downloads
456
License
MIT
Repository
github
Last release
5 years ago

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