Skip to content

Commit ead64b2

Browse files
friederbluemlesatya164
authored andcommitted
Fix EJS formatting issues
- Slurp newlines on full length ejs lines - Remove leading spaces that would result in whitespace errors in the processed files
1 parent 710a092 commit ead64b2

File tree

5 files changed

+20
-18
lines changed

5 files changed

+20
-18
lines changed

packages/create-react-native-library/templates/common/example/src/App.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
import * as React from 'react';
2-
<% if (project.moduleType === "view") { %>
2+
3+
<% if (project.moduleType === "view") { -%>
34
import { StyleSheet, View } from 'react-native';
45
import <%- project.name %>ViewManager from '<%- project.slug %>';
5-
<% } else { %>
6+
<% } else { -%>
67
import { StyleSheet, View, Text } from 'react-native';
78
import <%- project.name %> from '<%- project.slug %>';
8-
<% } %>
9-
<% if (project.moduleType === "view") { %>
9+
<% } -%>
10+
11+
<% if (project.moduleType === "view") { -%>
1012
export default function App() {
1113
return (
1214
<View style={styles.container}>
1315
<<%- project.name %>ViewManager color="#32a852" style={styles.box} />
1416
</View>
1517
);
1618
}
17-
<% } else { %>
19+
<% } else { -%>
1820
export default function App() {
1921
const [result, setResult] = React.useState<number | undefined>();
2022

@@ -28,7 +30,8 @@ export default function App() {
2830
</View>
2931
);
3032
}
31-
<% } %>
33+
<% } -%>
34+
3235
const styles = StyleSheet.create({
3336
container: {
3437
flex: 1,

packages/create-react-native-library/templates/example/example/ios/Podfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ target '<%- project.name %>Example' do
77
config = use_native_modules!
88

99
use_react_native!(:path => config["reactNativePath"])
10+
<% if (project.module) { -%>
1011
11-
<% if (project.module) { -%>
12-
pod '<%- project.podspec %>', :path => '../..'
13-
<% } -%>
12+
pod '<%- project.podspec %>', :path => '../..'
13+
<% } -%>
1414
1515
# Enables Flipper.
1616
#

packages/create-react-native-library/templates/native-library/{%- project.podspec %}.podspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ Pod::Spec.new do |s|
1313
s.platforms = { :ios => "10.0" }
1414
s.source = { :git => "<%- repo %>.git", :tag => "#{s.version}" }
1515

16-
<% if (project.cpp) { %>
16+
<% if (project.cpp) { -%>
1717
s.source_files = "ios/**/*.{h,m,mm}", "cpp/**/*.{h,cpp}"
18-
<% } else if (project.swift) { %>
18+
<% } else if (project.swift) { -%>
1919
s.source_files = "ios/**/*.{h,m,mm,swift}"
20-
<% } else { %>
20+
<% } else { -%>
2121
s.source_files = "ios/**/*.{h,m,mm}"
22-
<% } %>
22+
<% } -%>
2323
2424
s.dependency "React-Core"
2525
end

packages/create-react-native-library/templates/native-view-library/src/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ type <%- project.name %>Props = {
55
style: ViewStyle;
66
};
77

8-
98
export const <%- project.name %>ViewManager = requireNativeComponent<<%- project.name %>Props>(
109
'<%- project.name %>View'
1110
);

packages/create-react-native-library/templates/native-view-library/{%- project.podspec %}.podspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ Pod::Spec.new do |s|
1313
s.platforms = { :ios => "10.0" }
1414
s.source = { :git => "<%- repo %>.git", :tag => "#{s.version}" }
1515

16-
<% if (project.cpp) { %>
16+
<% if (project.cpp) { -%>
1717
s.source_files = "ios/**/*.{h,m,mm}", "cpp/**/*.{h,cpp}"
18-
<% } else if (project.swift) { %>
18+
<% } else if (project.swift) { -%>
1919
s.source_files = "ios/**/*.{h,m,mm,swift}"
20-
<% } else { %>
20+
<% } else { -%>
2121
s.source_files = "ios/**/*.{h,m,mm}"
22-
<% } %>
22+
<% } -%>
2323
2424
s.dependency "React-Core"
2525
end

0 commit comments

Comments
 (0)