Skip to content

Commit e751138

Browse files
committed
chore: fix linting
1 parent fa36737 commit e751138

File tree

5 files changed

+35
-12
lines changed

5 files changed

+35
-12
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "index.js",
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1",
8-
"lint": "eslint ."
8+
"lint": "eslint src index.js"
99
},
1010
"repository": {
1111
"type": "git",
@@ -28,6 +28,7 @@
2828
"devDependencies": {
2929
"@react-native-community/eslint-config": "^0.0.5",
3030
"eslint": "^6.6.0",
31+
"eslint-plugin-prettier": "^3.1.1",
3132
"husky": "^3.0.9",
3233
"lint-staged": "^9.4.2",
3334
"prettier": "1.18.2",

src/BlurView.android.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
DeviceEventEmitter,
77
ViewPropTypes,
88
Platform,
9+
StyleSheet,
910
} from 'react-native';
1011

1112
const OVERLAY_COLORS = {
@@ -79,12 +80,16 @@ class BlurView extends Component {
7980
blurRadius={this.blurRadius()}
8081
downsampleFactor={this.downsampleFactor()}
8182
overlayColor={this.overlayColor()}
82-
style={[{ backgroundColor: 'transparent' }, style]}
83+
style={StyleSheet.compose(styles.transparent, style)}
8384
/>
8485
);
8586
}
8687
}
8788

89+
const styles = StyleSheet.create({
90+
transparent: { backgroundColor: 'transparent' },
91+
});
92+
8893
BlurView.propTypes = {
8994
...(ViewPropTypes || View.propTypes),
9095
blurAmount: PropTypes.number,

src/BlurView.ios.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Component } from 'react';
22
import PropTypes from 'prop-types';
3-
import { View, requireNativeComponent, ViewPropTypes } from 'react-native';
3+
import {View, requireNativeComponent, ViewPropTypes, StyleSheet} from 'react-native';
44

55
class BlurView extends Component {
66
setNativeProps = nativeProps => {
@@ -14,12 +14,16 @@ class BlurView extends Component {
1414
<NativeBlurView
1515
ref={e => (this._root = e)}
1616
{...this.props}
17-
style={[{ backgroundColor: 'transparent' }, this.props.style]}
17+
style={StyleSheet.compose(styles.transparent, this.props.style)}
1818
/>
1919
);
2020
}
2121
}
2222

23+
const styles = StyleSheet.create({
24+
transparent: { backgroundColor: 'transparent' },
25+
});
26+
2327
BlurView.propTypes = {
2428
...(ViewPropTypes || View.propTypes),
2529
blurType: PropTypes.oneOf([

src/VibrancyView.ios.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Component } from 'react';
22
import PropTypes from 'prop-types';
3-
import { requireNativeComponent } from 'react-native';
3+
import {requireNativeComponent, StyleSheet} from 'react-native';
44

55
class VibrancyView extends Component {
66
setNativeProps = nativeProps => {
@@ -13,17 +13,16 @@ class VibrancyView extends Component {
1313
return (
1414
<NativeVibrancyView
1515
{...this.props}
16-
style={[
17-
{
18-
backgroundColor: 'transparent',
19-
},
20-
this.props.style,
21-
]}
16+
style={StyleSheet.compose(styles.transparent, this.props.style)}
2217
/>
2318
);
2419
}
2520
}
2621

22+
const styles = StyleSheet.create({
23+
transparent: { backgroundColor: 'transparent' },
24+
});
25+
2726
VibrancyView.propTypes = {
2827
blurType: PropTypes.string,
2928
blurAmount: PropTypes.number.isRequired,

yarn.lock

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2108,6 +2108,13 @@ [email protected]:
21082108
fast-diff "^1.1.1"
21092109
jest-docblock "^21.0.0"
21102110

2111+
eslint-plugin-prettier@^3.1.1:
2112+
version "3.1.1"
2113+
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.1.tgz#507b8562410d02a03f0ddc949c616f877852f2ba"
2114+
integrity sha512-A+TZuHZ0KU0cnn56/9mfR7/KjUJ9QNVXUhwvRFSR7PGPe0zQR6PTkmyqg1AtUUEOzTqeRsUwyKFh0oVZKVCrtA==
2115+
dependencies:
2116+
prettier-linter-helpers "^1.0.0"
2117+
21112118
eslint-plugin-react-hooks@^1.5.1:
21122119
version "1.6.0"
21132120
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.6.0.tgz#348efcda8fb426399ac7b8609607c7b4025a6f5f"
@@ -2408,7 +2415,7 @@ fast-deep-equal@^2.0.1:
24082415
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49"
24092416
integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=
24102417

2411-
fast-diff@^1.1.1:
2418+
fast-diff@^1.1.1, fast-diff@^1.1.2:
24122419
version "1.2.0"
24132420
resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03"
24142421
integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==
@@ -4699,6 +4706,13 @@ prelude-ls@~1.1.2:
46994706
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
47004707
integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=
47014708

4709+
prettier-linter-helpers@^1.0.0:
4710+
version "1.0.0"
4711+
resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b"
4712+
integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==
4713+
dependencies:
4714+
fast-diff "^1.1.2"
4715+
47024716
47034717
version "1.16.4"
47044718
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.16.4.tgz#73e37e73e018ad2db9c76742e2647e21790c9717"

0 commit comments

Comments
 (0)