1.0.1 • Published 5 years ago
eslint-rules-tanyuan v1.0.1
eslint-plugin-ty
eslint-rules-tanyuan
Installation
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-ty
:
$ npm install eslint-plugin-ty --save-dev
Note: If you installed ESLint globally (using the -g
flag) then you must also install eslint-plugin-ty
globally.
Usage
Add ty
to the plugins
section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"ty"
]
}
Then configure the rules you want to use under the extends
section, there are six rule groups in total:
{
"extends": [
"plugin:ty/es-dev"
]
}
{
"extends": [
"plugin:ty/es-prod"
]
}
{
"extends": [
"plugin:ty/ts-dev"
]
}
{
"extends": [
"plugin:ty/ts-prod"
]
}
{
"extends": [
"plugin:ty/react-dev"
]
}
{
"extends": [
"plugin:ty/react-prod"
]
}
You can also use list of rules together, configs below means your project use Typescript
+ React
in prod
env:
{
"plugins": [
"ty"
],
"extends": [
"plugin:ty/ts-prod",
"plugin:ty/react-prod"
]
}