eslint-plugin-prefer-type-alias
v0.1.0
Published
Prefer a type alias over an interface declaration in TypeScript.
Downloads
49,716
Readme
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