Skip to content

Commit 3bf2157

Browse files
authored
Merge pull request #96 from msgpack/typescript_eslint/2.14.0
Upgrade typescript-eslint to 2.14.0
2 parents d870ca1 + baee63f commit 3bf2157

File tree

5 files changed

+114
-86
lines changed

5 files changed

+114
-86
lines changed

.eslintrc.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,34 +35,37 @@ module.exports = {
3535
"import/no-cycle": "error",
3636
"import/no-default-export": "error",
3737

38-
"@typescript-eslint/no-unused-vars": "warn",
38+
"@typescript-eslint/await-thenable": "warn",
3939
"@typescript-eslint/array-type": ["warn", { default: "generic" }],
4040
"@typescript-eslint/camelcase": "warn",
4141
"@typescript-eslint/class-name-casing": "warn", // to allow the initial underscore
42+
"@typescript-eslint/restrict-plus-operands": ["warn", { "checkCompoundAssignments": true }],
4243
"@typescript-eslint/no-non-null-assertion": "warn", // NOTE: pay attention to it because it may cause unexpected behavior
44+
"@typescript-eslint/no-throw-literal": "warn",
45+
"@typescript-eslint/no-extra-semi": "warn",
46+
"@typescript-eslint/no-extra-non-null-assertion": "warn",
47+
"@typescript-eslint/no-unused-vars": "warn",
48+
"@typescript-eslint/no-use-before-define": "warn",
49+
"@typescript-eslint/no-for-in-array": "warn",
50+
"@typescript-eslint/no-unnecessary-condition": ["warn", { "allowConstantLoopConditions": true }],
4351
"@typescript-eslint/prefer-for-of": "warn",
4452
"@typescript-eslint/prefer-includes": "warn",
4553
"@typescript-eslint/prefer-string-starts-ends-with": "warn",
4654
"@typescript-eslint/prefer-readonly": "warn",
4755
"@typescript-eslint/prefer-regexp-exec": "warn",
48-
"@typescript-eslint/no-use-before-define": "warn",
49-
"@typescript-eslint/await-thenable": "warn",
50-
"@typescript-eslint/no-for-in-array": "warn",
5156
"@typescript-eslint/prefer-nullish-coalescing": "warn",
5257
"@typescript-eslint/prefer-optional-chain": "warn",
53-
"@typescript-eslint/no-extra-non-null-assertion": "warn",
54-
"@typescript-eslint/restrict-plus-operands": ["warn", { "checkCompoundAssignments": true } ],
5558

5659
"@typescript-eslint/indent": "off",
57-
"@typescript-eslint/no-explicit-any": "off",
5860
"@typescript-eslint/explicit-function-return-type": "off",
5961
"@typescript-eslint/explicit-member-accessibility": "off",
62+
"@typescript-eslint/no-explicit-any": "off",
6063
"@typescript-eslint/no-object-literal-type-assertion": "off",
6164
"@typescript-eslint/no-empty-interface": "off",
65+
"@typescript-eslint/no-empty-function": "off",
6266
"@typescript-eslint/no-parameter-properties": "off",
6367
"@typescript-eslint/no-var-requires": "off", // enforces `import x = require("x")`, which is TypeScript-specific
6468
"@typescript-eslint/prefer-interface": "off",
65-
"@typescript-eslint/no-empty-function": "off",
6669
"@typescript-eslint/ban-ts-ignore": "off",
6770

6871
"prettier/prettier": "warn",

.vscode/settings.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
{
2-
"eslint.autoFixOnSave": true,
3-
"eslint.validate": [
4-
"javascript",
5-
{ "language": "typescript", "autoFix": true },
6-
{ "language": "typescriptreact", "autoFix": true }
7-
],
82
"typescript.tsdk": "node_modules/typescript/lib",
9-
"files.eol": "\n"
3+
"files.eol": "\n",
4+
"editor.codeActionsOnSave": {
5+
"source.fixAll.eslint": true
6+
}
107
}

package-lock.json

Lines changed: 92 additions & 66 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Decoder.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,9 @@ export class Decoder {
387387
state.key = object;
388388
state.type = State.MAP_VALUE;
389389
continue DECODE;
390-
} else if (state.type === State.MAP_VALUE) {
390+
} else {
391+
// it must be `state.type === State.MAP_VALUE` here
392+
391393
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
392394
state.map[state.key!] = object;
393395
state.readCount++;

0 commit comments

Comments
 (0)