Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion bin/packages/check-build-type-declaration-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async function getDecFile( packagePath ) {
async function typecheckDeclarations( file ) {
return new Promise( ( resolve, reject ) => {
exec(
`npx tsc --target esnext --moduleResolution node --noEmit --skipLibCheck "${ file }"`,
`npx tsc --ignoreConfig --target esnext --moduleResolution bundler --noEmit --skipLibCheck "${ file }"`,
( error, stdout, stderr ) => {
if ( error ) {
reject( { file, error, stderr, stdout } );
Expand Down
22 changes: 18 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"sprintf-js": "1.1.1",
"style-loader": "3.2.1",
"stylelint-plugin-logical-css": "^1.2.3",
"typescript": "5.9.3",
"typescript": "6.0.2",
"uuid": "9.0.1",
"wait-on": "8.0.1"
},
Expand Down
1 change: 1 addition & 0 deletions packages/boot/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"$schema": "https://json.schemastore.org/tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"types": [ "style-imports" ],
"checkJs": false
},
"references": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ import type { Modifiers, BaseProps } from '../types';

function isLocaleRTL( localeCode: string ) {
const localeObj = new Intl.Locale( localeCode );
if ( 'getTextInfo' in localeObj ) {
// @ts-expect-error - getTextInfo is not typed yet
// see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTextInfo
return localeObj.getTextInfo().direction === 'rtl';
const direction = localeObj.getTextInfo?.()?.direction;
Comment thread
manzoorwanijk marked this conversation as resolved.
Resolved
if ( direction ) {
return direction === 'rtl';
}
return [
'ar', // Arabic
Expand Down
4 changes: 2 additions & 2 deletions packages/components/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"types": [
"gutenberg-env",
"gutenberg-test-env",
"css-modules",
"jest"
"jest",
"style-imports"
]
},
"references": [
Expand Down
7 changes: 6 additions & 1 deletion packages/dataviews/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
"$schema": "https://json.schemastore.org/tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"types": [ "gutenberg-env", "gutenberg-test-env", "jest" ]
"types": [
"gutenberg-env",
"gutenberg-test-env",
"jest",
"style-imports"
]
},
"references": [
{ "path": "../components" },
Expand Down
1 change: 1 addition & 0 deletions packages/editor/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"$schema": "https://json.schemastore.org/tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"types": [ "style-imports" ],
"checkJs": false
},
"references": [
Expand Down
1 change: 1 addition & 0 deletions packages/image-cropper/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"$schema": "https://json.schemastore.org/tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"types": [ "style-imports" ],
"checkJs": false
},
"references": [
Expand Down
1 change: 1 addition & 0 deletions packages/lazy-editor/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"$schema": "https://json.schemastore.org/tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"types": [ "style-imports" ],
"checkJs": false
},
"references": [
Expand Down
2 changes: 1 addition & 1 deletion packages/notices/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json.schemastore.org/tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"types": [ "gutenberg-env" ],
"types": [ "gutenberg-env", "style-imports" ],
"checkJs": false
},
"references": [
Expand Down
2 changes: 1 addition & 1 deletion packages/theme/tsconfig.src.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"moduleResolution": "bundler",
"types": [ "css-modules" ]
"types": [ "style-imports" ]
},
"files": [ "global.d.ts" ],
"references": [ { "path": "../element" }, { "path": "../private-apis" } ]
Expand Down
2 changes: 0 additions & 2 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
/* Module Resolution Options */
"moduleResolution": "bundler",

/* This needs to be false so our types are possible to consume without setting this */
"esModuleInterop": false,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still have some esModuleInterop: true declaration in a few tsconfig.base.json. If this option is going to be completely removed in TS 7.0, we should remove them, too. So that we are prepared.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleaned up in #77095

"resolveJsonModule": true,

"typeRoots": [ "./typings", "./node_modules/@types" ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ declare module '*.module.scss' {
const classes: { [ key: string ]: string };
export default classes;
}

declare module '*.css';
declare module '*.scss';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mirka recently opened an issue (#76744) proposing that we eliminate these non-module CSS imports from our codebase.

At this moment most these imports are in the boot package. And all of them are very recent additions.

Loading