Skip to content

Commit ae7c814

Browse files
author
Gabriel Peal
committed
Enable prettier and fix lint
1 parent 9925cf8 commit ae7c814

21 files changed

+254
-31
lines changed

.eslintrc

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
{
22
"parser": "babel-eslint",
3-
"extends": "airbnb",
4-
"plugins": [
5-
"prefer-object-spread"
6-
],
3+
"extends": ["airbnb", "prettier", "prettier/standard", "prettier/react"],
4+
"plugins": ["prefer-object-spread", "prettier"],
75
"rules": {
6+
// Conflicts with prettier
7+
// https://github.com/prettier/`prettier`/issues/187
8+
"no-mixed-operators": 0,
9+
// Not recommended with prettier
10+
// https://github.com/prettier/eslint-config-prettier/issues/17
11+
"no-confusing-arrow": 0,
812
"prefer-object-spread/prefer-object-spread": 2,
913
"react/prefer-stateless-function": 0,
1014
"react/jsx-filename-extension": 0,
1115
"react/sort-comp": 0,
16+
"react/require-extension": 0,
1217
"import/no-extraneous-dependencies": 0,
1318
"import/no-unresolved": [2, { "ignore": ["^lottie-react-native$"] }],
1419
"no-console": 0,
15-
"no-use-before-define": 0
20+
"no-use-before-define": 0,
21+
"prettier/prettier": 2
1622
}
1723
}

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lib/

.prettierrc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"singleQuote": true,
3+
"printWidth": 100,
4+
"semi": true,
5+
"trailingComma": "all",
6+
"bracketSpacing": true,
7+
"jsxBracketSameLine": false,
8+
"overrides": [
9+
{
10+
"files": [
11+
"babel-preset.js",
12+
"**/preinstall.js",
13+
"**/postinstall.js",
14+
"**/fixReactTypeDefinition.js",
15+
".babelrc.js"
16+
],
17+
"options": {
18+
"trailingComma": "es5"
19+
}
20+
}
21+
]
22+
}

example/js/ExamplePicker.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
/* eslint-disable global-require */
22
import React from 'react';
3-
import {
4-
Picker,
5-
Platform,
6-
} from 'react-native';
3+
import { Picker, Platform } from 'react-native';
74
import PropTypes from 'prop-types';
85

96
const propTypes = {
@@ -25,13 +22,9 @@ export default class ExamplePicker extends React.Component {
2522
}),
2623
}}
2724
>
28-
{Object.keys(this.props.examples).map(name => this.props.examples[name]).map(ex => (
29-
<Picker.Item
30-
key={ex.name}
31-
label={ex.name}
32-
value={ex.name}
33-
/>
34-
))}
25+
{Object.keys(this.props.examples)
26+
.map(name => this.props.examples[name])
27+
.map(ex => <Picker.Item key={ex.name} label={ex.name} value={ex.name} />)}
3528
</Picker>
3629
);
3730
}
493 KB
Binary file not shown.
Binary file not shown.
55.5 KB
Binary file not shown.
2.41 KB
Binary file not shown.
462 KB
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)