Skip to content

Commit

Permalink
remove ts-expect-errors, #1465
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Dec 3, 2024
1 parent 74e0535 commit c74013d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
11 changes: 8 additions & 3 deletions js/data/updateLocaleInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import child_process from 'child_process';
import fs from 'fs';
import { LocaleData } from '../grunt/getStringMap.js';

/**
* Converts locale data from babel/localeData.json into legacy formats used by rosetta and the website.
Expand All @@ -25,7 +26,7 @@ import fs from 'fs';
*/

// Load our ground source of truth
const localeData = JSON.parse( fs.readFileSync( '../../../babel/localeData.json', 'utf8' ) );
const localeData: LocaleData = JSON.parse( fs.readFileSync( '../../../babel/localeData.json', 'utf8' ) );

// Construct the concise JS that defines the legacy locale-info format
let localeInfoSnippet = '{';
Expand All @@ -44,11 +45,15 @@ for ( const locale of Object.keys( localeData ) ) {
localeInfoSnippet = localeInfoSnippet.slice( 0, -1 );
// Close the object
localeInfoSnippet += '\n}';
type LocaleInfoObject = {
name: string;
localizedName: string;
direction: string;
};

const localeInfo = {};
const localeInfo: Record<string, LocaleInfoObject> = {};
for ( const locale of Object.keys( localeData ) ) {

// @ts-expect-error, this may be deleted soon anyways
localeInfo[ locale ] = {
name: localeData[ locale ].englishName,
localizedName: localeData[ locale ].localizedName,
Expand Down
6 changes: 0 additions & 6 deletions js/grunt/reportMedia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,6 @@ export default async ( repo: string ): Promise<boolean> => {
grunt.log.error( `not-annotated: ${abspath}` );
success = false;
}
// Report if it is a problem
// @ts-expect-error
else if ( result.isProblematic === true ) {
grunt.log.error( `incompatible-license: ${abspath}` );
success = false;
}
}

// Now iterate through the license.json entries and see which are missing files
Expand Down

0 comments on commit c74013d

Please sign in to comment.