Skip to content

Commit 396c907

Browse files
committed
lint rolling
1 parent 4d30053 commit 396c907

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

index.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ const ansiToJSON = require('ansi-to-json');
44

55
function ansiJSONtoStyleBundle(ansiBundle) {
66
const style = {};
7-
if(ansiBundle.bg) {
7+
if (ansiBundle.bg) {
88
style.backgroundColor = `rgb(${ansiBundle.bg})`;
99
}
10-
if(ansiBundle.fg) {
10+
if (ansiBundle.fg) {
1111
style.color = `rgb(${ansiBundle.fg})`;
1212
}
1313
return {
@@ -17,11 +17,13 @@ function ansiJSONtoStyleBundle(ansiBundle) {
1717
}
1818

1919
function ansiToInlineStyle(text) {
20-
return ansiToJSON(text).map(ansiJSONtoStyleBundle)
20+
return ansiToJSON(text).map(ansiJSONtoStyleBundle);
2121
}
2222

2323
function inlineBundleToReact(bundle, key) {
24-
return <span style={bundle.style} key={key}>{bundle.content}</span>
24+
return (
25+
<span style={bundle.style} key={key}>{bundle.content}</span>
26+
);
2527
}
2628

2729
export default function Ansi(props) {
@@ -30,6 +32,9 @@ export default function Ansi(props) {
3032
<code>
3133
{ansiToInlineStyle(text).map(inlineBundleToReact)}
3234
</code>
33-
)
35+
);
3436
}
3537

38+
Ansi.propTypes = {
39+
text: React.PropTypes.string,
40+
};

0 commit comments

Comments
 (0)