Skip to content

Commit ffa2080

Browse files
Upgrade ESLint / TypeScript dependencies
1 parent be533fb commit ffa2080

File tree

4 files changed

+19
-17
lines changed

4 files changed

+19
-17
lines changed

.eslintrc.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"parser": "@typescript-eslint/parser",
3+
"plugins": ["@typescript-eslint"],
34
"extends": [
45
"airbnb-base",
56
"plugin:jest/recommended",
6-
"plugin:@typescript-eslint/eslint-recommended",
77
"plugin:@typescript-eslint/recommended",
88
"prettier",
99
"prettier/@typescript-eslint"
@@ -12,6 +12,7 @@
1212
"ecmaVersion": 2018
1313
},
1414
"rules": {
15+
"@typescript-eslint/no-shadow": "error",
1516
"import/extensions": [
1617
"error",
1718
{
@@ -24,7 +25,8 @@
2425
"devDependencies": ["**/*.spec.{js,ts}"]
2526
}
2627
],
27-
"import/prefer-default-export": "off"
28+
"import/prefer-default-export": "off",
29+
"no-shadow": "off"
2830
},
2931
"settings": {
3032
"import/parsers": {

demo/src/utils/auto-expand-field.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
/* eslint no-param-reassign: ["error", { "props": true, "ignorePropertyModificationsFor": ["field"] }] */
22

3-
/* eslint-disable @typescript-eslint/no-explicit-any */
3+
type anyFn = (...args: unknown[]) => void;
4+
45
/**
56
* @see https://gist.github.com/fr-ser/ded7690b245223094cd876069456ed6c
67
*/
7-
function debounce<F extends Function>(func: F, wait: number): F {
8+
function debounce<F extends anyFn>(func: F, wait: number): F {
89
let timeoutID: number;
910

10-
return (function debounced(this: any, ...args: any[]) {
11+
return (function debounced(this: unknown, ...args: unknown[]) {
1112
clearTimeout(timeoutID);
1213

1314
timeoutID = window.setTimeout(() => func.apply(this, args), wait);
14-
} as any) as F;
15+
} as unknown) as F;
1516
}
16-
/* eslint-enable @typescript-eslint/no-explicit-any */
1717

1818
/**
1919
* Grow or shrink a <textarea> field's height to fit its contents.

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,25 +49,25 @@
4949
"@babel/preset-typescript": "^7.5.5",
5050
"@types/jest": "^26.0.0",
5151
"@types/jest-when": "^2.7.0",
52-
"@typescript-eslint/eslint-plugin": "^2.2.0",
53-
"@typescript-eslint/parser": "^2.2.0",
54-
"eslint": "6.1.0",
55-
"eslint-config-airbnb-base": "14.0.0",
56-
"eslint-config-prettier": "^6.3.0",
57-
"eslint-import-resolver-typescript": "^1.1.1",
52+
"@typescript-eslint/eslint-plugin": "^4.14.0",
53+
"@typescript-eslint/parser": "^4.14.0",
54+
"eslint": "7.18.0",
55+
"eslint-config-airbnb-base": "14.2.1",
56+
"eslint-config-prettier": "^7.2.0",
57+
"eslint-import-resolver-typescript": "^2.3.0",
5858
"eslint-plugin-import": "^2.18.2",
59-
"eslint-plugin-jest": "^22.17.0",
59+
"eslint-plugin-jest": "^24.1.3",
6060
"husky": "^0.14.3",
6161
"jest": "^26.0.0",
6262
"jest-when": "^3.1.0",
6363
"npm-run-all": "^4.1.5",
64-
"prettier": "^1.13.7",
64+
"prettier": "^2.2.1",
6565
"pretty-quick": "^1.6.0",
6666
"regex-to-strings": "^2.0.1",
6767
"rimraf": "^2.6.2",
6868
"ts-jest": "^26.4.4",
6969
"ts-loader": "^6.1.0",
70-
"typescript": "^3.6.3",
70+
"typescript": "^4.1.3",
7171
"webpack": "^5.0.0",
7272
"webpack-nano": "^1.1.1"
7373
},

src/utils/trie.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function mergeGroups(headChar: Char, tailGroup: CharTrie): CharTrie {
4242
/** @borrows buildUnique as build */
4343
export function build(words: string[]): CharTrie {
4444
const uniqueWords = [...new Set(words)];
45-
// eslint-disable-next-line @typescript-eslint/no-use-before-define
45+
// eslint-disable-next-line no-use-before-define
4646
return buildUnique(uniqueWords);
4747
}
4848

0 commit comments

Comments
 (0)