Skip to content

Commit 953e617

Browse files
authored
Merge pull request #226 from aryaemami59/fix/typos
Fix minor typos
2 parents 2950f9b + c2b596f commit 953e617

File tree

10 files changed

+21
-12
lines changed

10 files changed

+21
-12
lines changed

.changeset/kind-eagles-pay.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@arethetypeswrong/core": patch
3+
"@arethetypeswrong/cli": patch
4+
---
5+
6+
Fix minor typos

docs/problems/NamedExports.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ module.exports = {
4949
import { a } from "./api.cjs";
5050
```
5151

52-
However, TypeScript has no way of knowing, and no way of indicating in a declaration file, whether CommonJS exports are written in a way that will be statically analyzable. It assumes they _will_ be, and so even a completely correct declaration file for `api.cjs` will indicate that `a` can be imported by name. Since there’s no way to make the types more restrictive without making them incomplete, and since the unalyzable export is an inconvenience for all consumers of the JavaScript, the only solution is to fix the JavaScript. If the JavaScript exports can’t be restructured, it’s possible to “hint” the exports to cjs-module-lexer with an assignment that never executes:
52+
However, TypeScript has no way of knowing, and no way of indicating in a declaration file, whether CommonJS exports are written in a way that will be statically analyzable. It assumes they _will_ be, and so even a completely correct declaration file for `api.cjs` will indicate that `a` can be imported by name. Since there’s no way to make the types more restrictive without making them incomplete, and since the unanalyzable export is an inconvenience for all consumers of the JavaScript, the only solution is to fix the JavaScript. If the JavaScript exports can’t be restructured, it’s possible to “hint” the exports to cjs-module-lexer with an assignment that never executes:
5353

5454
```js
5555
module.exports = {

packages/cli/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ In the config file, `format` can be a string value.
149149

150150
```shell
151151
attw --pack . --entrypoints . one two three # Just ".", "./one", "./two", "./three"
152-
attw --pack . --include-entrypoints added # Auto-discovered entyrpoints plus "./added"
152+
attw --pack . --include-entrypoints added # Auto-discovered entrypoints plus "./added"
153153
attw --pack . --exclude-entrypoints styles.css # Auto-discovered entrypoints except "./styles.css"
154154
attw --pack . --entrypoints-legacy # All published code files
155155
```

packages/cli/src/getExitCode.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ export function getExitCode(analysis: CheckResult, opts?: RenderOptions): number
1010
const ignoreResolutions = opts?.ignoreResolutions ?? [];
1111
return analysis.problems.some((problem) => {
1212
const notRuleIgnored = !ignoreRules.includes(problemFlags[problem.kind]);
13-
const notResolutionIgnored = "resolutionKind" in problem ? !ignoreResolutions.includes(problem.resolutionKind) : true;
13+
const notResolutionIgnored =
14+
"resolutionKind" in problem ? !ignoreResolutions.includes(problem.resolutionKind) : true;
1415
return notRuleIgnored && notResolutionIgnored;
15-
}) ? 1 : 0;
16+
})
17+
? 1
18+
: 0;
1619
}

packages/core/src/internal/multiCompilerHost.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ export class CompilerHostWrapper {
204204
{ ...this.compilerOptions, ...extraOptions },
205205
)
206206
) {
207-
throw new Error("Cannot override resolution-affecting options for host due to potential cache polution");
207+
throw new Error("Cannot override resolution-affecting options for host due to potential cache pollution");
208208
}
209209
const options = extraOptions ? { ...this.compilerOptions, ...extraOptions } : this.compilerOptions;
210210
return this.getProgram(rootNames, options);

packages/core/src/problems.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export const problemKindInfo: Record<ProblemKind, ProblemKindInfo> = {
6060
},
6161
FallbackCondition: {
6262
emoji: "🐛",
63-
title: "Resloved through fallback condition",
63+
title: "Resolved through fallback condition",
6464
shortDescription: "Used fallback condition",
6565
description:
6666
"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.",

packages/core/test/problems/exportDefaultDisagreement.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ describe("exportDefaultDisagreement", () => {
108108
parentPath.replaceWith(t.numericLiteral(newValue));
109109
} else {
110110
const line = parentPath.node.loc.start.line;
111-
111+
112112
throw new _babelPluginMacros.MacroError();
113113
}
114114
}
@@ -119,7 +119,7 @@ describe("exportDefaultDisagreement", () => {
119119
);
120120
});
121121

122-
test("lone deafult export is primitive", () => {
122+
test("lone default export is primitive", () => {
123123
assert(
124124
isOk(
125125
`declare const _default: string;
@@ -214,7 +214,7 @@ var index_default = { a, b };`,
214214
);
215215
});
216216

217-
test("ignores unalayzable iife", () => {
217+
test("ignores unanalyzable iife", () => {
218218
assert(
219219
isOk(
220220
`export default function foo(): void`,

packages/core/test/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"lib": ["es2019"],
55
"module": "nodenext",
66
"outDir": "dist",
7-
"types": ["node", "ts-expose-internals"],
7+
"types": ["node", "ts-expose-internals"]
88
},
99
"references": [
1010
{

packages/core/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"module": "nodenext",
1111
"outDir": "dist",
1212
"rootDir": "src",
13-
"types": ["ts-expose-internals"],
13+
"types": ["ts-expose-internals"]
1414
},
1515
"include": ["src"]
1616
}

tsconfig.check-dts.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
"strict": true
66
},
77
"include": ["./packages/core/dist"]
8-
}
8+
}

0 commit comments

Comments
 (0)