Skip to content

Commit 448508f

Browse files
committed
Add markdownlint
1 parent b3f1562 commit 448508f

File tree

134 files changed

+408
-271
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+408
-271
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# READ ME PLEASE!
1+
# READ ME PLEASE
22

3-
### TL;DR: Make sure to add your changes to versioned docs
3+
> **TL;DR: Make sure to add your changes to versioned docs**
44
55
Thanks for opening a PR!
66

.github/workflows/autofix.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: autofix.ci
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
autofix:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
21+
- name: Setup
22+
uses: ./.github/actions/setup
23+
24+
- name: Fix lint issues
25+
run: yarn markdownlint-cli2-fix
26+
27+
- name: Autofix
28+
uses: autofix-ci/action@8106fde54b877517c9af2c3d68918ddeaa7bed64

.github/workflows/ci.yml

+3
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@ jobs:
1414
- name: Setup
1515
uses: ./.github/actions/setup
1616

17+
- name: Lint markdown
18+
run: yarn markdownlint-cli2
19+
1720
- name: Build pages
1821
run: yarn build

.markdownlint-cli2.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
globs:
2+
- '**/*.md'
3+
ignores:
4+
- node_modules
5+
- versioned_docs/version-1.x
6+
- versioned_docs/version-2.x
7+
- versioned_docs/version-3.x
8+
- versioned_docs/version-4.x

.markdownlint.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
default: true
2+
3+
# Disable checks for line length
4+
MD013: false
5+
6+
# Disable checks for inline HTML
7+
MD033: false

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<h2 align="center"><a href="https://reactnavigation.org/"> <img src="static/img/react_navigation_header.png" width="400" /> </a></h2>
2-
1+
<h1 align="center"><a href="https://reactnavigation.org/"> <img src="static/img/react_navigation_header.png" width="400" /> </a></h1>
32

43
Want to help improve the documentation? That would be so very much appreciated. Some information on that below.
54

@@ -52,4 +51,5 @@ yarn deploy
5251
```
5352

5453
## License
55-
[MIT License](LICENSE)
54+
55+
[MIT License](LICENSE)

blog/2018-04-06-react-navigation-2.0-rc.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ Exactly two months after the release of React Navigation 1.0, we are close to an
1111

1212
<!--truncate-->
1313

14-
```
14+
```sh
1515
yarn add react-navigation@^2.0.0-rc.1
1616
```
1717

18-
The documentation for 2.0 is available at https://reactnavigation.org/
18+
The documentation for 2.0 is available at <https://reactnavigation.org/>
1919

2020
We’re bumping the major version because some of the changes in this release are backwards incompatible. That said, this should be a fairly easy upgrade. We are improving React Navigation incrementally because we don't want to leave developers feeling stranded in an old version. If you use React Navigation in a conventional way and don't have any custom navigators, I can't imagine this update would take you more than an hour.
2121

@@ -63,7 +63,7 @@ The following APIs are deprecated and will be removed in 3.0.
6363

6464
### XNavigator is now named createXNavigator
6565

