Skip to content

Commit c2d3af8

Browse files
authored
feat: modernize build target to ES2022 (#94)
1 parent 7be9fa2 commit c2d3af8

File tree

8 files changed

+8
-35
lines changed

8 files changed

+8
-35
lines changed

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
module.exports = {
33
roots: ['<rootDir>/src'],
44
transform: {
5-
'^.+\\.ts$': ['ts-jest', {tsconfig: {verbatimModuleSyntax: false}}],
5+
'^.+\\.ts$': ['ts-jest'],
66
},
77
setupFilesAfterEnv: ['<rootDir>/setup-tests.ts'],
88
};

package-lock.json

Lines changed: 1 addition & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"@gravity-ui/prettier-config": "^1.1.0",
3636
"@gravity-ui/tsconfig": "^1.0.0",
3737
"@types/jest": "^29.5.12",
38-
"@types/lodash": "^4.17.7",
3938
"eslint": "^9.39.2",
4039
"globals": "^17.3.0",
4140
"husky": "^9.1.7",
@@ -47,8 +46,7 @@
4746
"typescript": "^5.9.3"
4847
},
4948
"dependencies": {
50-
"dayjs": "1.11.10",
51-
"lodash": "^4.17.0"
49+
"dayjs": "1.11.10"
5250
},
5351
"nano-staged": {
5452
"*.{js,ts}": [

src/settings/settings.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import cloneDeep from 'lodash/cloneDeep';
2-
31
import {isLikeRelative, parse} from '../datemath';
42
import dayjs from '../dayjs';
53
import {normalizeTimeZone} from '../timeZone';
@@ -52,7 +50,7 @@ class Settings implements PublicSettings {
5250
throw new Error('There is something really wrong happening. Locale data is absent.');
5351
}
5452

55-
return cloneDeep(localeObject) as Locale;
53+
return structuredClone(localeObject) as Locale;
5654
}
5755

5856
setLocale(locale: string) {

src/timeZone/timeZone.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export const guessUserTimeZone = () => Intl.DateTimeFormat().resolvedOptions().t
1212
* Returns all time zones.
1313
*/
1414
// remove when Intl definition is extended
15-
// @ts-expect-error https://github.com/microsoft/TypeScript/issues/49231
1615
export const getTimeZonesList = (): string[] => Intl.supportedValuesOf?.('timeZone') || [];
1716

1817
const validTimeZones: Record<TimeZone, boolean> = {};

src/utils/locale.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,11 @@ export function getDateTimeFormat(locale: string, options: Intl.DateTimeFormatOp
1212
return dateTimeFormat;
1313
}
1414

15-
// @ts-expect-error
1615
const listFormatCache = new Map<string, Intl.ListFormat>();
17-
// @ts-expect-error
1816
export function getListFormat(locale: string, options: Intl.ListFormatOptions = {}) {
1917
const key = JSON.stringify([locale, options]);
2018
let listFormat = listFormatCache.get(key);
2119
if (!listFormat) {
22-
// @ts-expect-error
2320
listFormat = new Intl.ListFormat(locale, options);
2421
listFormatCache.set(key, listFormat);
2522
}

tsconfig.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
"extends": "@gravity-ui/tsconfig/tsconfig",
33
"compilerOptions": {
44
"noEmit": true,
5-
"target": "es5",
5+
"target": "es2022",
66
"allowJs": false,
7-
"module": "ESNext",
8-
"moduleResolution": "Node10",
9-
"verbatimModuleSyntax": true,
7+
"module": "node16",
8+
"moduleResolution": "node16",
109
"noFallthroughCasesInSwitch": false
1110
},
1211
"include": ["**/*"],

tsconfig.publish.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
"compilerOptions": {
44
"noEmit": false,
55
"declaration": true,
6-
"outDir": "build",
7-
"verbatimModuleSyntax": false,
8-
"module": "NodeNext",
9-
"moduleResolution": "NodeNext"
6+
"outDir": "build"
107
},
118
"include": ["src"],
129
"exclude": ["**/*.test.ts", "**/__tests__/**/*"]

0 commit comments

Comments
 (0)