Skip to content

Commit 06fbe55

Browse files
enable ts strict mode and remove eslint (#473)
enable ts strict mode and remove eslint
2 parents eefa124 + 5a66a14 commit 06fbe55

File tree

105 files changed

+400
-426
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+400
-426
lines changed

.eslintignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/CONTRIBUTING.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,9 @@ To run tests continuously
4444
npm run test:watch
4545
```
4646

47-
This codebase adheres to the [Airbnb Styleguide](https://github.com/airbnb/javascript) and is enforced using [ESLint](http://eslint.org/).
47+
This style of the codebase is enforced by [Prettier](https://prettier.io/).
4848

49-
It is recommended that you install an ESlint plugin for your editor of choice when working on this codebase, however you can always check to see if the source code is compliant by running:
50-
51-
```bash
52-
npm run lint
53-
```
49+
It is recommended that you install a Prettier plugin for your editor of choice when working on this codebase.
5450

5551
### Docs
5652

@@ -99,7 +95,7 @@ In general, the contribution workflow looks like this:
9995
- Open a new issue in the [Issue tracker](https://github.com/airbnb/react-sketchapp/issues).
10096
- Fork the repo.
10197
- Create a new feature branch based off the `master` branch.
102-
- Make sure all tests pass and there are no linting errors.
98+
- Make sure all tests pass.
10399
- Submit a pull request, referencing any issues it addresses.
104100

105101
Please try to keep your pull request focused in scope and avoid including unrelated commits.

.npmignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ __tests__
1111
template
1212
book.json
1313
prettier.config.js
14-
.eslintrc
15-
.eslintignore
1614
.editorconfig
1715
.bookignore
1816
src

__tests__/jest/components/__snapshots__/Image.tsx.snap

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
exports[`<Image /> name defaults to Image 1`] = `
44
<sketch_image
55
name="Image"
6-
resizeMode="Fill"
6+
resizeMode={1}
77
source="foo"
88
style={Object {}}
99
/>
@@ -12,7 +12,7 @@ exports[`<Image /> name defaults to Image 1`] = `
1212
exports[`<Image /> name passes its name 1`] = `
1313
<sketch_image
1414
name="bar"
15-
resizeMode="Fill"
15+
resizeMode={1}
1616
source="foo"
1717
style={Object {}}
1818
/>
@@ -21,7 +21,7 @@ exports[`<Image /> name passes its name 1`] = `
2121
exports[`<Image /> renders children 1`] = `
2222
<sketch_image
2323
name="Image"
24-
resizeMode="Fill"
24+
resizeMode={1}
2525
source="foo"
2626
style={Object {}}
2727
>
@@ -32,7 +32,7 @@ exports[`<Image /> renders children 1`] = `
3232
exports[`<Image /> resizeMode falls back to a resizeMode from style 1`] = `
3333
<sketch_image
3434
name="Image"
35-
resizeMode="Fit"
35+
resizeMode={3}
3636
source="foo"
3737
style={
3838
Object {
@@ -45,7 +45,7 @@ exports[`<Image /> resizeMode falls back to a resizeMode from style 1`] = `
4545
exports[`<Image /> resizeMode falls back to cover 1`] = `
4646
<sketch_image
4747
name="Image"
48-
resizeMode="Fill"
48+
resizeMode={1}
4949
source="foo"
5050
style={Object {}}
5151
/>
@@ -54,7 +54,7 @@ exports[`<Image /> resizeMode falls back to cover 1`] = `
5454
exports[`<Image /> resizeMode prefers prop to style 1`] = `
5555
<sketch_image
5656
name="Image"
57-
resizeMode="Fill"
57+
resizeMode={1}
5858
source="foo"
5959
style={
6060
Object {
@@ -67,7 +67,7 @@ exports[`<Image /> resizeMode prefers prop to style 1`] = `
6767
exports[`<Image /> resizeMode translates center 1`] = `
6868
<sketch_image
6969
name="Image"
70-
resizeMode="Fill"
70+
resizeMode={1}
7171
source="foo"
7272
style={Object {}}
7373
/>
@@ -76,7 +76,7 @@ exports[`<Image /> resizeMode translates center 1`] = `
7676
exports[`<Image /> resizeMode translates contain 1`] = `
7777
<sketch_image
7878
name="Image"
79-
resizeMode="Fit"
79+
resizeMode={3}
8080
source="foo"
8181
style={Object {}}
8282
/>
@@ -85,7 +85,7 @@ exports[`<Image /> resizeMode translates contain 1`] = `
8585
exports[`<Image /> resizeMode translates cover 1`] = `
8686
<sketch_image
8787
name="Image"
88-
resizeMode="Fill"
88+
resizeMode={1}
8989
source="foo"
9090
style={Object {}}
9191
/>
@@ -94,7 +94,7 @@ exports[`<Image /> resizeMode translates cover 1`] = `
9494
exports[`<Image /> resizeMode translates none 1`] = `
9595
<sketch_image
9696
name="Image"
97-
resizeMode="Fill"
97+
resizeMode={1}
9898
source="foo"
9999
style={Object {}}
100100
/>
@@ -103,7 +103,7 @@ exports[`<Image /> resizeMode translates none 1`] = `
103103
exports[`<Image /> resizeMode translates repeat 1`] = `
104104
<sketch_image
105105
name="Image"
106-
resizeMode="Tile"
106+
resizeMode={0}
107107
source="foo"
108108
style={Object {}}
109109
/>
@@ -112,7 +112,7 @@ exports[`<Image /> resizeMode translates repeat 1`] = `
112112
exports[`<Image /> resizeMode translates stretch 1`] = `
113113
<sketch_image
114114
name="Image"
115-
resizeMode="Stretch"
115+
resizeMode={2}
116116
source="foo"
117117
style={Object {}}
118118
/>
@@ -121,7 +121,7 @@ exports[`<Image /> resizeMode translates stretch 1`] = `
121121
exports[`<Image /> source falls back to defaultSource if available 1`] = `
122122
<sketch_image
123123
name="Image"
124-
resizeMode="Fill"
124+
resizeMode={1}
125125
source="foo"
126126
style={Object {}}
127127
/>
@@ -130,7 +130,7 @@ exports[`<Image /> source falls back to defaultSource if available 1`] = `
130130
exports[`<Image /> source favors style over source for height 1`] = `
131131
<sketch_image
132132
name="Image"
133-
resizeMode="Fill"
133+
resizeMode={1}
134134
source={
135135
Object {
136136
"height": 500,
@@ -149,7 +149,7 @@ exports[`<Image /> source favors style over source for height 1`] = `
149149
exports[`<Image /> source favors style over source for width 1`] = `
150150
<sketch_image
151151
name="Image"
152-
resizeMode="Fill"
152+
resizeMode={1}
153153
source={
154154
Object {
155155
"uri": "foo",
@@ -168,7 +168,7 @@ exports[`<Image /> source favors style over source for width 1`] = `
168168
exports[`<Image /> source prefers source over defaultSource 1`] = `
169169
<sketch_image
170170
name="Image"
171-
resizeMode="Fill"
171+
resizeMode={1}
172172
source="foo"
173173
style={Object {}}
174174
/>
@@ -177,7 +177,7 @@ exports[`<Image /> source prefers source over defaultSource 1`] = `
177177
exports[`<Image /> source sets height from source 1`] = `
178178
<sketch_image
179179
name="Image"
180-
resizeMode="Fill"
180+
resizeMode={1}
181181
source={
182182
Object {
183183
"height": 500,
@@ -196,7 +196,7 @@ exports[`<Image /> source sets height from source 1`] = `
196196
exports[`<Image /> source sets width from source 1`] = `
197197
<sketch_image
198198
name="Image"
199-
resizeMode="Fill"
199+
resizeMode={1}
200200
source={
201201
Object {
202202
"uri": "foo",
@@ -215,7 +215,7 @@ exports[`<Image /> source sets width from source 1`] = `
215215
exports[`<Image /> style accepts a StyleSheet ordinal 1`] = `
216216
<sketch_image
217217
name="Image"
218-
resizeMode="Fill"
218+
resizeMode={1}
219219
style={
220220
Object {
221221
"flex": 1,
@@ -227,7 +227,7 @@ exports[`<Image /> style accepts a StyleSheet ordinal 1`] = `
227227
exports[`<Image /> style accepts a plain object 1`] = `
228228
<sketch_image
229229
name="Image"
230-
resizeMode="Fill"
230+
resizeMode={1}
231231
style={
232232
Object {
233233
"flex": 1,
@@ -239,7 +239,7 @@ exports[`<Image /> style accepts a plain object 1`] = `
239239
exports[`<Image /> style accepts an array of plain objects and/or StyleSheet ordinals 1`] = `
240240
<sketch_image
241241
name="Image"
242-
resizeMode="Fill"
242+
resizeMode={1}
243243
style={
244244
Object {
245245
"flex": 1,

__tests__/jest/components/nodeImpl/Svg.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable global-require */
21
import * as React from 'react';
32

43
import ReactSketch from '../../../../src';

__tests__/jest/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable global-require */
21
import ReactSketch from '../../src';
32
jest.mock('../../src/jsonUtils/sketchImpl/createStringMeasurer');
43
jest.mock('../../src/jsonUtils/sketchImpl/findFontName');

__tests__/jest/jsonUtils/computeYogaNode.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const createTreeNode = (style: { [key: string]: number | string }) => ({
2121
props: {
2222
style,
2323
},
24+
children: [],
2425
});
2526

2627
const createYogaNodes = (

__tests__/jest/jsonUtils/computeYogaTree.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const treeRootStub = {
3131
width: 96,
3232
},
3333
},
34+
children: [],
3435
},
3536
],
3637
};

__tests__/jest/reactTreeToFlexTree.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const treeRootStub = {
2525
zIndex: 1,
2626
},
2727
},
28+
children: [],
2829
},
2930
{
3031
type: 'view',
@@ -37,6 +38,7 @@ const treeRootStub = {
3738
zIndex: 3,
3839
},
3940
},
41+
children: [],
4042
},
4143
{
4244
type: 'view',
@@ -49,6 +51,7 @@ const treeRootStub = {
4951
zIndex: 2,
5052
},
5153
},
54+
children: [],
5255
},
5356
],
5457
};
@@ -85,7 +88,7 @@ describe('Compute Flex Tree', () => {
8588
width: 100,
8689
zIndex: 1,
8790
},
88-
textNodes: undefined,
91+
textNodes: [],
8992
},
9093
children: [],
9194
},
@@ -114,7 +117,7 @@ describe('Compute Flex Tree', () => {
114117
width: 200,
115118
zIndex: 2,
116119
},
117-
textNodes: undefined,
120+
textNodes: [],
118121
},
119122
children: [],
120123
},
@@ -143,7 +146,7 @@ describe('Compute Flex Tree', () => {
143146
width: 300,
144147
zIndex: 3,
145148
},
146-
textNodes: undefined,
149+
textNodes: [],
147150
},
148151
children: [],
149152
},

0 commit comments

Comments
 (0)