diff --git a/docs/animations.md b/docs/animations.md
index 2703dd31323..ccdaa5a32bb 100644
--- a/docs/animations.md
+++ b/docs/animations.md
@@ -549,7 +549,7 @@ The native driver also works with `Animated.event`. This is especially useful fo
```
-You can see the native driver in action by running the [RNTester app](https://github.com/facebook/react-native/blob/main/packages/rn-tester/), then loading the Native Animated Example. You can also take a look at the [source code](https://github.com/facebook/react-native/blob/master/packages/rn-tester/js/examples/NativeAnimation/NativeAnimationsExample.js) to learn how these examples were produced.
+You can see the native driver in action by running the [RNTester app](https://github.com/facebook/react-native/blob/main/packages/rn-tester/), then loading the Native Animated Example. You can also take a look at the [source code](https://github.com/facebook/react-native/blob/main/packages/rn-tester/js/examples/NativeAnimation/NativeAnimationsExample.js) to learn how these examples were produced.
#### Caveats
diff --git a/docs/build-speed.md b/docs/build-speed.md
index bbc21d2aa7d..0db1929f4f3 100644
--- a/docs/build-speed.md
+++ b/docs/build-speed.md
@@ -120,7 +120,7 @@ Ccache works by wrapping the C++ compilers, storing the compilation results, and
if an intermediate compilation result was originally stored.
Ccache is available in the package manager for most operating systems. On macOS, we can install ccache with `brew install ccache`.
-Or you can follow the [official installation instructions](https://github.com/ccache/ccache/blob/master/doc/INSTALL.md) to install from source.
+Or you can follow the [official installation instructions](https://github.com/ccache/ccache/blob/master/doc/install.md) to install from source.
You can then do two clean builds (e.g. on Android you can first run `yarn react-native run-android`, delete the `android/app/build` folder and run the first command once more). You will notice that the second build was way faster than the first one (it should take seconds rather than minutes).
While building, you can verify that `ccache` works correctly and check the cache hits/miss rate `ccache -s`
diff --git a/docs/debugging-release-builds.md b/docs/debugging-release-builds.md
index 7e74f55eccc..6d655859a78 100644
--- a/docs/debugging-release-builds.md
+++ b/docs/debugging-release-builds.md
@@ -20,7 +20,7 @@ If a React Native app throws an unhandled exception in a release build, the outp
In the above stack trace, entries like `p@1:132161` are minified function names and bytecode offsets. To debug these calls, we want to translate these into file, line, and function name, e.g. `AwesomeProject/App.js:54:initializeMap`. This is known as **symbolication.**
-You can symbolicate minified function names and bytecode like the above by passing the stack trace and a generated source map to [`metro-symbolicate`](http://npmjs.com/package/metro-symbolicate).
+You can symbolicate minified function names and bytecode like the above by passing the stack trace and a generated source map to [`metro-symbolicate`](https://www.npmjs.com/package/metro-symbolicate).
### Enabling source maps
diff --git a/docs/element-nodes.md b/docs/element-nodes.md
index 1c0d639f3f0..fb3f5667481 100644
--- a/docs/element-nodes.md
+++ b/docs/element-nodes.md
@@ -84,9 +84,9 @@ From [`Element`](https://developer.mozilla.org/en-US/docs/Web/API/Element):
- ℹ️ Returns the value of the `id` or `nativeID` props.
- [`lastElementChild`](https://developer.mozilla.org/en-US/docs/Web/API/Element/lastElementChild)
- [`nextElementSibling`](https://developer.mozilla.org/en-US/docs/Web/API/Element/nextElementSibling)
- - [`nodeName`](https://developer.mozilla.org/en-US/docs/Web/API/Element/nodeName)
- - [`nodeType`](https://developer.mozilla.org/en-US/docs/Web/API/Element/nodeType)
- - [`nodeValue`](https://developer.mozilla.org/en-US/docs/Web/API/Element/nodeValue)
+ - [`nodeName`](https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeName)
+ - [`nodeType`](https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType)
+ - [`nodeValue`](https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeValue)
- [`previousElementSibling`](https://developer.mozilla.org/en-US/docs/Web/API/Element/previousElementSibling)
- [`scrollHeight`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight)
- [`scrollLeft`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft)
@@ -96,7 +96,7 @@ From [`Element`](https://developer.mozilla.org/en-US/docs/Web/API/Element):
- [`scrollWidth`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollWidth)
- [`tagName`](https://developer.mozilla.org/en-US/docs/Web/API/Element/tagName)
- ℹ️ Returns a normalized native component name prefixed with `RN:`, like `RN:View`.
- - [`textContent`](https://developer.mozilla.org/en-US/docs/Web/API/Element/textContent)
+ - [`textContent`](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent)
- Methods
- [`getBoundingClientRect()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect)
- [`hasPointerCapture()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/hasPointerCapture)
diff --git a/docs/images.md b/docs/images.md
index 0fef5961073..3a57eda7d66 100644
--- a/docs/images.md
+++ b/docs/images.md
@@ -67,7 +67,7 @@ Note that image sources required this way include size (width, height) info for
## Static Non-Image Resources
-The `require` syntax described above can be used to statically include audio, video or document files in your project as well. Most common file types are supported including `.mp3`, `.wav`, `.mp4`, `.mov`, `.html` and `.pdf`. See [bundler defaults](https://github.com/facebook/metro/blob/master/packages/metro-config/src/defaults/defaults.js#L14-L44) for the full list.
+The `require` syntax described above can be used to statically include audio, video or document files in your project as well. Most common file types are supported including `.mp3`, `.wav`, `.mp4`, `.mov`, `.html`, `.pdf` and more. See [bundler defaults](https://github.com/facebook/metro/blob/main/packages/metro-config/src/defaults/defaults.js#L16-L51) for the full list.
You can add support for other types by adding an [`assetExts` resolver option](https://metrobundler.dev/docs/configuration#resolver-options) in your [Metro configuration](https://metrobundler.dev/docs/configuration).
diff --git a/docs/testing-overview.md b/docs/testing-overview.md
index 59562fae587..5480ea0f2a6 100644
--- a/docs/testing-overview.md
+++ b/docs/testing-overview.md
@@ -245,7 +245,7 @@ Snapshots have several weak points:
Snapshots themselves do not ensure that your component render logic is correct, they are merely good at guarding against unexpected changes and for checking that the components in the React tree under test receive the expected props (styles and etc.).
-We recommend that you only use small snapshots (see [`no-large-snapshots` rule](https://github.com/jest-community/eslint-plugin-jest/blob/master/docs/rules/no-large-snapshots.md)). If you want to test a _change_ between two React component states, use [`snapshot-diff`](https://github.com/jest-community/snapshot-diff). When in doubt, prefer explicit expectations as described in the previous paragraph.
+We recommend that you only use small snapshots (see [`no-large-snapshots` rule](https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-large-snapshots.md)). If you want to test a _change_ between two React component states, use [`snapshot-diff`](https://github.com/jest-community/snapshot-diff). When in doubt, prefer explicit expectations as described in the previous paragraph.
diff --git a/plugins/remark-lint-no-dead-urls/src/__tests__/index.ts b/plugins/remark-lint-no-dead-urls/src/__tests__/index.ts
index dc7c8d96d32..0658bf0ec57 100644
--- a/plugins/remark-lint-no-dead-urls/src/__tests__/index.ts
+++ b/plugins/remark-lint-no-dead-urls/src/__tests__/index.ts
@@ -8,6 +8,7 @@
import {remark} from 'remark';
import dedent from 'dedent';
import {jest, describe, beforeEach, test, expect} from '@jest/globals';
+import {Options} from '../index.ts';
const mockFetch = jest.fn() as jest.MockedFunction<
(url: string, method: unknown, options?: object) => Promise
@@ -19,7 +20,7 @@ jest.unstable_mockModule('../lib.ts', () => ({
const plugin = (await import('../index.ts')).default;
-function processMarkdown(md: string, opts = {}) {
+function processMarkdown(md: string, opts: Options = {}) {
return remark().use(plugin, opts).process(md);
}
diff --git a/plugins/remark-lint-no-dead-urls/src/index.ts b/plugins/remark-lint-no-dead-urls/src/index.ts
index a1f898fc4fc..c623f6a8e51 100644
--- a/plugins/remark-lint-no-dead-urls/src/index.ts
+++ b/plugins/remark-lint-no-dead-urls/src/index.ts
@@ -7,14 +7,20 @@
// Forked from: https://github.com/davidtheclark/remark-lint-no-dead-urls
-import {Method, RequestError} from 'got';
-import {Root} from 'mdast';
+import {type Method, RequestError} from 'got';
import {URL} from 'node:url';
import {lintRule} from 'unified-lint-rule';
import {visit} from 'unist-util-visit';
-import type {VFile} from 'vfile';
+import {type VFile} from 'vfile';
import {fetch} from './lib.ts';
+import type {MDASTNode} from './types.d.ts';
+
+export type Options = {
+ baseUrl?: string;
+ skipUrlPatterns?: RegExp[];
+ headers?: Record;
+};
const linkCache = new Map();
@@ -32,11 +38,7 @@ const uri = {
isPath: (url: string) => /^\/.*/.test(url),
};
-async function cacheFetch(
- urlOrPath: string,
- method: Method,
- options: {baseUrl?: string} & Record
-) {
+async function cacheFetch(urlOrPath: string, method: Method, options: Options) {
if (linkCache.has(urlOrPath)) {
return [urlOrPath, linkCache.get(urlOrPath)];
}
@@ -50,10 +52,7 @@ async function cacheFetch(
return [urlOrPath, code];
}
-async function naiveLinkCheck(
- urls: string[],
- options: {baseUrl?: string} & Record
-) {
+async function naiveLinkCheck(urls: string[], options: Options) {
return Promise.allSettled(
urls.map(async url => {
try {
@@ -62,11 +61,11 @@ async function naiveLinkCheck(
try {
// Fallback, some endpoints don't support HEAD requests
return await cacheFetch(url, 'GET', options);
- } catch (e) {
- if (!(e instanceof RequestError)) {
- throw e;
+ } catch (err) {
+ if (!(err instanceof RequestError)) {
+ throw err;
}
- const code = e.response?.statusCode ?? e.code;
+ const code = err.response?.statusCode ?? err.code;
linkCache.set(url, code);
return [url, code];
}
@@ -75,14 +74,7 @@ async function naiveLinkCheck(
);
}
-async function noDeadUrls(
- ast: Root,
- file: VFile,
- options: {
- skipUrlPatterns?: string[];
- baseUrl?: string;
- } & Record = {}
-) {
+async function noDeadUrls(ast: MDASTNode, file: VFile, options: Options) {
const urlToNodes = new Map();
const {skipUrlPatterns, ...clientOptions} = options;
diff --git a/plugins/remark-lint-no-dead-urls/src/lib.ts b/plugins/remark-lint-no-dead-urls/src/lib.ts
index 0dfdcd6cc43..164b53f5f5d 100644
--- a/plugins/remark-lint-no-dead-urls/src/lib.ts
+++ b/plugins/remark-lint-no-dead-urls/src/lib.ts
@@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
-import got, {Method} from 'got';
+import got, {type Method} from 'got';
export async function fetch(url: string, method: Method, options = {}) {
const {statusCode} = await got(url, {
diff --git a/plugins/remark-lint-no-dead-urls/src/types.d.ts b/plugins/remark-lint-no-dead-urls/src/types.d.ts
new file mode 100644
index 00000000000..6440c3b0a1e
--- /dev/null
+++ b/plugins/remark-lint-no-dead-urls/src/types.d.ts
@@ -0,0 +1 @@
+export {type Node as MDASTNode} from 'mdast';
diff --git a/website/versioned_docs/version-0.83/animations.md b/website/versioned_docs/version-0.83/animations.md
index 2703dd31323..ccdaa5a32bb 100644
--- a/website/versioned_docs/version-0.83/animations.md
+++ b/website/versioned_docs/version-0.83/animations.md
@@ -549,7 +549,7 @@ The native driver also works with `Animated.event`. This is especially useful fo
```
-You can see the native driver in action by running the [RNTester app](https://github.com/facebook/react-native/blob/main/packages/rn-tester/), then loading the Native Animated Example. You can also take a look at the [source code](https://github.com/facebook/react-native/blob/master/packages/rn-tester/js/examples/NativeAnimation/NativeAnimationsExample.js) to learn how these examples were produced.
+You can see the native driver in action by running the [RNTester app](https://github.com/facebook/react-native/blob/main/packages/rn-tester/), then loading the Native Animated Example. You can also take a look at the [source code](https://github.com/facebook/react-native/blob/main/packages/rn-tester/js/examples/NativeAnimation/NativeAnimationsExample.js) to learn how these examples were produced.
#### Caveats
diff --git a/website/versioned_docs/version-0.83/build-speed.md b/website/versioned_docs/version-0.83/build-speed.md
index bbc21d2aa7d..0db1929f4f3 100644
--- a/website/versioned_docs/version-0.83/build-speed.md
+++ b/website/versioned_docs/version-0.83/build-speed.md
@@ -120,7 +120,7 @@ Ccache works by wrapping the C++ compilers, storing the compilation results, and
if an intermediate compilation result was originally stored.
Ccache is available in the package manager for most operating systems. On macOS, we can install ccache with `brew install ccache`.
-Or you can follow the [official installation instructions](https://github.com/ccache/ccache/blob/master/doc/INSTALL.md) to install from source.
+Or you can follow the [official installation instructions](https://github.com/ccache/ccache/blob/master/doc/install.md) to install from source.
You can then do two clean builds (e.g. on Android you can first run `yarn react-native run-android`, delete the `android/app/build` folder and run the first command once more). You will notice that the second build was way faster than the first one (it should take seconds rather than minutes).
While building, you can verify that `ccache` works correctly and check the cache hits/miss rate `ccache -s`
diff --git a/website/versioned_docs/version-0.83/debugging-release-builds.md b/website/versioned_docs/version-0.83/debugging-release-builds.md
index 7e74f55eccc..6d655859a78 100644
--- a/website/versioned_docs/version-0.83/debugging-release-builds.md
+++ b/website/versioned_docs/version-0.83/debugging-release-builds.md
@@ -20,7 +20,7 @@ If a React Native app throws an unhandled exception in a release build, the outp
In the above stack trace, entries like `p@1:132161` are minified function names and bytecode offsets. To debug these calls, we want to translate these into file, line, and function name, e.g. `AwesomeProject/App.js:54:initializeMap`. This is known as **symbolication.**
-You can symbolicate minified function names and bytecode like the above by passing the stack trace and a generated source map to [`metro-symbolicate`](http://npmjs.com/package/metro-symbolicate).
+You can symbolicate minified function names and bytecode like the above by passing the stack trace and a generated source map to [`metro-symbolicate`](https://www.npmjs.com/package/metro-symbolicate).
### Enabling source maps
diff --git a/website/versioned_docs/version-0.83/element-nodes.md b/website/versioned_docs/version-0.83/element-nodes.md
index 1c0d639f3f0..fb3f5667481 100644
--- a/website/versioned_docs/version-0.83/element-nodes.md
+++ b/website/versioned_docs/version-0.83/element-nodes.md
@@ -84,9 +84,9 @@ From [`Element`](https://developer.mozilla.org/en-US/docs/Web/API/Element):
- ℹ️ Returns the value of the `id` or `nativeID` props.
- [`lastElementChild`](https://developer.mozilla.org/en-US/docs/Web/API/Element/lastElementChild)
- [`nextElementSibling`](https://developer.mozilla.org/en-US/docs/Web/API/Element/nextElementSibling)
- - [`nodeName`](https://developer.mozilla.org/en-US/docs/Web/API/Element/nodeName)
- - [`nodeType`](https://developer.mozilla.org/en-US/docs/Web/API/Element/nodeType)
- - [`nodeValue`](https://developer.mozilla.org/en-US/docs/Web/API/Element/nodeValue)
+ - [`nodeName`](https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeName)
+ - [`nodeType`](https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType)
+ - [`nodeValue`](https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeValue)
- [`previousElementSibling`](https://developer.mozilla.org/en-US/docs/Web/API/Element/previousElementSibling)
- [`scrollHeight`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight)
- [`scrollLeft`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft)
@@ -96,7 +96,7 @@ From [`Element`](https://developer.mozilla.org/en-US/docs/Web/API/Element):
- [`scrollWidth`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollWidth)
- [`tagName`](https://developer.mozilla.org/en-US/docs/Web/API/Element/tagName)
- ℹ️ Returns a normalized native component name prefixed with `RN:`, like `RN:View`.
- - [`textContent`](https://developer.mozilla.org/en-US/docs/Web/API/Element/textContent)
+ - [`textContent`](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent)
- Methods
- [`getBoundingClientRect()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect)
- [`hasPointerCapture()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/hasPointerCapture)
diff --git a/website/versioned_docs/version-0.83/images.md b/website/versioned_docs/version-0.83/images.md
index 0fef5961073..3a57eda7d66 100644
--- a/website/versioned_docs/version-0.83/images.md
+++ b/website/versioned_docs/version-0.83/images.md
@@ -67,7 +67,7 @@ Note that image sources required this way include size (width, height) info for
## Static Non-Image Resources
-The `require` syntax described above can be used to statically include audio, video or document files in your project as well. Most common file types are supported including `.mp3`, `.wav`, `.mp4`, `.mov`, `.html` and `.pdf`. See [bundler defaults](https://github.com/facebook/metro/blob/master/packages/metro-config/src/defaults/defaults.js#L14-L44) for the full list.
+The `require` syntax described above can be used to statically include audio, video or document files in your project as well. Most common file types are supported including `.mp3`, `.wav`, `.mp4`, `.mov`, `.html`, `.pdf` and more. See [bundler defaults](https://github.com/facebook/metro/blob/main/packages/metro-config/src/defaults/defaults.js#L16-L51) for the full list.
You can add support for other types by adding an [`assetExts` resolver option](https://metrobundler.dev/docs/configuration#resolver-options) in your [Metro configuration](https://metrobundler.dev/docs/configuration).
diff --git a/website/versioned_docs/version-0.83/testing-overview.md b/website/versioned_docs/version-0.83/testing-overview.md
index 59562fae587..5480ea0f2a6 100644
--- a/website/versioned_docs/version-0.83/testing-overview.md
+++ b/website/versioned_docs/version-0.83/testing-overview.md
@@ -245,7 +245,7 @@ Snapshots have several weak points:
Snapshots themselves do not ensure that your component render logic is correct, they are merely good at guarding against unexpected changes and for checking that the components in the React tree under test receive the expected props (styles and etc.).
-We recommend that you only use small snapshots (see [`no-large-snapshots` rule](https://github.com/jest-community/eslint-plugin-jest/blob/master/docs/rules/no-large-snapshots.md)). If you want to test a _change_ between two React component states, use [`snapshot-diff`](https://github.com/jest-community/snapshot-diff). When in doubt, prefer explicit expectations as described in the previous paragraph.
+We recommend that you only use small snapshots (see [`no-large-snapshots` rule](https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-large-snapshots.md)). If you want to test a _change_ between two React component states, use [`snapshot-diff`](https://github.com/jest-community/snapshot-diff). When in doubt, prefer explicit expectations as described in the previous paragraph.