Skip to content

Commit

Permalink
docs: fix typos (#15432)
Browse files Browse the repository at this point in the history
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
  • Loading branch information
Lioness100 and JLHwung authored Feb 18, 2023
1 parent 2f3ef39 commit 34136c5
Show file tree
Hide file tree
Showing 105 changed files with 361 additions and 361 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ For example, in [`@babel/plugin-transform-exponentiation-operator/test`](https:/

- In each subfolder, you can organize your directory structure by categories of tests. (Example: these folders can be named after the feature you are testing or can reference the issue number they fix)
- Generally, there are two kinds of tests for plugins
  - The first is a simple test of the input and output produced by running Babel on some code. We do this by creating an [`input.js`](https://github.com/babel/babel/blob/main/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/binary/input.js) file and an [`output.js`](https://github.com/babel/babel/blob/main/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/binary/output.js) file. This kind of test only works in sub-subdirectories of `/fixtures`, i.e. `/fixtures/exponentian-operator/binary/input.js` and **not** `/fixtures/exponentian-operator/input.js`.
  - The first is a simple test of the input and output produced by running Babel on some code. We do this by creating an [`input.js`](https://github.com/babel/babel/blob/main/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/binary/input.js) file and an [`output.js`](https://github.com/babel/babel/blob/main/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/binary/output.js) file. This kind of test only works in sub-subdirectories of `/fixtures`, i.e. `/fixtures/exponentiation-operator/binary/input.js` and **not** `/fixtures/exponentiation-operator/input.js`.
- If you need to expect an error, you can ignore creating the `output.js` file and pass a new `throws` key to the `options.json` that contains the error string that is created.
- The second and preferred type is a test that actually evaluates the produced code and asserts that certain properties are true or false. We do this by creating an [`exec.js`](https://github.com/babel/babel/blob/main/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/comprehensive/exec.js) file.

Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ function pluginImportMetaUrl({ types: t, template }) {
return {
visitor: {
Program(programPath) {
// We must be sure to run this before the instanbul plugins, because its
// We must be sure to run this before the istanbul plugins, because its
// instrumentation breaks our detection.
programPath.traverse({
// fileURLToPath(import.meta.url)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { func1 } from "./iodex.js";
import { func1 } from "./index.js";

export function five() {
return { five: `number(${5})` };
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ module.exports = {
"/test/__data__/",
"<rootDir>/build/",
],
// We don't need module name mappers here as depedencies of workspace
// We don't need module name mappers here as dependencies of workspace
// package should be declared explicitly in the package.json
// Yarn will generate correct file links so that Jest can resolve correctly
moduleNameMapper: null,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"args": ["--whitelist", "nenexistent", "--output-type", "var"]
"args": ["--whitelist", "nonexistent", "--output-type", "var"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ for (const feature of finishedProposals) {
const standardizedName = feature.replace("esnext.", "es.");
if (!builtInDefinitions.includes(standardizedName)) {
console.log(
`${feature} is now standarized as ${standardizedName}, please add "${standardizedName}" to "${builtInDefinitionsPath}"`
`${feature} is now standardized as ${standardizedName}, please add "${standardizedName}" to "${builtInDefinitionsPath}"`
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const importMetaResolveP: Promise<ImportMeta["resolve"]> =
// - we will move to ESM, so that we have direct access to import.meta.resolve, or
// - the V8 bug will be fixed so that we can safely use dynamic import by default.
//
// I (@nicolo-ribaudo) am really anoyed by this bug, because there is no known
// I (@nicolo-ribaudo) am really annoyed by this bug, because there is no known
// work-around other than "don't use dynamic import if you are running in a `vm` context",
// but there is no reliable way to detect it (you cannot try/catch segfaults).
//
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-core/src/config/validation/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export function validatePluginObject(obj: {
const invalidPluginPropertyError = new Error(
`.${key} is not a valid Plugin property`,
);
// @ts-expect-error todo(flow->ts) consider additing BabelConfigError with code field
// @ts-expect-error todo(flow->ts) consider adding BabelConfigError with code field
invalidPluginPropertyError.code = "BABEL_UNKNOWN_PLUGIN_PROPERTY";
throw invalidPluginPropertyError;
}
Expand Down
Loading

0 comments on commit 34136c5

Please sign in to comment.