You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because of an issue in ESLint -- eslint/eslint#15010 -- it's not possible to both ignore files from being linted without eslint counting them as warnings in CLI output.
BUT that assumes we don't want to lint test files. If we do, we need to add the "./test/tsconfig.json" to project.
Here are all 32 errors found by the linter (including test files):
yarn run v1.22.18
$ ./ci/dev/lint.sh
/Users/jp/dev/coder/code-server/ci/dev/watch.ts
0:0 error Parsing error: "parserOptions.project" has been setfor @typescript-eslint/parser.
The file does not match your project config: ci/dev/watch.ts.
The file must be included in at least one of the projects provided
/Users/jp/dev/coder/code-server/src/node/heart.ts
64:7 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
/Users/jp/dev/coder/code-server/src/node/main.ts
191:7 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
/Users/jp/dev/coder/code-server/src/node/routes/index.ts
61:7 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
175:5 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
/Users/jp/dev/coder/code-server/src/node/routes/vscode.ts
125:5 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
/Users/jp/dev/coder/code-server/src/node/socket.ts
25:7 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
50:9 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
60:13 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
/Users/jp/dev/coder/code-server/src/node/update.ts
45:7 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
/Users/jp/dev/coder/code-server/src/node/wrapper.ts
118:7 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
166:9 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
228:7 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
233:7 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
250:11 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
272:5 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
/Users/jp/dev/coder/code-server/test/e2e/extensions/test-extension/extension.ts
7:9 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
9:9 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
/Users/jp/dev/coder/code-server/test/unit/common/emitter.test.ts
52:5 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
55:5 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
/Users/jp/dev/coder/code-server/test/unit/helpers.test.ts
16:5 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
/Users/jp/dev/coder/code-server/test/unit/node/app.test.ts
54:5 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
73:5 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
92:7 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
95:5 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
107:5 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
119:5 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
137:5 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
/Users/jp/dev/coder/code-server/test/unit/node/cli.test.ts
740:5 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
/Users/jp/dev/coder/code-server/test/unit/node/socket.test.ts
40:9 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
/Users/jp/dev/coder/code-server/test/unit/node/test-plugin/.eslintrc.js
0:0 error Parsing error: "parserOptions.project" has been setfor @typescript-eslint/parser.
The file does not match your project config: test/unit/node/test-plugin/.eslintrc.js.
The file must be included in at least one of the projects provided
/Users/jp/dev/coder/code-server/test/unit/node/util.test.ts
154:5 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
✖ 32 problems (32 errors, 0 warnings)
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The text was updated successfully, but these errors were encountered:
What is your suggestion?
To enable a new ESLint rule:
@typescript-eslint/no-floating-promises
Why do you want this feature?
We believe it would have prevented issues like #5442 and any future issues related to floating promises.
Are there any workarounds to get this functionality today?
Manually checking code myself to see if we have any floating promises.
Are you interested in submitting a PR for this?
Yes, but it might take some work. I did some initial investigation. See below:
Expand to see
To add this rule, we need to:
.eslintrc.yaml
file--max-warnings=0
fromlint.sh
Because of an issue in ESLint -- eslint/eslint#15010 -- it's not possible to both ignore files from being linted without
eslint
counting them as warnings in CLI output.BUT that assumes we don't want to lint test files. If we do, we need to add the
"./test/tsconfig.json"
toproject
.Here are all 32 errors found by the linter (including test files):
The text was updated successfully, but these errors were encountered: