Skip to content

Commit 9ceede1

Browse files
authored
chore: Use type: "module" and build to cjs/mjs (#190)
1 parent 012284d commit 9ceede1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+431
-145
lines changed

.eslintrc

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"jsx": true
1515
}
1616
},
17-
"plugins": ["unicorn", "react-hooks", "no-unsanitized", "header"],
17+
"plugins": ["unicorn", "react-hooks", "no-unsanitized", "header", "import"],
1818
"rules": {
1919
"@typescript-eslint/no-empty-function": "off",
2020
"@typescript-eslint/no-namespace": "off",
@@ -59,7 +59,8 @@
5959
[" Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.", " SPDX-License-Identifier: Apache-2.0"],
6060
2
6161
],
62-
"no-warning-comments": "warn"
62+
"no-warning-comments": "warn",
63+
"import/extensions": ["error", "ignorePackages"]
6364
},
6465
"settings": {
6566
"react": {
@@ -77,7 +78,7 @@
7778
},
7879
"overrides": [
7980
{
80-
"files": ["*.js"],
81+
"files": ["*.js", "*.cjs"],
8182
"rules": {
8283
"@typescript-eslint/no-var-requires": "off"
8384
},
@@ -92,6 +93,12 @@
9293
"jest": true
9394
}
9495
},
96+
{
97+
"files": ["**/__tests__/**", "./test-pages/**"],
98+
"rules": {
99+
"import/extensions": ["off"]
100+
}
101+
},
95102
{
96103
"files": ["**/__integ__/**"],
97104
"rules": {
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ module.exports = {
1616
},
1717
testTimeout: 60_000, // 1min
1818
maxWorkers: os.cpus().length,
19-
globalSetup: '<rootDir>/jest/global-setup.js',
20-
globalTeardown: '<rootDir>/jest/global-teardown.js',
21-
setupFilesAfterEnv: ['<rootDir>/jest/integ-setup.js'],
19+
globalSetup: '<rootDir>/jest/global-setup.cjs',
20+
globalTeardown: '<rootDir>/jest/global-teardown.cjs',
21+
setupFilesAfterEnv: ['<rootDir>/jest/integ-setup.cjs'],
2222
moduleFileExtensions: ['js', 'ts'],
2323
testRegex: '(/(__integ__)/.*(\\.|/)test)\\.[jt]sx?$',
2424
};
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ module.exports = merge({}, cloudscapePreset, {
1717
},
1818
],
1919
},
20-
setupFilesAfterEnv: ['<rootDir>/jest/unit-setup.js'],
20+
moduleNameMapper: {
21+
'^(\\.{1,2}/.*)\\.js$': '$1',
22+
},
23+
setupFilesAfterEnv: ['<rootDir>/jest/unit-setup.cjs'],
2124
testRegex: '(/__tests__/.*(\\.|/)test)\\.[jt]sx?$',
2225
});
File renamed without changes.

package-lock.json

Lines changed: 219 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)