Skip to content

Commit eea2911

Browse files
committed
update packages and adapt configs
1 parent b68726b commit eea2911

4 files changed

Lines changed: 20 additions & 17 deletions

File tree

.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"prettier",
1515
"plugin:prettier/recommended",
1616
"plugin:@typescript-eslint/recommended",
17-
"plugin:import/typescript"
17+
"plugin:import/typescript",
18+
"plugin:jest/recommended"
1819
],
1920
"parserOptions": {
2021
"sourceType": "module",

jestconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"testEnvironment": "jsdom",
23
"transform": {
34
"^.+\\.(t|j)sx?$": "ts-jest"
45
},

package.json

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,19 @@
4343
},
4444
"homepage": "https://github.com/aboutbits/internationalization#readme",
4545
"devDependencies": {
46-
"@types/node": "^14.11.5",
47-
"@types/jest": "^26.0.9",
48-
"@typescript-eslint/eslint-plugin": "^3.8.0",
49-
"@typescript-eslint/parser": "^3.8.0",
50-
"eslint": "^7.6.0",
51-
"eslint-config-prettier": "^6.11.0",
52-
"eslint-plugin-import": "^2.22.0",
53-
"eslint-plugin-jest": "^23.20.0",
54-
"eslint-plugin-prettier": "^3.1.4",
55-
"jest": "^26.2.2",
56-
"prettier": "^2.0.5",
57-
"ts-jest": "^26.1.4",
58-
"typescript": "^3.9.7"
46+
"@types/jest": "^28.1.3",
47+
"@types/node": "^16.0.0",
48+
"@typescript-eslint/eslint-plugin": "^5.30.0",
49+
"@typescript-eslint/parser": "^5.30.0",
50+
"eslint": "^8.18.0",
51+
"eslint-config-prettier": "^8.5.0",
52+
"eslint-plugin-import": "^2.26.0",
53+
"eslint-plugin-jest": "^26.5.3",
54+
"eslint-plugin-prettier": "^4.1.0",
55+
"jest": "^28.1.2",
56+
"jest-environment-jsdom": "^28.1.2",
57+
"prettier": "^2.7.1",
58+
"ts-jest": "^28.0.5",
59+
"typescript": "^4.7.4"
5960
}
6061
}

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ class Internationalization<T extends string> {
113113
)
114114

115115
// Check if the potential locale is not undefined else return the fallback language
116-
return (potentialLocale
117-
? potentialLocale.locale
118-
: this.fallbackLanguage) as T
116+
return (
117+
potentialLocale ? potentialLocale.locale : this.fallbackLanguage
118+
) as T
119119
}
120120
}
121121

0 commit comments

Comments
 (0)