66-
```
66+
```js
6767
import { createStackNavigator } from ‘react-navigation’;
6868
createStackNavigator({routeName: Screen});
6969
```
@@ -77,5 +77,5 @@ This change was made to improve the ease of learning and understanding the libra
7777
## New feature highlights
7878

7979
- State persistence - automatically save state and reload it when the app restarts. See [state persistence docs](docs/state-persistence)
80-
- Transitions between screens in stack with headers and without headers now animates as expected on iOS. https://github.com/react-navigation/react-navigation/pull/3821. Thanks [skevy](https://github.com/skevy)!
80+
- Transitions between screens in stack with headers and without headers now animates as expected on iOS. <https://github.com/react-navigation/react-navigation/pull/3821>. Thanks [skevy](https://github.com/skevy)!
8181
- As mentioned above, `createMaterialBottomNavigator` is a new navigator type that provides the material design bottom tab bar pattern.

blog/2018-05-07-react-navigation-2.0.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author_image_url: https://avatars0.githubusercontent.com/u/90494?s=200&v=4
77
tags: [release, announcement]
88
---
99

10-
The documentation is now live at https://reactnavigation.org, and v1 lives [here](/docs/1.x/getting-started).
10+
The documentation is now live at <https://reactnavigation.org>, and v1 lives [here](/docs/1.x/getting-started).
1111

1212
<!--truncate-->
1313

@@ -63,7 +63,7 @@ Given that we only exposed generic helpers (`navigate`, `goBack`) and helpers sp
6363

6464
One of the big improvements you get from this is that you can now add your own helpers to the `navigation` prop! Read more in [RFC 6](https://github.com/react-navigation/rfcs/blob/master/text/0006-action-creators.md) and in [pull 3392](https://github.com/react-navigation/react-navigation/pull/3392).
6565

66-
### NavigationActions no longer have `toString()` implementations ([related](https://github.com/react-navigation/react-navigation/issues/4072))
66+
### NavigationActions no longer have `toString()` implementations ([related](https://github.com/react-navigation/react-navigation/issues/4072))
6767

6868
This change was intended to simplify the implementation of actions. We may go back on this, however, and apologize in advance if this thrasing causes you trouble.
6969

@@ -73,7 +73,7 @@ If you are using `NavigationActions.push` or other stack-specific actions, you
7373

7474
## Deprecations
7575

76-
### XNavigator(...) is now createXNavigator(...)
76+
### XNavigator(...) is now createXNavigator(...)
7777

7878
`StackNavigator`, `TabNavigator` and `DrawerNavigator` are now deprecated in favour of `createStackNavigator`, `createTabNavigator`, and `createDrawerNavigator`, which are functionally identical but more clearly communicate that they are functions and that they return a component. The `XNavigator` style will removed in 3.0.
7979

blog/2018-11-01-react-navigation-3.0-rc.md

+16-23
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,21 @@ We didn’t get around to every feature that we wanted to land for this release,
1717

1818
Let’s get started with react-navigation 3.0.
1919

20-
# Installation
20+
## Installation
2121

2222
First, install the library using your favorite package manager: `yarn add react-navigation@^3.0.0-rc.0`
2323

2424
Next, install react-native-gesture-handler. If you’re using Expo you don’t need to do anything here, it’s included in the SDK. Otherwise: `yarn add react-native-gesture-handler && react-native link`
2525

26-
Optionally, you can install react-native-screens. If you’re using Expo you don’t need to do anything here, it’s included in SDK 30 and higher. Otherwise, follow the instructions in the README on https://github.com/kmagiera/react-native-screens.
26+
Optionally, you can install react-native-screens. If you’re using Expo you don’t need to do anything here, it’s included in SDK 30 and higher. Otherwise, follow the instructions in the README on <https://github.com/kmagiera/react-native-screens>.
2727

2828
> **Warning**: if you have manually installed any navigators in your project, for example react-navigation-material-bottom-tabs, you will need to update those to a version that is compatible with 3.0.0. In the case of react-navigation-material-bottom-tabs, 1.0.0-alpha.2 is compatible.
2929
30-
# Breaking changes
30+
## Breaking changes
3131

3232
When you first run your app after updating it won’t work because react-navigation@^3 requires you to add an app container to the root navigator. Once you get that in place, you may notice that your navigation options aren’t being applied as you expect - this is due to navigationOptions in navigator configuration being renamed to defaultNavigationOptions. If you use a drawer, you may notice that it feels quicker, but if you depend on inactive screens being unmounted you’ll be surprised. More details on these changes and how to update your app to work just as well (probably better) than before below.
3333

34-
35-
## Explicit app container required for the root navigator
34+
### Explicit app container required for the root navigator
3635

3736
In the past, any navigator could act as the navigation container at the top-level of your app because they were all wrapped in “navigation containers”. The navigation container, now known as an app container, is a higher-order-component that maintains the navigation state of your app and handles interacting with the outside world to turn linking events into navigation actions and so on.
3837

@@ -49,7 +48,7 @@ This should be an easy change - import `createAppContainer` in the root of your
4948

5049
> **Warning**: if you have any custom navigators, you may have used `createNavigationContainer`, you can remove this now because it’s only used at the root of the app and provided by the user.
5150
52-
## Renamed navigationOptions in navigator configuration
51+
### Renamed navigationOptions in navigator configuration
5352

5453
When configuring navigators it’s often useful to pass in default navigation options for the screens inside of that navigator. For example in a stack you might want to set a background color and tint color for each screen. Previously, you would write something like this:
5554

@@ -85,7 +84,6 @@ const Home = createStackNavigator({
8584

8685
Sometimes you need to configure the `navigationOptions` for a navigator itself. Typically you’d do something like this:
8786

88-
8987
```js
9088
Home.navigationOptions = { tabBarLabel: 'Home!' };
9189
```
@@ -115,11 +113,11 @@ const Tabs = createBottomTabNavigator({ Home });
115113

116114
We’re sorry to make you go hunt through your code and rename a handful of strings, the hope is that this change makes the code more readable and more intuitive to new users in the future.
117115

118-
## Drawer now keeps inactive tabs in memory by default
116+
### Drawer now keeps inactive tabs in memory by default
119117

120118
Previously when using the drawer navigator screens would unmount when inactive, and when you switch back to them you’d need to re-render the entire thing. In tabs these stay in memory as you would expect, so once you switch to the screen once it’s faster to go back there again and you don’t lose your place in a scroll view or anything. Drawer now behaves the same way, but you can go back to the old behavior if you like by passing in `unmountInactiveRoutes: true` in the drawer navigation configuration.
121119

122-
# New features
120+
## New features
123121

124122
- react-navigation now exports `ScrollView`, `FlatList`, and `SectionList` that will scroll to top when tapping on the active tab as you would expect from native tab bars.
125123
- Drawer supports two more types in addition to the default ‘front’ behavior that you expect from typical Android drawers: back and slide.
@@ -132,37 +130,35 @@ const Store = createStackNavigator({
132130
});
133131
```
134132

