Open burtek opened 5 years ago
I just found iosPathRegex
and androidPathRegex
in https://github.com/Intellicode/eslint-plugin-react-native/blob/master/lib/rules/split-platform-components.js. Too bad it's not documented in docs
Thank you @burtek
I added a rule like this:
rules: { 'react-native/split-platform-components': [ 2, { androidPathRegex: '\\.android.(js|jsx|ts|tsx)$', iosPathRegex: '\\.ios.(js|jsx|ts|tsx)$', }, ], }
This is now working for me. Maybe we should create a PR to update the documentation.
@Bekaxp feel free, I'm seriously short of time so I'm not going to do that in next few days
@burtek sorry for the very loooong delay in creating this documentation update. The PR is open now. Thank you.
Right now
split-platform-components
has false-positives if file extension is different thanjs
, i.e.jsx
ortsx
. This rule should be either extension-agnostic or at least allow providing option (regex?) so that.ios.jsx
,.ios.tsx
etc are considered correct.