From 73cec08965407f3a4035a1e04a695e499707102f Mon Sep 17 00:00:00 2001 From: Thibault Maekelbergh Date: Thu, 25 Oct 2018 17:27:47 +0200 Subject: [PATCH] Add eslint support for Typescript --- package.json | 1 + src/config/eslintrc.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 2618719c..9bc8ede1 100644 --- a/package.json +++ b/package.json @@ -88,6 +88,7 @@ "rollup-plugin-size-snapshot": "^0.6.1", "rollup-plugin-terser": "^1.0.1", "semver": "^5.5.1", + "typescript-eslint-parser": "^20.0.0", "which": "^1.3.0", "yargs-parser": "^10.0.0" }, diff --git a/src/config/eslintrc.js b/src/config/eslintrc.js index 5b5e2b32..0fc97cf2 100644 --- a/src/config/eslintrc.js +++ b/src/config/eslintrc.js @@ -11,7 +11,11 @@ module.exports = { ifAnyDep('flow-bin', 'eslint-config-prettier/flowtype'), require.resolve('eslint-config-prettier/react'), ].filter(Boolean), - parser: ifAnyDep(['babel-cli', 'babel-core', 'babel-eslint', 'babel-loader'], 'babel-eslint'), + parser: ifAnyDep( + ['babel-cli', 'babel-core', 'babel-eslint', 'babel-loader'], + 'babel-eslint', + ifAnyDep(['typescript'], 'typescript-eslint-parser') + ), rules: { 'no-use-before-define': [ 'error',