eslint-config-futu
Advanced tools
Comparing version 1.0.3 to 1.1.0
module.exports = { | ||
extends: 'eslint-config-futu/rules/base' | ||
}; | ||
extends: './rules/base' | ||
}; |
{ | ||
"name": "eslint-config-futu", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"description": "", | ||
@@ -11,4 +11,5 @@ "main": "index.js", | ||
"type": "git", | ||
"url": "git@gitlab.futunn.com:webpackage/eslint-config-futu.git" | ||
"url": "https://github.com/futuweb/eslint-config-futu" | ||
}, | ||
"homepage": "https://github.com/futuweb/eslint-config-futu", | ||
"author": "", | ||
@@ -18,3 +19,9 @@ "license": "ISC", | ||
"eslint": ">= 3" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^14.14.14", | ||
"@typescript-eslint/eslint-plugin": "^4.11.0", | ||
"@typescript-eslint/parser": "^4.11.0", | ||
"typescript": "^4.1.3" | ||
} | ||
} |
@@ -34,2 +34,37 @@ # 富途ESLint规则 | ||
## 在TypeScript项目中使用 | ||
1. 安装依赖 | ||
```bash | ||
npm install eslint typescript eslint-config-futu --save-dev | ||
``` | ||
2. 在项目web根目录上层新建.eslintrc.js文件 | ||
```javascript | ||
module.exports = { | ||
root: true, | ||
extends: 'eslint-config-futu/typescript', // 这里要使用'eslint-config-futu/typescript'配置 | ||
env: { | ||
browser: true, | ||
node: true, | ||
amd: true | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 7, | ||
sourceType: 'module', | ||
// recommend to use another config file like tsconfig.eslint.json and extends tsconfig.json in it. | ||
// because you may be need to lint test/**/*.test.ts but no need to emit to js. | ||
// @see https://github.com/typescript-eslint/typescript-eslint/issues/890 | ||
project: './tsconfig.json' | ||
}, | ||
rules:{ | ||
// 如果项目有特殊需求,可在此覆盖 | ||
} | ||
} | ||
``` | ||
## 附:编辑器使用方式 | ||
@@ -59,2 +94,12 @@ | ||
### atom | ||
apm install linter | ||
apm install linter-ui-default | ||
apm install linter-eslint | ||
启用这三个插件便可 | ||
## 注:为什么不能使用全局ESLint工具 | ||
@@ -75,2 +120,11 @@ | ||
### 1.1.0 2020-12-24 | ||
- 增加 [prefer-const](https://eslint.org/docs/rules/prefer-const) 检查 | ||
- 增加 [no-var](https://eslint.org/docs/rules/no-var) 检查 | ||
- 支持typescript文件校验 | ||
- 增加 [@typescript-eslint/no-var-requires](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-var-requires.md) 检查 | ||
- 增加 [@typescript-eslint/no-explicit-any](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-explicit-any.md) 检查 | ||
- 增加 [@typescript-eslint/ban-ts-comment](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/ban-ts-comment.md) 检查 | ||
### 1.0.3 2017-04-20 | ||
@@ -77,0 +131,0 @@ |
@@ -107,4 +107,6 @@ // eslint配置文件 - 基础配置 | ||
// for in 遍历需过滤掉原型上的属性 | ||
"guard-for-in": ['warn'] | ||
"guard-for-in": ['warn'], | ||
"prefer-const": ["error"], | ||
"no-var": ["error"] | ||
} | ||
}; | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
10200
6
139
1
155
4