chore: fix linting

This commit is contained in:
Mikael Sand 2019-11-08 23:32:40 +02:00
parent fa3673794b
commit e751138c44
5 changed files with 35 additions and 12 deletions

View File

@ -5,7 +5,7 @@
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"lint": "eslint ." "lint": "eslint src index.js"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -28,6 +28,7 @@
"devDependencies": { "devDependencies": {
"@react-native-community/eslint-config": "^0.0.5", "@react-native-community/eslint-config": "^0.0.5",
"eslint": "^6.6.0", "eslint": "^6.6.0",
"eslint-plugin-prettier": "^3.1.1",
"husky": "^3.0.9", "husky": "^3.0.9",
"lint-staged": "^9.4.2", "lint-staged": "^9.4.2",
"prettier": "1.18.2", "prettier": "1.18.2",

View File

@ -6,6 +6,7 @@ import {
DeviceEventEmitter, DeviceEventEmitter,
ViewPropTypes, ViewPropTypes,
Platform, Platform,
StyleSheet,
} from 'react-native'; } from 'react-native';
const OVERLAY_COLORS = { const OVERLAY_COLORS = {
@ -79,12 +80,16 @@ class BlurView extends Component {
blurRadius={this.blurRadius()} blurRadius={this.blurRadius()}
downsampleFactor={this.downsampleFactor()} downsampleFactor={this.downsampleFactor()}
overlayColor={this.overlayColor()} overlayColor={this.overlayColor()}
style={[{ backgroundColor: 'transparent' }, style]} style={StyleSheet.compose(styles.transparent, style)}
/> />
); );
} }
} }
const styles = StyleSheet.create({
transparent: { backgroundColor: 'transparent' },
});
BlurView.propTypes = { BlurView.propTypes = {
...(ViewPropTypes || View.propTypes), ...(ViewPropTypes || View.propTypes),
blurAmount: PropTypes.number, blurAmount: PropTypes.number,

View File

@ -1,6 +1,6 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { View, requireNativeComponent, ViewPropTypes } from 'react-native'; import {View, requireNativeComponent, ViewPropTypes, StyleSheet} from 'react-native';
class BlurView extends Component { class BlurView extends Component {
setNativeProps = nativeProps => { setNativeProps = nativeProps => {
@ -14,12 +14,16 @@ class BlurView extends Component {
<NativeBlurView <NativeBlurView
ref={e => (this._root = e)} ref={e => (this._root = e)}
{...this.props} {...this.props}
style={[{ backgroundColor: 'transparent' }, this.props.style]} style={StyleSheet.compose(styles.transparent, this.props.style)}
/> />
); );
} }
} }
const styles = StyleSheet.create({
transparent: { backgroundColor: 'transparent' },
});
BlurView.propTypes = { BlurView.propTypes = {
...(ViewPropTypes || View.propTypes), ...(ViewPropTypes || View.propTypes),
blurType: PropTypes.oneOf([ blurType: PropTypes.oneOf([

View File

@ -1,6 +1,6 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { requireNativeComponent } from 'react-native'; import {requireNativeComponent, StyleSheet} from 'react-native';
class VibrancyView extends Component { class VibrancyView extends Component {
setNativeProps = nativeProps => { setNativeProps = nativeProps => {
@ -13,17 +13,16 @@ class VibrancyView extends Component {
return ( return (
<NativeVibrancyView <NativeVibrancyView
{...this.props} {...this.props}
style={[ style={StyleSheet.compose(styles.transparent, this.props.style)}
{
backgroundColor: 'transparent',
},
this.props.style,
]}
/> />
); );
} }
} }
const styles = StyleSheet.create({
transparent: { backgroundColor: 'transparent' },
});
VibrancyView.propTypes = { VibrancyView.propTypes = {
blurType: PropTypes.string, blurType: PropTypes.string,
blurAmount: PropTypes.number.isRequired, blurAmount: PropTypes.number.isRequired,

View File

@ -2108,6 +2108,13 @@ eslint-plugin-prettier@2.6.2:
fast-diff "^1.1.1" fast-diff "^1.1.1"
jest-docblock "^21.0.0" jest-docblock "^21.0.0"
eslint-plugin-prettier@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.1.tgz#507b8562410d02a03f0ddc949c616f877852f2ba"
integrity sha512-A+TZuHZ0KU0cnn56/9mfR7/KjUJ9QNVXUhwvRFSR7PGPe0zQR6PTkmyqg1AtUUEOzTqeRsUwyKFh0oVZKVCrtA==
dependencies:
prettier-linter-helpers "^1.0.0"
eslint-plugin-react-hooks@^1.5.1: eslint-plugin-react-hooks@^1.5.1:
version "1.6.0" version "1.6.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.6.0.tgz#348efcda8fb426399ac7b8609607c7b4025a6f5f" 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:
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49"
integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=
fast-diff@^1.1.1: fast-diff@^1.1.1, fast-diff@^1.1.2:
version "1.2.0" version "1.2.0"
resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03"
integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==
@ -4699,6 +4706,13 @@ prelude-ls@~1.1.2:
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=
prettier-linter-helpers@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b"
integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==
dependencies:
fast-diff "^1.1.2"
prettier@1.16.4: prettier@1.16.4:
version "1.16.4" version "1.16.4"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.16.4.tgz#73e37e73e018ad2db9c76742e2647e21790c9717" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.16.4.tgz#73e37e73e018ad2db9c76742e2647e21790c9717"