Skip to content

Commit 0bc91be

Browse files
authored
Merge pull request #257 from Bekaxp/Bekaxp/update-split-platform-components-md
Added Rule Options documentation for split-platform-components rule
2 parents b908186 + 23032e9 commit 0bc91be

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

docs/rules/split-platform-components.md

+27
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,30 @@ export default function Hello() {
101101
return <ActivityIndicatiorIOS/>
102102
}
103103
```
104+
105+
## Rule Options
106+
107+
```js
108+
...
109+
"react-native/split-platform-components": [ <enabled>, {
110+
androidPathRegex: <string>,
111+
iosPathRegex: <string>
112+
}]
113+
...
114+
```
115+
116+
### `androidPathRegex`
117+
118+
A RegExp pattern to use for Android platform components. You can include other custom filenames like so:
119+
120+
```js
121+
'react-native/split-platform-components': [2, {androidPathRegex: '\\.android.(js|jsx|ts|tsx)$'}]
122+
```
123+
124+
### `iosPathRegex`
125+
126+
A RegExp pattern to use for iOS platform components. You can include other custom filenames like so:
127+
128+
```js
129+
'react-native/split-platform-components': [2, {iosPathRegex: '\\.ios.(js|jsx|ts|tsx)$'}]
130+
```

0 commit comments

Comments
 (0)