From 2b3485b047096f4e5957e74c2c14b649c1dac99c Mon Sep 17 00:00:00 2001 From: Dano Morrison Date: Sun, 9 Aug 2020 13:21:44 -0400 Subject: [PATCH] other minor updates --- .eslintignore | 1 + .eslintrc.js | 20 +++++++++++++++----- babel.config.js | 14 +++++++------- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/.eslintignore b/.eslintignore index efe3eacb..d45a9773 100644 --- a/.eslintignore +++ b/.eslintignore @@ -33,6 +33,7 @@ app/node_modules # App packaged release +app/*.main.prod.js app/main.prod.js app/main.prod.js.map app/renderer.prod.js diff --git a/.eslintrc.js b/.eslintrc.js index 7169cd38..0a08e825 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -27,15 +27,25 @@ module.exports = { 'react/no-will-update-set-state': 'warn', 'react/prop-types': 'off', 'react/static-property-placement': 'off', - 'react/no-array-index-key': 'off' + 'react/no-array-index-key': 'off', + }, + parserOptions: { + ecmaVersion: 2020, + sourceType: 'module', + project: './tsconfig.json', + tsconfigRootDir: __dirname, + createDefaultProgram: true, }, settings: { 'import/resolver': { // See https://github.com/benmosher/eslint-plugin-import/issues/1396#issuecomment-575727774 for line below node: {}, webpack: { - config: require.resolve('./configs/webpack.config.eslint.js') - } - } - } + config: require.resolve('./configs/webpack.config.eslint.js'), + }, + }, + 'import/parsers': { + '@typescript-eslint/parser': ['.ts', '.tsx'], + }, + }, }; diff --git a/babel.config.js b/babel.config.js index 51d89736..efad5dcd 100644 --- a/babel.config.js +++ b/babel.config.js @@ -10,10 +10,10 @@ const productionPlugins = [ // babel-preset-react-optimize require('@babel/plugin-transform-react-constant-elements'), require('@babel/plugin-transform-react-inline-elements'), - require('babel-plugin-transform-react-remove-prop-types') + require('babel-plugin-transform-react-remove-prop-types'), ]; -module.exports = api => { +module.exports = (api) => { // See docs about api at https://babeljs.io/docs/en/config-files#apicache const development = api.env(developmentEnvironments); @@ -23,7 +23,7 @@ module.exports = api => { // @babel/preset-env will automatically target our browserslist targets require('@babel/preset-env'), require('@babel/preset-typescript'), - [require('@babel/preset-react'), { development }] + [require('@babel/preset-react'), { development }], ], plugins: [ // Stage 0 @@ -35,11 +35,11 @@ module.exports = api => { [require('@babel/plugin-proposal-optional-chaining'), { loose: false }], [ require('@babel/plugin-proposal-pipeline-operator'), - { proposal: 'minimal' } + { proposal: 'minimal' }, ], [ require('@babel/plugin-proposal-nullish-coalescing-operator'), - { loose: false } + { loose: false }, ], require('@babel/plugin-proposal-do-expressions'), @@ -56,7 +56,7 @@ module.exports = api => { [require('@babel/plugin-proposal-class-properties'), { loose: true }], require('@babel/plugin-proposal-json-strings'), - ...(development ? developmentPlugins : productionPlugins) - ] + ...(development ? developmentPlugins : productionPlugins), + ], }; };