Skip to content

Commit 2854551

Browse files
author
Kent C. Dodds
committed
support eslint with typescript
1 parent b0d4378 commit 2854551

3 files changed

Lines changed: 119 additions & 2 deletions

File tree

.eslintrc

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,20 @@
1212
},
1313
"env": {
1414
"browser": true
15-
}
15+
},
16+
"overrides": [
17+
{
18+
"files": "**/*.+(ts|tsx)",
19+
"parser": "@typescript-eslint/parser",
20+
"parserOptions": {
21+
"project": "./tsconfig.json"
22+
},
23+
"plugins": ["@typescript-eslint/eslint-plugin"],
24+
"extends": [
25+
"plugin:@typescript-eslint/eslint-recommended",
26+
"plugin:@typescript-eslint/recommended",
27+
"eslint-config-prettier/@typescript-eslint"
28+
]
29+
}
30+
]
1631
}

package-lock.json

Lines changed: 100 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": "GPLv3",
66
"scripts": {
77
"build": "babel src --extensions .js,.ts,.tsx --out-dir dist",
8-
"lint": "eslint --ignore-path .gitignore .",
8+
"lint": "eslint --ignore-path .gitignore --ext .js,.ts,.tsx .",
99
"check-types": "tsc",
1010
"prettier": "prettier --ignore-path .gitignore \"**/*.+(js|json|ts|tsx)\"",
1111
"format": "npm run prettier -- --write",
@@ -17,6 +17,8 @@
1717
"@babel/core": "^7.7.2",
1818
"@babel/preset-env": "^7.7.1",
1919
"@babel/preset-typescript": "^7.7.2",
20+
"@typescript-eslint/eslint-plugin": "^2.7.0",
21+
"@typescript-eslint/parser": "^2.7.0",
2022
"eslint": "^6.6.0",
2123
"eslint-config-prettier": "^6.5.0",
2224
"prettier": "^1.19.1",

0 commit comments

Comments
 (0)