mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-14 08:42:31 +02:00
refactor: fix more type-aware linting errors (#7479)
This commit is contained in:
parent
bf1513a3e3
commit
624735bd92
51 changed files with 192 additions and 189 deletions
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import * as lqip from './lqip';
|
||||
import type {LoaderContext} from 'webpack';
|
||||
import type {LoaderContext, LoaderModule} from 'webpack';
|
||||
|
||||
type Options = {
|
||||
base64: boolean;
|
||||
|
@ -36,8 +36,9 @@ export default async function lqipLoader(
|
|||
} else {
|
||||
if (!contentIsFileExport) {
|
||||
// eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
|
||||
const fileLoader = require('file-loader') as typeof import('file-loader');
|
||||
content = fileLoader.call(this, contentBuffer);
|
||||
const fileLoader = require('file-loader') as LoaderModule['default'];
|
||||
// @ts-expect-error: type is a bit unwieldy...
|
||||
content = fileLoader!.call(this, contentBuffer) as string;
|
||||
}
|
||||
source = content.match(
|
||||
/^(?:export default|module.exports =) (?<source>.*);/,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue