Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use bundler module resolution in TSConfig #11373

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dotcom-rendering/src/components/FollowButtons.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css } from '@emotion/react';
import type { EmotionJSX } from '@emotion/react/types/jsx-namespace';
import type { JSX } from '@emotion/react/jsx-runtime';
import { space, textSans15 } from '@guardian/source/foundations';
import {
SvgCheckmark,
Expand All @@ -11,8 +11,8 @@ import { palette } from '../palette';

type IconProps = {
isFollowing?: boolean;
iconIsFollowing: EmotionJSX.Element;
iconIsNotFollowing: EmotionJSX.Element;
iconIsFollowing: JSX.Element;
iconIsNotFollowing: JSX.Element;
};

const FollowIcon = ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* This file was migrated from:
* https://github.com/guardian/support-dotcom-components/blob/9c3eae7cb0b159db4a1c40679d6b37710b0bb937/packages/modules/src/types.ts#L12
*/
import type { EmotionJSX } from '@emotion/react/types/jsx-namespace';
import type { JSX } from '@emotion/react/jsx-runtime';

// This type can be used in place of React.FC<T> which was previously widespread
// in this codebase but is no longer recommended. In many cases it's possible to
Expand All @@ -17,4 +17,4 @@ import type { EmotionJSX } from '@emotion/react/types/jsx-namespace';

export type ReactComponent<GenericProps = Record<string, never>> = (
props: GenericProps,
) => EmotionJSX.Element;
) => JSX.Element;
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
* This file was migrated from:
* https://github.com/guardian/support-dotcom-components/blob/a482b35a25ca59f66501c4de02de817046206298/packages/modules/src/modules/shared/ModuleWrapper.tsx
*/
import type { EmotionJSX } from '@emotion/react/types/jsx-namespace';
import type { JSX } from '@emotion/react/jsx-runtime';
import type { ReactComponent } from '../lib/ReactComponent';

export function withParsedProps<
ModuleProps extends EmotionJSX.IntrinsicAttributes,
>(
export function withParsedProps<ModuleProps extends JSX.IntrinsicAttributes>(
Module: ReactComponent<ModuleProps>,
validate: (props: unknown) => props is ModuleProps,
): ReactComponent<unknown> {
Expand Down
1 change: 1 addition & 0 deletions dotcom-rendering/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"jsx": "react-jsx",
"jsxImportSource": "@emotion/react",
"lib": ["esnext", "es2015", "dom"],
"moduleResolution": "bundler",
"noEmit": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
Expand Down
1 change: 0 additions & 1 deletion dotcom-rendering/webpack/webpack.config.dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ module.exports = {
// webpack-hot-server-middleware needs to run after webpack-dev-middleware
middlewares.push({
name: 'server',
// @ts-expect-error -- it’s a MultiCompiler
middleware: webpackHotServerMiddleware(devServer.compiler, {
chunkName: 'server',
}),
Expand Down
1 change: 0 additions & 1 deletion dotcom-rendering/webpack/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ const commonConfigs = ({ platform }) => ({
...(DEV
? // DEV plugins
[
// @ts-expect-error -- somehow the type declaration isn’t playing nice
new WebpackMessages({
name: platform,
}),
Expand Down
Loading