eslint-config-standard-with-typescript
eslint-config-standard-with-typescript是什么
什么是eslint-config-standard-with-typescript,An ESLint Shareable Config for JavaScript Standard Style with TypeScript support
- eslint-config-standard-with-typescript官网:官网
- eslint-config-standard-with-typescript源码仓库:源码仓库
- eslint-config-standard-with-typescript下载地址:点此下载 点此下载2
eslint-config-standard-with-typescript使用教程帮助文档
eslint-config-standard-with-typescript
An ESLint shareable config for TypeScript that is based on eslint-config-standard and has TypeScript specific rules from eslint-plugin-typescript.
Usage
npm install --save-dev eslint-plugin-standard eslint-plugin-promise eslint-plugin-import eslint-plugin-node typescript-eslint-parser eslint-plugin-typescript eslint-config-standard-with-typescript
Yes, I know it is a large number of packages. This is due to a known design flaw in ESLint.
This long list of dependencies includes:
- Peer dependencies of eslint-config-standard
- the necessary typescript-eslint-parser; lets ESLint parse TypeScript.
- eslint-plugin-typescript; ESLint rules for TypeScript.
Here is an example .eslintrc.json
:
{
"extends": "standard-with-typescript",
"parser": "typescript-eslint-parser"
}
Make sure you read about the --ext
command line option. And here is a feature request for specifying extensions in the config.
Example command line usage:
npx eslint --ext .js,.ts .
本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。
转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]