diff --git a/.eslintrc.json b/.eslintrc.json index d91f1f4414..88e2e54e8a 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -172,6 +172,10 @@ // Disable base rule to avoid conflict "no-use-before-define": "off", + "@typescript-eslint/consistent-type-assertions": [ + "error", + {"assertionStyle": "never"} + ], "@typescript-eslint/consistent-type-definitions": ["error", "type"], "@typescript-eslint/consistent-type-imports": "error", "@typescript-eslint/explicit-function-return-type": [ diff --git a/web/debug-require-webpack-plugin.ts b/web/debug-require-webpack-plugin.ts index c5bd6e59bb..d19fbb15a5 100644 --- a/web/debug-require-webpack-plugin.ts +++ b/web/debug-require-webpack-plugin.ts @@ -22,6 +22,7 @@ export default class DebugRequirePlugin implements WebpackPluginInstance { .tap("DebugRequirePlugin", (resolver) => { resolver.getHook("beforeRawModule").tap("DebugRequirePlugin", (req) => { if (!(nameSymbol in req)) { + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions (req as NamedRequest)[nameSymbol] = req.request; } return undefined!; @@ -31,6 +32,7 @@ export default class DebugRequirePlugin implements WebpackPluginInstance { if (req.path !== false) { const inPath = path.relative(compiler.context, req.path); if (!inPath.startsWith("../") && !(nameSymbol in req)) { + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions (req as NamedRequest)[nameSymbol] = "./" + inPath; } } @@ -40,6 +42,7 @@ export default class DebugRequirePlugin implements WebpackPluginInstance { resolver .getHook("beforeResolved") .tap("DebugRequirePlugin", (req: ResolveRequest) => { + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions const name = (req as NamedRequest)[nameSymbol]; if (name !== undefined && req.path !== false) { const names = resolved.get(req.path);