-
-
Notifications
You must be signed in to change notification settings - Fork 929
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor
mergeTestDescriptions()
test utility to migrate to ESM (#7035
) `mergeTestDescriptions()` is used by deprecated rules. So I've created this commit from the `v16` branch, instead of the `main` branch. This change enables the `esModuleInterop` flag to prevent the following TypeScript error: ``` lib/testUtils/mergeTestDescriptions.mjs:1:8 - error TS1259: Module '"/Users/masafumi.koba/git/stylelint/stylelint/node_modules/deepmerge/index"' can only be default-imported using the 'esModuleInterop' flag 1 import merge from 'deepmerge'; ~~~~~ node_modules/deepmerge/index.d.ts:20:1 20 export = deepmerge; ~~~~~~~~~~~~~~~~~~~ This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag. ```
- Loading branch information
1 parent
cfa8913
commit 7176474
Showing
7 changed files
with
14 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
...s/__tests__/mergeTestDescriptions.test.js → .../__tests__/mergeTestDescriptions.test.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import merge from 'deepmerge'; | ||
|
||
/** | ||
* @param {...object} args | ||
* @returns {object} | ||
*/ | ||
export default function mergeTestDescriptions(...args) { | ||
return merge.all(args); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters