Skip to content

Commit

Permalink
Prepare migration to ESM (#1022)
Browse files Browse the repository at this point in the history
  • Loading branch information
sonnyp authored Dec 20, 2024
1 parent a8b2b4f commit 02f0f49
Show file tree
Hide file tree
Showing 46 changed files with 780 additions and 990 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@ jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [14.x, 16.x, 18.x, 20.x, 22.x]
# Do not support --experimental-require-module
# Commented until we have a solution to run tests without it
# node-version: [14, 16, 18, 20, 22]
# node-version: [20, 22] // fails on 20 with (0 , _getDomain.default) is not a function
node: [22]
steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
Expand Down
1 change: 1 addition & 0 deletions ava.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default {
],
},
},
nodeArguments: ["--experimental-require-module"],
files: [
"packages/**/test.js",
"packages/**/test/*.js",
Expand Down
1 change: 1 addition & 0 deletions e2e.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ export default {
],
},
},
nodeArguments: ["--experimental-require-module"],
files: ["test/*.js"],
};
13 changes: 8 additions & 5 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default [
jsx: true,
},
},
sourceType: "script",
sourceType: "commonjs",
},

rules: {
Expand Down Expand Up @@ -65,6 +65,10 @@ export default [
"error",
{ allowModules: ["ava", "sinon", "@xmpp/test"] },
],
"n/no-extraneous-import": [
"error",
{ allowModules: ["ava", "sinon", "@xmpp/test"] },
],

// promise
// https://github.com/xjamundx/eslint-plugin-promise
Expand All @@ -88,10 +92,9 @@ export default [
},
},
{
files: ["server/ctl.js"],
rules: {
"n/no-unsupported-features/es-syntax": "off",
"n/no-unsupported-features/es-syntax": "off",
files: ["packages/client/**/*.js"],
languageOptions: {
sourceType: "module",
},
},
];
Loading

0 comments on commit 02f0f49

Please sign in to comment.