1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

Add support for TS to eslint

See https://khalilstemmler.com/blogs/typescript/eslint-for-typescript/
This commit is contained in:
Clint Checketts 2021-02-16 08:00:06 -07:00
parent 6643de66a5
commit 94b278a887
2 changed files with 20 additions and 2 deletions

View File

@ -2,13 +2,20 @@
"env": { "env": {
"node": true "node": true
}, },
"extends": ["airbnb-base", "prettier"], "extends": [
"airbnb-base",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": { "parserOptions": {
"ecmaVersion": 2019 "ecmaVersion": 2019
}, },
"plugins": ["prettier"], "plugins": ["prettier","@typescript-eslint"],
"root": true, "root": true,
"rules": { "rules": {
"@typescript-eslint/no-var-requires": 0,
"import/no-unresolved": 0,
"class-methods-use-this": [0], "class-methods-use-this": [0],
"prettier/prettier": ["error"], "prettier/prettier": ["error"],
"func-names": "off", "func-names": "off",
@ -28,5 +35,14 @@
} }
] ]
}, },
"overrides": [
{
// enable the rule specifically for TypeScript files
"files": ["*.ts", "*.tsx"],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": ["error"]
}
}
],
"ignorePatterns": ["**/docs/api/oas/"] "ignorePatterns": ["**/docs/api/oas/"]
} }

View File

@ -63,6 +63,8 @@
"snapshotDir": "snapshots" "snapshotDir": "snapshots"
}, },
"dependencies": { "dependencies": {
"@typescript-eslint/eslint-plugin": "^4.15.1",
"@typescript-eslint/parser": "^4.15.1",
"async": "^3.1.0", "async": "^3.1.0",
"basic-auth": "^2.0.1", "basic-auth": "^2.0.1",
"compression": "^1.7.3", "compression": "^1.7.3",