Skip to content

Commit

Permalink
Set resolveJsonModule to true in tsconfig, and replace require with i…
Browse files Browse the repository at this point in the history
…mport for importing JSON
  • Loading branch information
Filip Maj committed Aug 10, 2021
1 parent 1e838c7 commit c92a332
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ import { IncomingEventType, getTypeAndConversation, assertNever } from './helper
import { CodedError, asCodedError, AppInitializationError, MultipleListenerError } from './errors';
// eslint-disable-next-line import/order
import allSettled = require('promise.allsettled'); // eslint-disable-line @typescript-eslint/no-require-imports
// eslint-disable-next-line @typescript-eslint/no-require-imports
const packageJson = require('../package.json'); // eslint-disable-line @typescript-eslint/no-var-requires
import packageJson from '../package.json';

// ----------------------------
// For listener registration methods
Expand Down
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pleaseUpgradeNode from 'please-upgrade-node';
// eslint-disable-next-line @typescript-eslint/no-require-imports
const packageJson = require('../package.json'); // eslint-disable-line @typescript-eslint/no-var-requires
import packageJson from '../package.json';

pleaseUpgradeNode(packageJson);

Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* Basic Options */
"target": "ES2018", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
// "resolveJsonModule": true,
"resolveJsonModule": true,
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
Expand Down

0 comments on commit c92a332

Please sign in to comment.