Skip to content

Commit 675222d

Browse files
committed
modernize ESM imports (fixes wq/wq#58)
1 parent d6d6e4f commit 675222d

16 files changed

+330
-26
lines changed

.eslintrc.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@
2424
"ecmaVersion": 2018,
2525
"sourceType": "module"
2626
},
27-
"plugins": ["react", "jest"],
27+
"plugins": ["react", "jest", "import"],
2828
"rules": {
2929
"no-console": "off",
3030
"no-redeclare": "off",
3131
"no-prototype-builtins": "off",
3232
"require-atomic-updates": "off",
33-
"react/prop-types": [2, { "skipUndeclared": true }]
33+
"react/prop-types": [2, { "skipUndeclared": true }],
34+
"import/extensions": [2, "ignorePackages"]
3435
}
3536
}

package-lock.json

+286
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"@rollup/plugin-replace": "^5.0.2",
3131
"@rollup/plugin-terser": "^0.3.0",
3232
"eslint": "^8.32.0",
33+
"eslint-plugin-import": "^2.27.5",
3334
"eslint-plugin-jest": "^27.2.1",
3435
"eslint-plugin-react": "^7.32.1",
3536
"fake-indexeddb": "^4.0.1",

packages/model/src/__tests__/model.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import store from "@wq/store";
2-
import { model } from "../model";
2+
import { model } from "../model.js";
33

44
global.structuredClone = (val) => val;
55

packages/model/src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const orm = {
2626
},
2727
reducer(state, action) {
2828
if (!this._orm) {
29-
return state;
29+
return state || {};
3030
}
3131
return this._orm.reducer(state, action);
3232
},

0 commit comments

Comments
 (0)