Skip to content

Commit 35de18f

Browse files
chore: Add file extensions
1 parent 8c2759f commit 35de18f

File tree

68 files changed

+166
-141
lines changed

Some content is hidden

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

68 files changed

+166
-141
lines changed

.eslintrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"plugin:@typescript-eslint/recommended",
66
"plugin:react/recommended",
77
"plugin:prettier/recommended",
8-
"plugin:no-unsanitized/DOM"
8+
"plugin:no-unsanitized/DOM",
9+
"plugin:require-extensions/recommended",
910
],
1011
"parserOptions": {
1112
"ecmaVersion": 2018,
@@ -14,7 +15,7 @@
1415
"jsx": true
1516
}
1617
},
17-
"plugins": ["unicorn", "react-hooks", "no-unsanitized", "header"],
18+
"plugins": ["unicorn", "react-hooks", "no-unsanitized", "header", "require-extensions"],
1819
"rules": {
1920
"@typescript-eslint/no-empty-function": "off",
2021
"@typescript-eslint/no-namespace": "off",

package-lock.json

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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"eslint-plugin-prettier": "^3.4.1",
6262
"eslint-plugin-react": "^7.26.1",
6363
"eslint-plugin-react-hooks": "^4.2.0",
64+
"eslint-plugin-require-extensions": "^0.1.3",
6465
"eslint-plugin-unicorn": "^45.0.2",
6566
"husky": "^9.0.0",
6667
"jest": "^29.7.0",

scripts/prepare-package-lock.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
// SPDX-License-Identifier: Apache-2.0
44

5-
const fs = require('fs');
6-
const path = require('path');
5+
import fs from 'fs';
6+
import path from 'path';
7+
8+
const __dirname = path.resolve(import.meta.dirname);
79

810
/**
911
* Remove specific @cloudscape-design/* packages where we should always use the latest minor release.

src/container-queries/__tests__/use-container-query.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
import React from 'react';
55
import { render } from '@testing-library/react';
6-
import useContainerQuery from '../use-container-query';
6+
import useContainerQuery from '../use-container-query.js';
77
import { ResizeObserver } from '@juggle/resize-observer';
8-
import { ContainerQueryEntry } from '../interfaces';
8+
import { ContainerQueryEntry } from '../interfaces.js';
99

1010
function TestComponent({ mapFn = () => '' }: { mapFn?: (entry: ContainerQueryEntry) => string }) {
1111
const [value, ref] = useContainerQuery(mapFn);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
export { ContainerQueryEntry, ElementReference } from '../internal/container-queries/interfaces';
4+
export { ContainerQueryEntry, ElementReference } from '../internal/container-queries/interfaces.js';

src/container-queries/use-container-query.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
import React, { useRef, useState, useCallback } from 'react';
5-
import { ContainerQueryEntry } from './interfaces';
6-
import { useResizeObserver } from '../internal/container-queries/use-resize-observer';
5+
import { ContainerQueryEntry } from './interfaces.js';
6+
import { useResizeObserver } from '../internal/container-queries/use-resize-observer.js';
77

88
/**
99
* Attaches resize-observer to the referenced element and keeps last observation in state.

src/dom/__tests__/element-types.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
import { isNode, isHTMLElement, isSVGElement } from '../element-types';
4+
import { isNode, isHTMLElement, isSVGElement } from '../element-types.js';
55

66
test('an HTMLElement is recognized as a Node and HTMLElement', () => {
77
const div = document.createElement('div');

src/dom/__tests__/find-up-until.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
import findUpUntil from '../find-up-until';
4+
import findUpUntil from '../find-up-until.js';
55

66
test('returns null if there is no match', () => {
77
const div = document.createElement('div');

src/dom/__tests__/node-belongs.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
import nodeBelongs from '../node-belongs';
4+
import nodeBelongs from '../node-belongs.js';
55

66
describe('nodeBelongs', () => {
77
let div: HTMLDivElement;

0 commit comments

Comments
 (0)