From ea8b172f2f192b16e262b7d360fa6b7aee7e7a30 Mon Sep 17 00:00:00 2001 From: Kirill Konshin Date: Mon, 7 Jan 2019 11:37:15 -0800 Subject: [PATCH] Fix for #1256 --- config/typescript.js | 22 ++++++++++++++++++++++ src/index.js | 1 + 2 files changed, 23 insertions(+) create mode 100644 config/typescript.js diff --git a/config/typescript.js b/config/typescript.js new file mode 100644 index 0000000000..d2d707c589 --- /dev/null +++ b/config/typescript.js @@ -0,0 +1,22 @@ +/** + * Adds `.jsx`, `.ts` and `.tsx` as an extension, and enables JSX/TSX parsing. + */ +var jsExtensions = ['.js', '.jsx']; +var tsExtensions = ['.ts', '.tsx']; +var allExtensions = jsExtensions.concat(tsExtensions); + +module.exports = { + + settings: { + 'import/extensions': allExtensions, + 'import/parsers': { + 'typescript-eslint-parser': tsExtensions + }, + 'import/resolver': { + 'node': { + 'extensions': allExtensions + } + } + } + +} diff --git a/src/index.js b/src/index.js index f5794595d6..6cbe0a6428 100644 --- a/src/index.js +++ b/src/index.js @@ -62,4 +62,5 @@ export const configs = { 'react': require('../config/react'), 'react-native': require('../config/react-native'), 'electron': require('../config/electron'), + 'typescript': require('../config/typescript'), }