Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I havesearched for related issues and found none that matched my issue.
- I haveread the FAQ and my problem is not listed.
Playground Link
none
Repro Code
importtype{SavedQueries}from"./SavedQueries.js";importtypehttp2from"node:http2";importtypehttpfrom"node:http";whereSavedQueries.jscontains only:exportconstSavedQueries;
ESLint Config
parser:'@typescript-eslint/parser'plugins:-'@typescript-eslint'extends:-'eslint:recommended'-'plugin:@typescript-eslint/recommended'-'plugin:@typescript-eslint/recommended-requiring-type-checking'parserOptions: ecmaVersion:2021 ecmaFeatures: impliedStrict:true project:-./server/tsconfig.jsonsettings:import/parsers:{'@typescript-eslint/parser': [.ts, .tsx]}import/resolver:{typescript:{}}import/extensions:[.js,.ts]import/ignore:[node_modules]env: es2021:true node:truerules:keyword-spacing:off'@typescript-eslint/keyword-spacing':-warn-before:true after:false overrides: else:{after:true}return:{after:true}try:{after:true}catch:{after:false} case:{after:true}const:{after:true}throw:{after:true}let:{after:true}do:{after:true}of:{after:true}as:{after:true}finally:{after:true}from:{after:true}import:{after:true}export:{after:true}default:{after:true}
tsconfig
{"compilerOptions": {"target":"esnext","module":"esnext","lib": ["esnext", ],"removeComments":true,"strict":true,"alwaysStrict":true,"useDefineForClassFields":true,"noUnusedLocals":true,"noUnusedParameters":true,"noImplicitReturns":true,"moduleResolution":"node","types": ["node", ],"allowSyntheticDefaultImports":true,"esModuleInterop":true,"resolveJsonModule":true,"forceConsistentCasingInFileNames":true,"importsNotUsedAsValues":"remove","strictNullChecks":true },"include": ["*" ],"exclude": ["./node_modules","./tests" ]}Expected Result
The rule always worked on my codebase with version 5.43.0. The error message appeared as soon as I moved to version 5.44.0
Actual Result
warning: Unexpected space(s) before "{" (@typescript-eslint/keyword-spacing) at server\ServerResources.ts:13:13:> 13 | import type {SavedQueries} from "./SavedQueries.js"; | ^ 14 | import type http2 from "node:http2"; 15 | import type http from "node:http"; 16 |warning: Unexpected space(s) before "http2" (@typescript-eslint/keyword-spacing) at server\ServerResources.ts:14:13: 13 | import type {SavedQueries} from "./SavedQueries.js";> 14 | import type http2 from "node:http2"; | ^ 15 | import type http from "node:http"; 16 |warning: Unexpected space(s) before "http" (@typescript-eslint/keyword-spacing) at server\ServerResources.ts:15:13: 13 | import type {SavedQueries} from "./SavedQueries.js"; 14 | import type http2 from "node:http2";> 15 | import type http from "node:http"; | ^ 16 |Additional Info
Also it is not possible to add asoverrides the linetype: {after: true} that elicits the following error running eslint:
Oops! Something went wrong! :(ESLint: 8.28.0Error: --config: Configuration for rule "@typescript-eslint/keyword-spacing" is invalid: Value {"else":{"after":true},"return":{"after":true},"try":{"after":true},"catch":{"after":false},"case":{"after":true},"const":{"after":true},"throw":{"after":true},"let":{"after":true},"do":{"after":true},"of":{"after":true},"as":{"after":true},"finally":{"after":true},"from":{"after":true},"import":{"after":true},"export":{"after":true},"default":{"after":true},"type":{"after":true}} should NOT have additional properties.Versions
| package | version |
|---|---|
@typescript-eslint/eslint-plugin | 5.44.0 |
@typescript-eslint/parser | 5.44.0 |
TypeScript | 4.9.3 |
ESLint | 8.28.0 |
node | 18.12.1 |