Skip to content

Commit 5fa607c

Browse files
committed
ci: Update eslint workflow
Format all files
1 parent c87d179 commit 5fa607c

29 files changed

+3064
-2702
lines changed

.eslintignore

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

.eslintrc

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,6 @@
11
{
2-
"parser": "babel-eslint",
3-
"extends": "airbnb",
4-
"plugins": ["react", "react-native", "jsx-a11y", "import"],
2+
"extends": "@react-native-community",
53
"rules": {
6-
"semi": "off",
7-
"no-underscore-dangle": "off",
8-
"no-plusplus": "off",
9-
"react/jsx-filename-extension": "off",
10-
"no-unused-expressions": "off",
11-
"no-alert": "off",
12-
"no-debugger": "off",
13-
"max-len": ["warn", 120],
14-
"no-restricted-syntax": "off",
15-
"no-param-reassign": "off"
16-
},
17-
"env": {
18-
"browser": true
4+
"react-native/no-inline-styles": 0
195
}
206
}

.prettierignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.prettierrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"semi": false,
32
"singleQuote": true,
43
"trailingComma": "es5"
54
}

README.md

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -16,50 +16,50 @@
1616

1717
## Contents
1818

19-
* [Features](#features)
20-
* [Installation](#installation)
21-
* [Styles](#supported-styles)
22-
* [Examples](#examples)
23-
* [Customization](#customization)
19+
- [Features](#features)
20+
- [Installation](#installation)
21+
- [Styles](#supported-styles)
22+
- [Examples](#examples)
23+
- [Customization](#customization)
2424

2525
## Features
2626

27-
* Look and feel of iOS TableView - **because it is!** (with group/plain
27+
- Look and feel of iOS TableView - **because it is!** (with group/plain
2828
tableview type, sections headers, etc)
29-
* Display long lists of data (like country list) with no performance loss
30-
* Built-in accessory types (checkmark or disclosure indicator)
31-
* Pull to refresh!
32-
* Automatic scroll to initial selected value during component initialization
29+
- Display long lists of data (like country list) with no performance loss
30+
- Built-in accessory types (checkmark or disclosure indicator)
31+
- Pull to refresh!
32+
- Automatic scroll to initial selected value during component initialization
3333
(autoFocus property)
34-
* Automatic item selection with "checkmark" with old item de-selection
34+
- Automatic item selection with "checkmark" with old item de-selection
3535
(optionally), see demo, useful to select country/state/etc.
36-
* Render Native Section Index Titles (sectionIndexTitlesEnabled property)
37-
* Native JSON support for datasource. If you need to display large dataset,
36+
- Render Native Section Index Titles (sectionIndexTitlesEnabled property)
37+
- Native JSON support for datasource. If you need to display large dataset,
3838
generated Javascript will became very large and impact js loading time. To
3939
solve this problem the component could read JSON directly from app bundle
4040
without JS!
41-
* Filter JSON datasources using NSPredicate syntax. For example you could select
41+
- Filter JSON datasources using NSPredicate syntax. For example you could select
4242
states for given country only (check demo)
43-
* Create custom UITableView cells with flexible height using React Native syntax
43+
- Create custom UITableView cells with flexible height using React Native syntax
4444
(TableView.Cell tag)
45-
* Use TableView as menu to navigate to other screens (check included demo, using
45+
- Use TableView as menu to navigate to other screens (check included demo, using
4646
react-navigation https://reactnavigation.org)
47-
* Native editing mode for table - move/delete option is supported by using
47+
- Native editing mode for table - move/delete option is supported by using
4848
attributes canMove, canEdit for items/sections
4949

5050
## Installation
5151

5252
1. Installation
53-
* Using npm: `npm install react-native-tableview --save`
54-
* Using yarn: `yarn add react-native-tableview`
53+
- Using npm: `npm install react-native-tableview --save`
54+
- Using yarn: `yarn add react-native-tableview`
5555
2. Link
56-
* `react-native link react-native-tableview`
57-
* If fails, follow manual linking steps below
56+
- `react-native link react-native-tableview`
57+
- If fails, follow manual linking steps below
5858
3. (optional) If you will use JSON file, add it to iOS application bundle
5959
4. Import it in your JS:
6060

6161
```js
62-
import TableView from 'react-native-tableview'
62+
import TableView from 'react-native-tableview';
6363
```
6464

6565
### Manual Linking
@@ -70,7 +70,7 @@
7070
3. In the XCode project navigator, select your project, select the Build Phases
7171
tab and in the Link Binary With Libraries section add libRNTableView.a
7272
4. And in the Build Settings tab in the Search Paths/Header Search Paths section
73-
add $(SRCROOT)/../node_modules/react-native-tableview (make sure it's
73+
add \$(SRCROOT)/../node_modules/react-native-tableview (make sure it's
7474
recursive).
7575

7676
## Supported Styles
@@ -137,7 +137,6 @@ Checkmark can also be applied by adding the `selected` prop on the Item.
137137
For a full list of props on all components check out
138138
[the typescript definitions file](./src/index.d.ts).
139139

140-
141140
### Methods
142141

143142
#### `scrollTo()`
@@ -230,7 +229,7 @@ render() {
230229
```jsx
231230
// list spanish provinces and add 'All states' item at the beginning
232231

233-
const country = 'ES'
232+
const country = 'ES';
234233

235234
return (
236235
<View style={{ flex: 1 }}>
@@ -244,7 +243,7 @@ return (
244243
onPress={event => alert(JSON.stringify(event))}
245244
/>
246245
</View>
247-
)
246+
);
248247
```
249248

250249
### Built-in editing
@@ -340,53 +339,53 @@ render() {
340339

341340
The following style props are supported:
342341

343-
* `tableViewCellStyle`
344-
* `tableViewCellEditingStyle`
345-
* `separatorStyle`
346-
* `contentInset`
347-
* `contentOffset`
348-
* `scrollIndicatorInsets`
349-
* `cellLayoutMargins`
350-
* `cellSeparatorInset`
342+
- `tableViewCellStyle`
343+
- `tableViewCellEditingStyle`
344+
- `separatorStyle`
345+
- `contentInset`
346+
- `contentOffset`
347+
- `scrollIndicatorInsets`
348+
- `cellLayoutMargins`
349+
- `cellSeparatorInset`
351350

352351
Colors:
353352

354-
* `textColor`
355-
* `tintColor`
356-
* `selectedTextColor`
357-
* `detailTextColor`
358-
* `separatorColor`
359-
* `headerTextColor`
360-
* `headerBackgroundColor`
361-
* `footerTextColor`
353+
- `textColor`
354+
- `tintColor`
355+
- `selectedTextColor`
356+
- `detailTextColor`
357+
- `separatorColor`
358+
- `headerTextColor`
359+
- `headerBackgroundColor`
360+
- `footerTextColor`
362361

363362
Base font:
364363

365-
* `fontSize`
366-
* `fontWeight`
367-
* `fontStyle`
368-
* `fontFamily`
364+
- `fontSize`
365+
- `fontWeight`
366+
- `fontStyle`
367+
- `fontFamily`
369368

370369
"Subtitle" font:
371370

372-
* `detailFontSize`
373-
* `detailFontWeight`
374-
* `detailFontStyle`
375-
* `detailFontFamily`
371+
- `detailFontSize`
372+
- `detailFontWeight`
373+
- `detailFontStyle`
374+
- `detailFontFamily`
376375

377376
Header font:
378377

379-
* `headerFontSize`
380-
* `headerFontWeight`
381-
* `headerFontStyle`
382-
* `headerFontFamily`
378+
- `headerFontSize`
379+
- `headerFontWeight`
380+
- `headerFontStyle`
381+
- `headerFontFamily`
383382

384383
Footer font:
385384

386-
* `footerFontSize`
387-
* `footerFontWeight`
388-
* `footerFontStyle`
389-
* `footerFontFamily`
385+
- `footerFontSize`
386+
- `footerFontWeight`
387+
- `footerFontStyle`
388+
- `footerFontFamily`
390389

391390
## Images / Icons
392391

@@ -396,14 +395,14 @@ An `image` prop can be a string pointing to the name of an asset in your "Asset
396395
Catalog". In this case an `imageWidth` prop is recommended.
397396

398397
```jsx
399-
;<Item image="icon-success.png" imageWidth={40} />
398+
<Item image="icon-success.png" imageWidth={40} />;
400399
```
401400

402401
Alternatively, you can `require` the image from your local app code. In this case
403402
an `imageWidth` is unnecessary.
404403

405404
```jsx
406-
;<Item image={require('../images/icon-success.png')} />
405+
<Item image={require('../images/icon-success.png')} />;
407406
```
408407

409408
### Editable Complex Components
@@ -449,24 +448,25 @@ For example,
449448
450449
class TableViewExampleCell extends React.Component {
451450
render() {
452-
var style = { borderColor: '#aaaaaa', borderWidth: 1, borderRadius: 3 }
451+
var style = { borderColor: '#aaaaaa', borderWidth: 1, borderRadius: 3 };
453452
454453
// Fill the full native table cell height.
455-
style.flex = 1
454+
style.flex = 1;
456455
457456
// All Item props get passed to this cell inside this.props.data. Use them to control the rendering, for example background color:
458457
if (this.props.data.backgroundColor !== undefined) {
459-
style.backgroundColor = this.props.data.backgroundColor
458+
style.backgroundColor = this.props.data.backgroundColor;
460459
}
461460
462461
return (
463462
<View style={style}>
464463
<Text>
465-
section:{this.props.section},row:{this.props.row},label:{this.props.data.label}
464+
section:{this.props.section},row:{this.props.row},label:
465+
{this.props.data.label}
466466
</Text>
467467
<Text> message:{this.props.data.message}</Text>
468468
</View>
469-
)
469+
);
470470
}
471471
}
472472
```
@@ -482,17 +482,17 @@ For more examples, see examples/TableViewDemo.
482482
#### Create list of items, passing props
483483

484484
```jsx
485-
;<Section canEdit={true}>
485+
<Section canEdit={true}>
486486
{this.props.items.map(function(item) {
487487
return (
488488
<Item
489489
key={'i' + item.data.date}
490490
label={item.label}
491491
message={item.message}
492492
/>
493-
)
493+
);
494494
})}
495-
</Section>
495+
</Section>;
496496
```
497497

498498
Note that the props you pass must be primitive types: they cannot be objects.

example/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { default } from './src'
1+
export { default } from './src';
Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
/* eslint-disable react/forbid-prop-types */
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
3+
import { View, Text } from 'react-native';
24

3-
import React from 'react'
4-
import PropTypes from 'prop-types'
5-
import { View, Text } from 'react-native'
6-
7-
const TableViewExampleCell = (props) => {
5+
const TableViewExampleCell = props => {
86
const style = {
97
borderColor: '#aaaaaa',
108
borderWidth: 1,
119
borderRadius: 3,
1210
flex: 1,
13-
}
11+
};
1412

1513
if (props.data.backgroundColor !== undefined) {
16-
style.backgroundColor = props.data.backgroundColor
14+
style.backgroundColor = props.data.backgroundColor;
1715
}
1816

1917
return (
@@ -22,19 +20,19 @@ const TableViewExampleCell = (props) => {
2220
section:{props.section},row:{props.row},label:{props.data.label}
2321
</Text>
2422
</View>
25-
)
26-
}
23+
);
24+
};
2725

2826
TableViewExampleCell.propTypes = {
2927
data: PropTypes.object,
3028
section: PropTypes.number,
3129
row: PropTypes.number,
32-
}
30+
};
3331

3432
TableViewExampleCell.defaultProps = {
3533
data: null,
3634
section: null,
3735
row: null,
38-
}
36+
};
3937

40-
export default TableViewExampleCell
38+
export default TableViewExampleCell;

example/src/index.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import { AppRegistry } from 'react-native'
2-
import { createStackNavigator, createAppContainer } from 'react-navigation'
3-
import Home from './screens/Home'
4-
import Example1 from './screens/Example1'
5-
import Example2 from './screens/Example2'
6-
import Example3 from './screens/Example3'
7-
import Example4 from './screens/Example4'
8-
import Example5 from './screens/Example5'
9-
import Example6 from './screens/Example6'
10-
import Example7 from './screens/Example7'
11-
import Example8 from './screens/Example8'
1+
import { AppRegistry } from 'react-native';
2+
import { createStackNavigator, createAppContainer } from 'react-navigation';
3+
import Home from './screens/Home';
4+
import Example1 from './screens/Example1';
5+
import Example2 from './screens/Example2';
6+
import Example3 from './screens/Example3';
7+
import Example4 from './screens/Example4';
8+
import Example5 from './screens/Example5';
9+
import Example6 from './screens/Example6';
10+
import Example7 from './screens/Example7';
11+
import Example8 from './screens/Example8';
1212

13-
import TableViewExampleCell from './cells/TableViewExampleCell'
13+
import TableViewExampleCell from './cells/TableViewExampleCell';
1414

1515
const Stack = createStackNavigator(
1616
{
@@ -78,12 +78,12 @@ const Stack = createStackNavigator(
7878
},
7979
initialRouteName: 'home',
8080
}
81-
)
81+
);
8282

83-
const App = createAppContainer(Stack)
83+
const App = createAppContainer(Stack);
8484

85-
AppRegistry.registerComponent('TableViewDemo', () => App)
85+
AppRegistry.registerComponent('TableViewDemo', () => App);
8686
AppRegistry.registerComponent(
8787
'TableViewExampleCell',
8888
() => TableViewExampleCell
89-
)
89+
);

0 commit comments

Comments
 (0)