Skip to content

Commit 0bd61f4

Browse files
authored
Bump Linting/Typechecking to RN 0.72 (#3647)
* WIP Bump Types * Fix some pages * fix bad merge
1 parent 6f6aec2 commit 0bd61f4

File tree

7 files changed

+625
-1220
lines changed

7 files changed

+625
-1220
lines changed

docs/datepickerios.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ id: datepickerios
33
title: '🚧 DatePickerIOS'
44
---
55

6-
> **Deprecated.** Use one of the [community packages](https://reactnative.directory/?search=datepicker) instead.
6+
> **Removed.** Use one of the [community packages](https://reactnative.directory/?search=datepicker) instead.
77
88
Use `DatePickerIOS` to render a date/time picker (selector) on iOS. This is a controlled component, so you must hook in to the `onDateChange` callback and update the `date` prop in order for the component to update, otherwise the user's change will be reverted immediately to reflect `props.date` as the source of truth.
99

1010
### Example
1111

12-
```SnackPlayer name=DatePickerIOS&supportedPlatforms=ios
12+
```SnackPlayer name=DatePickerIOS&supportedPlatforms=ios&disableLinting=true
1313
import React, {useState} from 'react';
1414
import {DatePickerIOS, View, StyleSheet} from 'react-native';
1515

docs/flexbox.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2450,7 +2450,7 @@ import {
24502450
} from 'react-native';
24512451
import type {PropsWithChildren} from 'react';
24522452
2453-
type Dimension = string | number;
2453+
type Dimension = 'auto' | `${number}%` | number;
24542454
24552455
const WidthHeightBasics = () => {
24562456
const [widthType, setWidthType] = useState<Dimension>('auto');

docs/progressviewios.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ id: progressviewios
33
title: '🚧 ProgressViewIOS'
44
---
55

6-
> **Deprecated.** Use one of the [community packages](https://reactnative.directory/?search=progressview) instead.
6+
> **Removed.** Use one of the [community packages](https://reactnative.directory/?search=progressview) instead.
77
88
Uses `ProgressViewIOS` to render a UIProgressView on iOS.
99

1010
### Example
1111

12-
```SnackPlayer name=ProgressViewIOS&supportedPlatforms=ios
12+
```SnackPlayer name=ProgressViewIOS&supportedPlatforms=ios&disableLinting=true
1313
import React from 'react';
1414
import {View, StyleSheet, ProgressViewIOS, Text} from 'react-native';
1515

scripts/lint-examples/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
root: true,
3-
extends: '@react-native-community',
3+
extends: '@react-native',
44
rules: {
55
// Many existing inline styles in examples
66
'react-native/no-inline-styles': 'off',

scripts/lint-examples/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,16 @@
1111
"@babel/core": "^7.12.9",
1212
"@babel/preset-env": "^7.14.0",
1313
"@babel/runtime": "^7.12.5",
14-
"@react-native-community/eslint-config": "^3.0.0",
1514
"@react-native-community/slider": "^4.4.2",
15+
"@react-native/eslint-config": "^0.72.1",
1616
"@tsconfig/react-native": "^2.0.2",
17-
"@types/jest": "^29.2.3",
1817
"@types/react": "^18.0.24",
1918
"eslint": "^8.19.0",
2019
"glob-promise": "^4.2.2",
21-
"metro-react-native-babel-preset": "0.73.3",
20+
"metro-react-native-babel-preset": "0.75.1",
2221
"prettier": "^2.4.1",
2322
"react": "18.2.0",
24-
"react-native": "^0.71.0-rc.5",
23+
"react-native": "^0.72.0-rc.2",
2524
"typescript": "4.8.4"
2625
}
2726
}

scripts/lint-examples/src/lintExamples.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,13 @@ async function extractExamplesFromDocument(filename, extension) {
113113
const snackParams = new URLSearchParams(match[2].trim());
114114
const exampleName = snackParams.get('name');
115115
const exampleExt = snackParams.get('ext');
116+
const disableLinting = snackParams.get('disableLinting');
116117
const content = match[3];
117118

119+
if (disableLinting === 'true') {
120+
return [];
121+
}
122+
118123
const baseFileName = path.relative(documentsRoot, filename);
119124
const outFile = path.join(
120125
outputRoot,

yarn.lock

Lines changed: 611 additions & 1210 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)