Skip to content

Commit 1e38fdf

Browse files
committed
👕 Manually fix lints
1 parent fbcbb19 commit 1e38fdf

10 files changed

+29
-27
lines changed

example/babel.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = function (api) {
1+
module.exports = (api) => {
22
api.cache(true);
33
return {
44
presets: ['babel-preset-expo'],

example/rn-cli.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// eslint-disable-next-line import/no-extraneous-dependencies
12
const blacklist = require('metro-config/src/defaults/blacklist');
23

34
module.exports = {

example/src/GenericListExample.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@ const EMPTY_LIST = Immutable.List();
99
const MOCK_DELAY = 800;
1010

1111
class GenericListExample extends Component {
12+
defaultStateA = {
13+
data: undefined, // Will be manually set on mount.
14+
isLoading: false,
15+
errorMsg: undefined,
16+
};
17+
18+
defaultStateB = {
19+
data: undefined, // Will be manually set on mount.
20+
isLoading: false,
21+
errorMsg: undefined,
22+
};
23+
1224
static propTypes = {
1325
ListComponent: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).isRequired,
1426
listComponentProps: PropTypes.object.isRequired,
@@ -38,18 +50,6 @@ class GenericListExample extends Component {
3850
});
3951
}
4052

41-
defaultStateA = {
42-
data: undefined, // Will be manually set on mount.
43-
isLoading: false,
44-
errorMsg: undefined,
45-
};
46-
47-
defaultStateB = {
48-
data: undefined, // Will be manually set on mount.
49-
isLoading: false,
50-
errorMsg: undefined,
51-
};
52-
5353
changeDataA(delay = 0) {
5454
const { listA } = this.state;
5555
const { dataMutatorA } = this.props;

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"babel-jest": "24.9.0",
6767
"eslint": "6.5.1",
6868
"eslint-config-airbnb": "18.0.1",
69-
"eslint-config-cooperka": "1.0.2",
69+
"eslint-config-cooperka": "1.0.4",
7070
"eslint-plugin-import": "2.18.2",
7171
"eslint-plugin-jsx-a11y": "6.2.3",
7272
"eslint-plugin-react": "7.16.0",

src/ImmutableListView/EmptyListView.js

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import PropTypes from 'prop-types';
33
import React, { PureComponent } from 'react';
44
import { Text, ListView } from 'react-native';
55

6+
// ListView renders EmptyListView which renders an empty ListView. Cycle is okay here.
7+
// eslint-disable-next-line import/no-cycle
68
import ImmutableListView from './ImmutableListView';
79

810
import styles from '../styles';

src/ImmutableListView/ImmutableListView.js

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { Text, ListView, InteractionManager } from 'react-native';
66
import styles from '../styles';
77
import utils from '../utils';
88

9+
// ListView renders EmptyListView which renders an empty ListView. Cycle is okay here.
10+
// eslint-disable-next-line import/no-cycle
911
import { EmptyListView } from './EmptyListView';
1012

1113
/**
@@ -94,6 +96,7 @@ class ImmutableListView extends PureComponent {
9496
return utils.getValueFromKey(rowID, rowData);
9597
},
9698

99+
// eslint-disable-next-line react/destructuring-assignment
97100
sectionHeaderHasChanged: this.props.sectionHeaderHasChanged,
98101

99102
getSectionHeaderData: (dataBlob, sectionID) => utils.getValueFromKey(sectionID, dataBlob),

src/ImmutableVirtualizedList/EmptyVirtualizedList.js

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import PropTypes from 'prop-types';
33
import React, { PureComponent } from 'react';
44
import { Text, VirtualizedList } from 'react-native';
55

6+
// ListView renders EmptyListView which renders an empty ListView. Cycle is okay here.
7+
// eslint-disable-next-line import/no-cycle
68
import ImmutableVirtualizedList from './ImmutableVirtualizedList';
79

810
import styles from '../styles';

src/ImmutableVirtualizedList/ImmutableVirtualizedList.js

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { Text, VirtualizedList } from 'react-native';
66
import styles from '../styles';
77
import utils from '../utils';
88

9+
// ListView renders EmptyListView which renders an empty ListView. Cycle is okay here.
10+
// eslint-disable-next-line import/no-cycle
911
import { EmptyVirtualizedList } from './EmptyVirtualizedList';
1012

1113
/**

src/test-utils.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import ImmutableVirtualizedList from './ImmutableVirtualizedList';
1313
* @see https://facebook.github.io/react-native/docs/listviewdatasource.html#constructor
1414
*/
1515
const data = {
16-
1716
EMPTY_DATA: Immutable.List(),
1817

1918
LIST_DATA: Immutable.List([
@@ -64,11 +63,9 @@ const data = {
6463
]),
6564

6665
RANGE_DATA: Immutable.Range(3, 10, 3),
67-
6866
};
6967

7068
const renderers = {
71-
7269
/**
7370
* @param {*} rowData
7471
*/
@@ -88,11 +85,9 @@ const renderers = {
8885
renderSectionHeader(sectionData, category) {
8986
return <Text header>{`${category} (${sectionData.size} items)`}</Text>;
9087
},
91-
9288
};
9389

9490
const mocks = {
95-
9691
/**
9792
* Mock ScrollView so that it doesn't contain any props when rendered by ListView.
9893
* This is useful for comparison between ListView and ImmutableListView.
@@ -103,17 +98,15 @@ const mocks = {
10398
jest.resetModules();
10499

105100
// eslint-disable-next-line react/prop-types
106-
const mockScrollView = (props) => React.createElement('ScrollView', {}, props.children);
101+
const mockScrollView = ({ children }) => React.createElement('ScrollView', {}, children);
107102
jest.doMock('ScrollView', () => mockScrollView);
108103

109104
// eslint-disable-next-line global-require
110105
return require('./ImmutableListView').default;
111106
},
112-
113107
};
114108

115109
const expectors = {
116-
117110
expectToMatchSnapshotWithData(immutableData, shouldRenderSectionHeaders) {
118111
const renderSectionHeaderProps = shouldRenderSectionHeaders
119112
? { renderSectionHeader: renderers.renderSectionHeader }
@@ -171,7 +164,6 @@ const expectors = {
171164

172165
expect(immutableTree).toEqual(regularTree);
173166
},
174-
175167
};
176168

177169
export {

yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -2143,10 +2143,10 @@ [email protected]:
21432143
object.assign "^4.1.0"
21442144
object.entries "^1.1.0"
21452145

2146-
2147-
version "1.0.2"
2148-
resolved "https://registry.yarnpkg.com/eslint-config-cooperka/-/eslint-config-cooperka-1.0.2.tgz#9c2294bfe276102d545c20b550d4e79da778e42b"
2149-
integrity sha512-YH/kPPgLDtHrhEIiVTgRY3dcpMMsSOCRAYPwbsfQMvt7UiZHp253G4lWK0hyu2sP2PO19xGn4Mhb8/NZV26muQ==
2146+
2147+
version "1.0.4"
2148+
resolved "https://registry.yarnpkg.com/eslint-config-cooperka/-/eslint-config-cooperka-1.0.4.tgz#733c4ce66c74d3314f6970ced22515beb3e5c151"
2149+
integrity sha512-Aq9+NQ3E2e05wAl/rC7F7HLDJJH/GxEOkU+9Buulem+Bd3NnBvlSvJO4tbT5yNJjp9My4gvOwKv7biTtXlzaiQ==
21502150

21512151
eslint-import-resolver-node@^0.3.2:
21522152
version "0.3.2"

0 commit comments

Comments
 (0)