Skip to content

Commit 0637345

Browse files
chore: fix prettier and eslint warnings (#2137)
1 parent 8020427 commit 0637345

File tree

3 files changed

+27
-26
lines changed

3 files changed

+27
-26
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"test:tsd": "jest -c jest.config.types.js",
1717
"test:all": "yarn test && yarn test:integration && yarn test:e2e && yarn test:tsd",
1818
"lint:types": "tsc",
19-
"lint:eslint": "eslint './packages",
19+
"lint:eslint": "eslint ./packages",
2020
"lint:all": "yarn lint:eslint && yarn lint:types",
2121
"prettier": "prettier --write '**/*.{ts,tsx,js,jsx}'",
2222
"prettier:check": "prettier --check '**/*.{ts,tsx,js,jsx}'",

packages/cli/src/lingui-compile.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ export async function command(
4545
},
4646
})
4747

48-
if (!options.allowEmpty && locale !== config.pseudoLocale && missingMessages.length > 0) {
48+
if (
49+
!options.allowEmpty &&
50+
locale !== config.pseudoLocale &&
51+
missingMessages.length > 0
52+
) {
4953
console.error(
5054
chalk.red(
5155
`Error: Failed to compile catalog for locale ${chalk.bold(locale)}!`

packages/cli/src/test/compile.test.ts

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -101,41 +101,38 @@ msgstr ""
101101
}
102102
)
103103

104-
it(
105-
"Should allow empty translation for pseudo locale",
106-
async () => {
107-
expect.assertions(4)
104+
it("Should allow empty translation for pseudo locale", async () => {
105+
expect.assertions(4)
108106

109-
const rootDir = await createFixtures({
110-
"/test": {
111-
"en.po": `
107+
const rootDir = await createFixtures({
108+
"/test": {
109+
"en.po": `
112110
msgid "Hello World"
113111
msgstr "Hello World"
114112
`,
115-
"pl.po": `
113+
"pl.po": `
116114
msgid "Hello World"
117115
msgstr ""
118116
`,
119-
},
120-
})
117+
},
118+
})
121119

122-
const config = getConfig(rootDir, 'pl')
120+
const config = getConfig(rootDir, "pl")
123121

124-
await mockConsole(async (console) => {
125-
const result = await command(config, {
126-
allowEmpty: false,
127-
})
128-
const actualFiles = readFsToJson(config.rootDir)
122+
await mockConsole(async (console) => {
123+
const result = await command(config, {
124+
allowEmpty: false,
125+
})
126+
const actualFiles = readFsToJson(config.rootDir)
129127

130-
expect(actualFiles["pl.js"]).toBeTruthy()
131-
expect(actualFiles["en.js"]).toBeTruthy()
128+
expect(actualFiles["pl.js"]).toBeTruthy()
129+
expect(actualFiles["en.js"]).toBeTruthy()
132130

133-
const log = getConsoleMockCalls(console.error)
134-
expect(log).toBeUndefined()
135-
expect(result).toBeTruthy()
136-
})
137-
}
138-
)
131+
const log = getConsoleMockCalls(console.error)
132+
expect(log).toBeUndefined()
133+
expect(result).toBeTruthy()
134+
})
135+
})
139136

140137
it("Should show missing messages verbosely when verbose = true", async () => {
141138
expect.assertions(2)

0 commit comments

Comments
 (0)