Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"jsx": true
}
},
"plugins": ["unicorn", "react-hooks", "no-unsanitized", "header"],
"plugins": ["unicorn", "react-hooks", "no-unsanitized", "header", "import"],
"rules": {
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-namespace": "off",
Expand Down Expand Up @@ -59,7 +59,8 @@
[" Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.", " SPDX-License-Identifier: Apache-2.0"],
2
],
"no-warning-comments": "warn"
"no-warning-comments": "warn",
"import/extensions": ["error", "ignorePackages"]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need ".js" extensions so that mjs imports are resolved correctly. Without that, the downstream builds fail. The same issue exists in the collection-hooks. As a follow-up change, I plan to apply the same changes to the collection-hooks eslint config.

},
"settings": {
"react": {
Expand All @@ -77,7 +78,7 @@
},
"overrides": [
{
"files": ["*.js"],
"files": ["*.js", "*.cjs"],
"rules": {
"@typescript-eslint/no-var-requires": "off"
},
Expand All @@ -92,6 +93,12 @@
"jest": true
}
},
{
"files": ["**/__tests__/**", "./test-pages/**"],
"rules": {
"import/extensions": ["off"]
}
},
{
"files": ["**/__integ__/**"],
"rules": {
Expand Down
6 changes: 3 additions & 3 deletions jest.integ.config.js → jest.integ.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ module.exports = {
},
testTimeout: 60_000, // 1min
maxWorkers: os.cpus().length,
globalSetup: '<rootDir>/jest/global-setup.js',
globalTeardown: '<rootDir>/jest/global-teardown.js',
setupFilesAfterEnv: ['<rootDir>/jest/integ-setup.js'],
globalSetup: '<rootDir>/jest/global-setup.cjs',
globalTeardown: '<rootDir>/jest/global-teardown.cjs',
setupFilesAfterEnv: ['<rootDir>/jest/integ-setup.cjs'],
moduleFileExtensions: ['js', 'ts'],
testRegex: '(/(__integ__)/.*(\\.|/)test)\\.[jt]sx?$',
};
5 changes: 4 additions & 1 deletion jest.unit.config.js → jest.unit.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ module.exports = merge({}, cloudscapePreset, {
},
],
},
setupFilesAfterEnv: ['<rootDir>/jest/unit-setup.js'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
setupFilesAfterEnv: ['<rootDir>/jest/unit-setup.cjs'],
testRegex: '(/__tests__/.*(\\.|/)test)\\.[jt]sx?$',
});
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
219 changes: 219 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading