Skip to content

Commit 1e610a9

Browse files
committed
chore(dependencies): updated linting and test dependencies
1 parent 6626916 commit 1e610a9

File tree

13 files changed

+1242
-696
lines changed

13 files changed

+1242
-696
lines changed

.eslintrc.js

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

.eslintrc.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"parserOptions": { "project": "./tsconfig.lint.json" },
4+
"plugins": ["react-hooks", "prettier"],
5+
"extends": [
6+
"plugin:jsx-a11y/recommended",
7+
"plugin:jest/recommended",
8+
"plugin:jest/style",
9+
"eslint:recommended",
10+
"plugin:react/recommended",
11+
"plugin:@typescript-eslint/eslint-recommended",
12+
"plugin:@typescript-eslint/recommended",
13+
14+
// Prettier overrides
15+
"prettier",
16+
"prettier/react",
17+
"prettier/@typescript-eslint"
18+
],
19+
"settings": {
20+
"react": {
21+
"version": "detect"
22+
}
23+
},
24+
"env": {
25+
"browser": true,
26+
"es6": true,
27+
"commonjs": true,
28+
"node": true,
29+
"jest": true
30+
},
31+
"rules": {
32+
// Off
33+
"react/prop-types": "off",
34+
"react/display-name": "off",
35+
"@typescript-eslint/no-explicit-any": "off",
36+
"@typescript-eslint/no-empty-function": "off",
37+
"@typescript-eslint/explicit-function-return-type": "off",
38+
"@typescript-eslint/no-var-requires": "off",
39+
"@typescript-eslint/no-empty-interface": "off",
40+
"@typescript-eslint/camelcase": "off",
41+
"@typescript-eslint/no-triple-slash-reference": "off",
42+
"@typescript-eslint/no-non-null-assertion": "off",
43+
"@typescript-eslint/ban-ts-comment": "off",
44+
"@typescript-eslint/no-use-before-define": "off",
45+
// Consider turning on eventually... lots of warnings though.
46+
"@typescript-eslint/explicit-module-boundary-types": "off",
47+
48+
// On.
49+
"prettier/prettier": "error",
50+
"no-empty": ["error", { "allowEmptyCatch": true }],
51+
"prefer-const": "error",
52+
"react-hooks/rules-of-hooks": "error",
53+
"react-hooks/exhaustive-deps": "error",
54+
"@typescript-eslint/no-unused-vars": [
55+
"error",
56+
{ "argsIgnorePattern": "^_" }
57+
],
58+
"@typescript-eslint/unbound-method": "error"
59+
}
60+
}

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@
9696
"@types/terser-webpack-plugin": "^2.2.0",
9797
"@types/webpack": "^4.41.0",
9898
"@types/webpack-node-externals": "^1.7.0",
99-
"@typescript-eslint/eslint-plugin": "^2.10.0",
100-
"@typescript-eslint/parser": "^2.10.0",
99+
"@typescript-eslint/eslint-plugin": "^3.0.0",
100+
"@typescript-eslint/parser": "^3.0.0",
101101
"ansi-colors": "^4.1.1",
102102
"awesome-typescript-loader": "^5.2.1",
103103
"babel-loader": "^8.0.6",
@@ -107,15 +107,15 @@
107107
"enzyme": "^3.10.0",
108108
"enzyme-adapter-react-16": "^1.15.1",
109109
"enzyme-to-json": "^3.4.3",
110-
"eslint": "^6.7.2",
110+
"eslint": "^7.0.0",
111111
"eslint-config-prettier": "^6.7.0",
112112
"eslint-plugin-jest": "^23.1.1",
113113
"eslint-plugin-jsx-a11y": "^6.2.3",
114114
"eslint-plugin-prettier": "^3.1.3",
115-
"eslint-plugin-react": "^7.17.0",
116-
"eslint-plugin-react-hooks": "^2.3.0",
117-
"file-loader": "^5.0.2",
118-
"jest": "^25.1.0",
115+
"eslint-plugin-react": "^7.20.0",
116+
"eslint-plugin-react-hooks": "^4.0.2",
117+
"file-loader": "^6.0.0",
118+
"jest": "^26.0.1",
119119
"jest-svg-transformer": "^1.0.0",
120120
"node-sass": "^4.13.0",
121121
"normalize.css": "^8.0.1",
@@ -130,10 +130,10 @@
130130
"sass-loader": "^8.0.0",
131131
"shelljs": "^0.8.3",
132132
"sinon": "^9.0.1",
133-
"standard-version": "^7.1.0",
133+
"standard-version": "^8.0.0",
134134
"style-loader": "^1.0.1",
135-
"ts-jest": "^25.2.0",
136-
"ts-loader": "^6.2.1",
135+
"ts-jest": "^26.0.0",
136+
"ts-loader": "^7.0.4",
137137
"ts-node": "^8.6.2",
138138
"tsconfig-paths-webpack-plugin": "^3.2.0",
139139
"typescript": "^3.7.3",

src/components/Choice/Choice.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,13 @@ export const Choice = forwardRef<HTMLInputElement, ChoiceProps>(
140140
* Observable helper to notify radio buttons that they have become unchecked.
141141
*/
142142
class RadioObservable {
143-
private _subscribers: { name: string; subscriber: Function }[];
143+
private _subscribers: { name: string; subscriber: () => void }[];
144144

145145
constructor() {
146146
this._subscribers = [];
147147
}
148148

149-
subscribe(name: string, subscriber: Function) {
149+
subscribe(name: string, subscriber: () => void) {
150150
this._trigger(name);
151151

152152
this._subscribers.push({ name, subscriber });
@@ -159,7 +159,7 @@ class RadioObservable {
159159
});
160160
}
161161

162-
private _unsubscribe(subscriber: Function) {
162+
private _unsubscribe(subscriber: () => void) {
163163
return () => {
164164
this._subscribers = this._subscribers.filter((s) => s.subscriber !== subscriber);
165165
};

src/components/Draggable/Draggable.stories.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export const Basic = () => (
2020
<DndMultiProvider>
2121
<Draggable
2222
index={0}
23-
onMove={action('onMove')}
2423
onDragChange={action('onDragChange')}
2524
disableDrag={boolean('disableDrag', false)}
2625
hideDragPreview={boolean('hideDragPreview', false)}
@@ -39,7 +38,6 @@ export const WithOnRenderChildren = () => (
3938
{isDragging ? 'This div is being dragged!' : 'This div is draggable!'}
4039
</div>
4140
)}
42-
onMove={action('onMove')}
4341
onDragChange={action('onDragChange')}
4442
disableDrag={boolean('disableDrag', false)}
4543
hideDragPreview={boolean('hideDragPreview', false)}

src/components/FileOrganizer/FileOrganizer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ export function FileOrganizer<F extends ObjectWithId>({
265265
(draggingIds && draggingIds.length && !draggingIds.includes(file.id))
266266
);
267267
const draggableRef = createRef<HTMLDivElement>();
268-
const isInDragGroup = draggingIds?.includes(file.id) ?? false;
268+
const isInDragGroup = draggingIds ? draggingIds.includes(file.id) : false;
269269
return (
270270
<Draggable
271271
data-file-id={file.id}
@@ -305,10 +305,10 @@ export function FileOrganizer<F extends ObjectWithId>({
305305
editingId,
306306
draggingId,
307307
draggingIds,
308+
pad,
308309
onRenderDragLayer,
309310
disableMove,
310311
onMove,
311-
pad,
312312
handleOnDragChange,
313313
handleItemKeyDown,
314314
onRenderThumbnail,

src/components/Thumbnail/thumbnailFocusObservable.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const validKeys = [
1010
];
1111

1212
class ThumbnailFocusObservable implements FocusObservable {
13-
private _subscribers: Function[];
13+
private _subscribers: (() => void)[];
1414
private _isUserTabbing: boolean;
1515

1616
constructor() {
@@ -22,7 +22,7 @@ class ThumbnailFocusObservable implements FocusObservable {
2222
return this._isUserTabbing;
2323
}
2424

25-
subscribe(subscriber: Function) {
25+
subscribe(subscriber: () => void) {
2626
// If adding first subscriber, begin listening to document.
2727
if (this._subscribers.length === 0) {
2828
if (this._isUserTabbing) {
@@ -36,7 +36,7 @@ class ThumbnailFocusObservable implements FocusObservable {
3636
return this._unsubscribe(subscriber);
3737
}
3838

39-
private _unsubscribe(subscriber: Function) {
39+
private _unsubscribe(subscriber: () => void) {
4040
return () => {
4141
this._subscribers = this._subscribers.filter((s) => s !== subscriber);
4242
// If no subscribers, stop listening to document.

src/data/file.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export interface FileLike {
5959
thumbnail: MemoizedPromise<string>;
6060
fileObj: MemoizedPromise<Blob>;
6161
documentObj: MemoizedPromise<CoreControls.Document>;
62-
subscribe: (...args: any) => Function;
62+
subscribe: (...args: any) => () => void;
6363
}
6464

6565
export type FileEventType =

src/hooks/useAccessibleFocus.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ export function useAccessibleFocus(observable: FocusObservable = tabObservable)
1919

2020
export interface FocusObservable {
2121
value: boolean;
22-
subscribe(subscriber: Function): void;
22+
subscribe(subscriber: () => void): void;
2323
}
2424

2525
class AccessibleFocusObservable implements FocusObservable {
26-
private _subscribers: Function[];
26+
private _subscribers: (() => void)[];
2727
private _isUserTabbing: boolean;
2828

2929
constructor() {
@@ -35,7 +35,7 @@ class AccessibleFocusObservable implements FocusObservable {
3535
return this._isUserTabbing;
3636
}
3737

38-
subscribe(subscriber: Function) {
38+
subscribe(subscriber: () => void) {
3939
// If adding first subscriber, begin listening to document.
4040
if (this._subscribers.length === 0) {
4141
if (this._isUserTabbing) {
@@ -49,7 +49,7 @@ class AccessibleFocusObservable implements FocusObservable {
4949
return this._unsubscribe(subscriber);
5050
}
5151

52-
private _unsubscribe(subscriber: Function) {
52+
private _unsubscribe(subscriber: () => void) {
5353
return () => {
5454
this._subscribers = this._subscribers.filter((s) => s !== subscriber);
5555
// If no subscribers, stop listening to document.

src/hooks/useFileSubscribe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export function useFileSubscribe<F extends FileLike, T>(
6060

6161
subscribe(true);
6262

63-
let unsubscribe: Function | undefined;
63+
let unsubscribe: (() => void) | undefined;
6464

6565
if (eventType) unsubscribe = file.subscribe(eventType, subscribe);
6666

0 commit comments

Comments
 (0)