135-
136133
- Basic support for hooks in `react-navigation-hooks`
137134
- `headerBackgroundTransitionPreset: 'toggle' | 'fade' | 'translate'` lets you choose how to transition your custom `headerBackground` components between screens.
138135
- Add options to opt in/out of the stack card overlay and shadow that are visible during transitions: `cardShadowEnabled` defaults to `true` and `cardOverlayEnabled` defaults to `false`.
139-
- Export `StackGestureContext` and `DrawerGestureContext` from react-navigation-stack and react-navigation-drawer, so you can use the ref from the corresponding gestures with other gesture handlers (eg: https://github.com/react-navigation/react-navigation-drawer/blob/bf4bdba7f6a4fbc12192f5d5ba2285f6280431b7/example/src/GestureInteraction.js).
136+
- Export `StackGestureContext` and `DrawerGestureContext` from react-navigation-stack and react-navigation-drawer, so you can use the ref from the corresponding gestures with other gesture handlers (eg: <https://github.com/react-navigation/react-navigation-drawer/blob/bf4bdba7f6a4fbc12192f5d5ba2285f6280431b7/example/src/GestureInteraction.js>).
140137

141-
# Assorted fixes & improvements
138+
## Assorted fixes & improvements
142139

143140
- Stack transition performance improved greatly by removing the shadow from the entire card and rendering it only on the slice where it is needed. The card opacity is also no longer directly animated but instead an overlay is put on top to create a similar effect but with better performance.
144-
- Fix long-standing issues with stack that led to quietly re-mounting screens when navigating quickly in certain patterns: https://github.com/react-navigation/react-navigation/issues/4155
141+
- Fix long-standing issues with stack that led to quietly re-mounting screens when navigating quickly in certain patterns: <https://github.com/react-navigation/react-navigation/issues/4155>
145142
- Support inverted gesture in modals.
146143
- Stack card gesture uses react-native-gesture-handler and native driver so the gesture runs on the UI thread (except when the gesture ends, then it calls back to JS).
147-
- Fix a variety of issues with drawer navigator, including issues around nesting (https://github.com/react-navigation/react-navigation/issues/4154) and bugs with firing open / close (eg: https://github.com/react-navigation/react-navigation/issues/5146).
148-
# Ecosystem and web support
144+
- Fix a variety of issues with drawer navigator, including issues around nesting (<https://github.com/react-navigation/react-navigation/issues/4154>) and bugs with firing open / close (eg: <https://github.com/react-navigation/react-navigation/issues/5146>).
145+
146+
## Ecosystem and web support
149147

150148
React Navigation 3.0 brings some important changes to the React Navigation ecosystem: the project now lives across a number of repositories and packages, we have an exciting new transitioner on the way, and the core finally has first-class support for web apps on the client and server!
151149

152-
## Independent Projects
150+
### Independent Projects
153151

154152
React Navigation has always been a set of loosely-coupled navigation components: Stack, Tabs, Drawer, etc. But until now they have always lived in the main navigation repo, which has been difficult to maintain. People often struggle to use different versions of these components, or they want to fork them for their own app.
155153

156154
In v3, all of our main packages and repos are separated. There are the following core packages in our new NPM org:
157155

158-
159156
- `@react-navigation/core` - The primitives and utilities that define our patterns, plus several routers
160157
- `@react-navigation/native` - Container and support for navigators on React Native apps. `createAppContainer` from the main `react-navigation` package actually comes from this package.
161158
- `@react-navigation/web` - Web browser app container, and utilities for server rendering
162159

163160
In addition, we have published our community-maintained components as standalone repos and packages:
164161

165-
166162
- `react-navigation-stack`
167163
- `react-navigation-tabs`
168164
- `react-navigation-drawer`
@@ -171,14 +167,12 @@ In addition, we have published our community-maintained components as standalone
171167

172168
To keep the experience as simple as possible the `react-navigation` package will continue to be supported, and will contain most of the above components as it did before.
173169

174-
175-
## Web Support
170+
### Web Support
176171

177172
Now that the core of React Navigation can be used outside of React Native, we can provide first-class web support to anyone using React.js on the web, including those who do not want to use `react-native-web`.
178173

179174
Here is an example web app which demonstrates the new `createBrowserApp` container and the built-in `Link` component:
180175

181-
182176
```js
183177
import { createSwitchNavigator } from "@react-navigation/core";
184178
import { createBrowserApp, Link } from "@react-navigation/web";
@@ -219,7 +213,6 @@ The above `Link` tag will render to:
219213
220214
See a simple web app with Create React App [here](https://github.com/react-navigation/example-web). Or take a look at [this razzle app](https://github.com/react-navigation/web-server-example) for a more complicated example including server rendering.
221215
222-
223216
----------
224217
225-
Thanks for reading, please post any issues you encounter to https://github.com/react-navigation/react-navigation/issues!
218+
Thanks for reading, please post any issues you encounter to <https://github.com/react-navigation/react-navigation/issues>!

0 commit comments

Comments
 (0)