Skip to content

Commit

Permalink
Merge pull request #223 from jakebailey/fix-should
Browse files Browse the repository at this point in the history
Fix typo in MissingExportEquals message
  • Loading branch information
andrewbranch authored Dec 3, 2024
2 parents 6ea73cd + 1bfc877 commit 1f3381f
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .changeset/eight-turkeys-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@arethetypeswrong/core": patch
"@arethetypeswrong/cli": patch
---

Fix typo in MissingExportEquals message
2 changes: 1 addition & 1 deletion docs/problems/MissingExportEquals.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ❓ Missing `export =`

The JavaScript appears to set both `module.exports` and `module.exports.default` for improved compatibility, but the types only reflect the latter (by using `export default`). This will cause TypeScript under the `node16` module mode to think an extra `.default` property access is required, which will work at runtime but is not necessary. These types `export =` an object with a `default` property instead of using `export default`.
The JavaScript appears to set both `module.exports` and `module.exports.default` for improved compatibility, but the types only reflect the latter (by using `export default`). This will cause TypeScript under the `node16` module mode to think an extra `.default` property access is required, which will work at runtime but is not necessary. These types should `export =` an object with a `default` property instead of using `export default`.

## Explanation

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/snapshots/@[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ $ attw @[email protected] -f table-flipped
@vitejs/plugin-react v3.1.0
❓ The JavaScript appears to set both module.exports and module.exports.default for improved compatibility, but the types only reflect the latter (by using export default). This will cause TypeScript under the node16 module mode to think an extra .default property access is required, which will work at runtime but is not necessary. These types export = an object with a default property instead of using export default. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/MissingExportEquals.md
❓ The JavaScript appears to set both module.exports and module.exports.default for improved compatibility, but the types only reflect the latter (by using export default). This will cause TypeScript under the node16 module mode to think an extra .default property access is required, which will work at runtime but is not necessary. These types should export = an object with a default property instead of using export default. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/MissingExportEquals.md
🎭 Import resolved to a CommonJS type declaration file, but an ESM JavaScript file. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseCJS.md
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/snapshots/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Build tools:
- rollup@^2.44.0
- @rollup/plugin-typescript@^10.0.1
❓ The JavaScript appears to set both module.exports and module.exports.default for improved compatibility, but the types only reflect the latter (by using export default). This will cause TypeScript under the node16 module mode to think an extra .default property access is required, which will work at runtime but is not necessary. These types export = an object with a default property instead of using export default. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/MissingExportEquals.md
❓ The JavaScript appears to set both module.exports and module.exports.default for improved compatibility, but the types only reflect the latter (by using export default). This will cause TypeScript under the node16 module mode to think an extra .default property access is required, which will work at runtime but is not necessary. These types should export = an object with a default property instead of using export default. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/MissingExportEquals.md
┌───────┬───────────────────────┬───────────────────────┬───────────────────────┬───────────────────────┐
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/snapshots/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ $ attw [email protected] -f table-flipped
postcss v8.4.21
❓ The JavaScript appears to set both module.exports and module.exports.default for improved compatibility, but the types only reflect the latter (by using export default). This will cause TypeScript under the node16 module mode to think an extra .default property access is required, which will work at runtime but is not necessary. These types export = an object with a default property instead of using export default. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/MissingExportEquals.md
❓ The JavaScript appears to set both module.exports and module.exports.default for improved compatibility, but the types only reflect the latter (by using export default). This will cause TypeScript under the node16 module mode to think an extra .default property access is required, which will work at runtime but is not necessary. These types should export = an object with a default property instead of using export default. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/MissingExportEquals.md
🐛 Import resolved to types through a conditional package.json export, but only after failing to resolve through an earlier condition. This behavior is a TypeScript bug (https://github.com/microsoft/TypeScript/issues/50762). It may misrepresent the runtime behavior of this import and should not be relied upon. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FallbackCondition.md
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/problems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const problemKindInfo: Record<ProblemKind, ProblemKindInfo> = {
title: "Types are missing an `export =`",
shortDescription: "Missing `export =`",
description:
"The JavaScript appears to set both `module.exports` and `module.exports.default` for improved compatibility, but the types only reflect the latter (by using `export default`). This will cause TypeScript under the `node16` module mode to think an extra `.default` property access is required, which will work at runtime but is not necessary. These types `export =` an object with a `default` property instead of using `export default`.",
"The JavaScript appears to set both `module.exports` and `module.exports.default` for improved compatibility, but the types only reflect the latter (by using `export default`). This will cause TypeScript under the `node16` module mode to think an extra `.default` property access is required, which will work at runtime but is not necessary. These types should `export =` an object with a `default` property instead of using `export default`.",
docsUrl:
"https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/MissingExportEquals.md",
},
Expand Down

0 comments on commit 1f3381f

Please sign in to comment.