diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-04-30 13:59:51 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-05-02 11:14:19 +0900 |
commit | 257162e5b6b4993e1dff0d705ffa6f0d809033eb (patch) | |
tree | 39abb74595a4d427d7959076266f4932c4bad5de | |
parent | 08a318874e979ca115bfcb0a88f4678469332088 (diff) |
Configure eslint for TypeScript
-rw-r--r-- | .eslintrc | 16 | ||||
-rw-r--r-- | package.json | 2 |
2 files changed, 12 insertions, 6 deletions
@@ -5,12 +5,17 @@ "browser" : true, "webextensions": true }, - "plugins": ["react"], - "parser": "babel-eslint", + "plugins": [ + "react", + "@typescript-eslint" + ], + "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaFeatures": { "jsx": true - } + }, + "sourceType": "module", + "project": "./tsconfig.json" }, "extends": [ "eslint:all", "plugin:react/recommended" ], "rules": { @@ -48,7 +53,7 @@ "no-ternary": "off", "no-undefined": "off", "no-undef-init": "off", - "no-unused-vars": ["error", { "varsIgnorePattern": "h" }], + "no-unused-vars": "off", "no-use-before-define": "off", "no-warning-comments": "off", "object-curly-newline": ["error", { "consistent": true }], @@ -71,6 +76,7 @@ "react/jsx-indent": ["error", 2], "react/prop-types": "off", - "react/react-in-jsx-scope": "off" + "react/react-in-jsx-scope": "off", + "@typescript-eslint/no-unused-vars": "error" } } diff --git a/package.json b/package.json index f617c14..590504b 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "start": "webpack --mode development -w --debug --devtool inline-source-map", "build": "NODE_ENV=production webpack --mode production --progress --display-error-details", "package": "npm run build && script/package", - "lint": "eslint --ext .jsx,.js src", + "lint": "eslint --ext .js,.jsx,.ts,.tsx src", "test": "karma start", "test:e2e": "mocha --timeout 8000 e2e" }, |