Skip to content

Commit

Permalink
Disable no-explicit-any
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Jul 6, 2024
1 parent 6092db9 commit 1430700
Show file tree
Hide file tree
Showing 16 changed files with 2 additions and 16 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ module.exports = {
'react/require-default-props': [ERROR, {ignoreFunctionalComponents: true}],

'@typescript-eslint/consistent-type-definitions': OFF,
'@typescript-eslint/no-explicit-any': OFF,
'@typescript-eslint/require-await': OFF,

'@typescript-eslint/ban-ts-comment': [
Expand Down
1 change: 0 additions & 1 deletion packages/docusaurus-mdx-loader/src/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import type {LoaderContext} from 'webpack';
// TODO as of April 2023, no way to import/re-export this ESM type easily :/
// This might change soon, likely after TS 5.2
// See https://github.com/microsoft/TypeScript/issues/49721#issuecomment-1517839391
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type Pluggable = any; // TODO fix this asap

const {
Expand Down
1 change: 0 additions & 1 deletion packages/docusaurus-mdx-loader/src/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import type {ProcessorOptions} from '@mdx-js/mdx';
// TODO as of April 2023, no way to import/re-export this ESM type easily :/
// This might change soon, likely after TS 5.2
// See https://github.com/microsoft/TypeScript/issues/49721#issuecomment-1517839391
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type Pluggable = any; // TODO fix this asap

type SimpleProcessorResult = {content: string; data: {[key: string]: unknown}};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import type {Parent} from 'mdast';
// This might change soon, likely after TS 5.2
// See https://github.com/microsoft/TypeScript/issues/49721#issuecomment-1517839391
// import type {Plugin} from 'unified';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type Plugin = any; // TODO fix this asap

export type AdmonitionOptions = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import type {Heading} from 'mdast';
// TODO upgrade to TS 5.3
// See https://github.com/microsoft/TypeScript/issues/49721#issuecomment-1517839391
// import type {Plugin} from 'unified';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type Plugin = any; // TODO fix this asap

interface PluginOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export interface PluginOptions {
// TODO upgrade to TS 5.3
// See https://github.com/microsoft/TypeScript/issues/49721#issuecomment-1517839391
// import type {Plugin} from 'unified';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type Plugin = any; // TODO fix this asap

const HAS_MARKDOWN_EXTENSION = /\.mdx?$/i;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import type {
// This might change soon, likely after TS 5.2
// See https://github.com/microsoft/TypeScript/issues/49721#issuecomment-1517839391
// import type {Plugin} from 'unified';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type Plugin = any; // TODO fix this asap

type DirectiveType = Directives['type'];
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-remark-plugin-npm2yarn/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import type {Transformer} from 'unified';
// This might change soon, likely after TS 5.2
// See https://github.com/microsoft/TypeScript/issues/49721#issuecomment-1517839391
// import type {Plugin} from 'unified';
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-unused-vars
type Plugin<T> = any; // TODO fix this asap

type KnownConverter = 'yarn' | 'pnpm';
Expand Down
2 changes: 0 additions & 2 deletions packages/docusaurus-theme-classic/src/theme-classic.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,6 @@ declare module '@theme/MDXComponents' {
readonly h6: (props: ComponentProps<'h6'>) => JSX.Element;
readonly admonition: typeof Admonition;
readonly mermaid: typeof Mermaid;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[tagName: string]: ComponentType<any>;
};

Expand Down Expand Up @@ -1203,7 +1202,6 @@ declare module '@theme/NavbarItem/ComponentTypes' {
readonly docSidebar: typeof DocSidebarNavbarItem;
readonly docsVersion: typeof DocsVersionNavbarItem;
readonly docsVersionDropdown: typeof DocsVersionDropdownNavbarItem;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[customComponentType: string]: ComponentType<any>;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export default function CodeBlockContainer<T extends 'div' | 'pre'>({
return (
<As
// Polymorphic components are hard to type, without `oneOf` generics
// eslint-disable-next-line @typescript-eslint/no-explicit-any
{...(props as any)}
style={prismCssVariables}
className={clsx(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,5 @@ export default function NavbarItem({type, ...props}: Props): JSX.Element {
if (!NavbarItemComponent) {
throw new Error(`No NavbarItem component found for type "${type}".`);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return <NavbarItemComponent {...(props as any)} />;
}
1 change: 0 additions & 1 deletion packages/docusaurus-types/src/routing.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ export type RouteChunkNames = {
*/
export type Registry = {
readonly [chunkName: string]: [
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Loader: () => Promise<any>,
ModuleName: string,
ResolvedModuleName: string,
Expand Down
1 change: 0 additions & 1 deletion packages/docusaurus-types/src/swizzle.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export type SwizzleConfig = {
* @see https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/60766
*/
export type WrapperProps<
// eslint-disable-next-line @typescript-eslint/no-explicit-any
T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>,
> = T extends JSXElementConstructor<infer P>
? unknown extends P
Expand Down
1 change: 0 additions & 1 deletion packages/docusaurus-utils/src/markdownUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ export function unwrapMdxCodeBlocks(content: string): string {
const regexp4 =
/(?<begin>^|\r?\n)(?<indentStart>\x20*)````(?<spaces>\x20*)mdx-code-block\r?\n(?<children>.*?)\r?\n(?<indentEnd>\x20*)````(?<end>\r?\n|$)/gs;

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const replacer = (substring: string, ...args: any[]) => {
const groups = args.at(-1);
return `${groups.begin}${groups.children}${groups.end}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export default function ComponentCreator(
}

const chunkNames = routesChunkNames[`${path}-${hash}`]!;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const loader: {[key: string]: () => Promise<any>} = {};
const modules: string[] = [];
const optsWebpack: string[] = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ function CannyWidget({basePath}: {basePath: string}) {

const theme = useCannyTheme();
useEffect(() => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const {Canny} = window as any;
Canny('render', {
boardToken: BOARD_TOKEN,
Expand Down

0 comments on commit 1430700

Please sign in to comment.