Skip to content

Commit 85fdfc4

Browse files
committed
#270 Allow node imports in data-browser
1 parent 881c345 commit 85fdfc4

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ module.exports = {
5252
'comma-dangle': 'off', // https://eslint.org/docs/rules/comma-dangle
5353
'function-paren-newline': 'off', // https://eslint.org/docs/rules/function-paren-newline
5454
'global-require': 'off', // https://eslint.org/docs/rules/global-require
55-
"import/extensions": ["error", "ignorePackages"],
55+
// Turn this on when we have migrated all import paths to use `.js`
56+
// "import/extensions": ["error", "ignorePackages"],
5657
"import/no-unresolved": "off",
5758
'import/no-dynamic-require': 'off', // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-dynamic-require.md
5859
'no-inner-declarations': 'off', // https://eslint.org/docs/rules/no-inner-declarations// New rules

data-browser/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,6 @@
7272
"test-query": "PWDEBUG=1 npx playwright test \"e2e.spec.ts\" -g",
7373
"typecheck": "tsc --noEmit"
7474
},
75+
"type": "module",
7576
"version": "0.34.0"
7677
}

data-browser/src/helpers/AppSettings.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import React, { ReactNode } from 'react';
2-
import { useContext } from 'react';
1+
import React, { ReactNode, useContext } from 'react';
32
import { DarkModeOption, useDarkMode } from './useDarkMode';
43
import {
54
useLocalStorage,

data-browser/tsconfig.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"extends": "../tsconfig.build.json",
33
"compilerOptions": {
44
"composite": true,
5+
// We overwrite this so we don't have to use `.js` extensions in imports
6+
"moduleResolution": "node",
57
"outDir": "./dist",
68
"strictNullChecks": true,
79
},

0 commit comments

Comments
 (0)