diff options
| author | ST-DDT <[email protected]> | 2024-04-21 20:33:36 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-04-21 18:33:36 +0000 |
| commit | 81d07189ec45b1e8871019a0e6aa54e60c7fd72a (patch) | |
| tree | 14aa02da5a05db9297cd2924298db318663cb8fc | |
| parent | b27d4fceebda1ff01b054d99e7211bd31ba108d1 (diff) | |
| download | faker-81d07189ec45b1e8871019a0e6aa54e60c7fd72a.tar.xz faker-81d07189ec45b1e8871019a0e6aa54e60c7fd72a.zip | |
infra(unicorn): no-await-expression-member (#2812)
| -rw-r--r-- | .eslintrc.cjs | 1 | ||||
| -rw-r--r-- | scripts/generate-locales.ts | 4 | ||||
| -rw-r--r-- | test/faker.spec.ts | 3 |
3 files changed, 3 insertions, 5 deletions
diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 6dc1c9bb..0f4d21c0 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -51,7 +51,6 @@ module.exports = defineConfig({ 'unicorn/better-regex': 'off', 'unicorn/consistent-function-scoping': 'off', 'unicorn/import-style': 'off', - 'unicorn/no-await-expression-member': 'off', 'unicorn/no-object-as-default-parameter': 'off', 'unicorn/numeric-separators-style': 'off', 'unicorn/prefer-export-from': 'off', diff --git a/scripts/generate-locales.ts b/scripts/generate-locales.ts index 9e9c4bd3..d4268778 100644 --- a/scripts/generate-locales.ts +++ b/scripts/generate-locales.ts @@ -338,9 +338,7 @@ async function normalizeLocaleFile(filePath: string, definitionKey: string) { console.log(`Running data normalization for:`, filePath); - const fileContent = ( - await readFile(filePath, { encoding: 'utf8' }) - ).toString(); + const fileContent = await readFile(filePath, { encoding: 'utf8' }); const searchString = 'export default '; const compareIndex = fileContent.indexOf(searchString) + searchString.length; const compareString = fileContent.substring(compareIndex); diff --git a/test/faker.spec.ts b/test/faker.spec.ts index 78e07de0..749e8501 100644 --- a/test/faker.spec.ts +++ b/test/faker.spec.ts @@ -18,7 +18,8 @@ describe('faker', () => { .filter((key) => typeof console[key] === 'function') .map((methodName) => vi.spyOn(console, methodName)); - (await import('..')).default; + const file: unknown = await import('..'); + expect(file).toBeDefined(); new Faker({ locale: { metadata: { title: '' } } }); |
