ulivz / eslint-config-typescript-library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

eslint-config-typescript-library

npm version

ESLint config for TypeScript Library

Features

  • Indent with 2 spaces and always semicolon
  • Best practice with jstsreact or their bundle!

Install

npm i -D eslint-config-typescript-library
# OR: npm install -D eslint eslint-config-typescript-library

Usage

Lint All

In .eslintrc.js:

module.exports = {
  extends: ["eslint-config-typescript-library"],
};

This enable lint for both jsts and react! you'll also need typescript as a devDependency at your project.

Lint TypeScript

In .eslintrc.js:

module.exports = {
  extends: ["eslint-config-typescript-library/ts"],
};

You need specify --ext explicitly to enable TypeScript linting:

{
  "lint": "eslint src/** --ext .js,.jsx,.ts,.tsx --fix"
}

Lint JavaScript

In .eslintrc.js:

module.exports = {
  extends: ["eslint-config-typescript-library/js"],
};

Lint React

In .eslintrc.js:

module.exports = {
  extends: ["eslint-config-typescript-library/react"],
};

License

MIT © ULIVZ

About

License:MIT License


Languages

Language:TypeScript 99.6%Language:JavaScript 0.4%