Skip to content

Commit c167dd9

Browse files
committed
chore: adjust code to new ESLint rules
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 3050d48 commit c167dd9

6 files changed

Lines changed: 11 additions & 11 deletions

File tree

build/extract-l10n.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55
import { GettextExtractor, JsExtractors } from 'gettext-extractor'
66

7-
const extractor = new GettextExtractor();
7+
const extractor = new GettextExtractor()
88

99
extractor
1010
.createJsParser([
@@ -15,7 +15,7 @@ extractor
1515
},
1616
}),
1717
])
18-
.parseFilesGlob('./lib/**/*.@(ts|js)');
18+
.parseFilesGlob('./lib/**/*.@(ts|js)')
1919

2020
extractor.savePotFile('./l10n/messages.pot')
2121

l10n/messages.pot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ msgid ""
22
msgstr ""
33
"Content-Type: text/plain; charset=UTF-8\n"
44

5-
#: lib/index.ts:32
5+
#: lib/index.ts:33
66
msgid "seconds"
77
msgstr ""

lib/constants.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
/**
1+
/*!
22
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
33
* SPDX-License-Identifier: GPL-3.0-or-later
44
*/
5+
56
interface Translations {
67
locale: string
78
json: object

lib/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
/**
1+
/*!
22
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
33
* SPDX-License-Identifier: GPL-3.0-or-later
44
*/
5-
import moment from 'moment/min/moment-with-locales.js'
5+
66
import { getLocale } from '@nextcloud/l10n'
77
import { getGettextBuilder } from '@nextcloud/l10n/gettext'
8+
import moment from 'moment/min/moment-with-locales.js'
89

910
const locale = getLocale()
1011
const translations = LOCALES

test/index.test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ describe('moment', () => {
2525
})
2626

2727
describe('locale', () => {
28-
2928
let locale
3029

3130
beforeEach(() => {
@@ -62,5 +61,4 @@ describe('moment', () => {
6261
expect(moment().fromNow()).to.equal('il y a quelques secondes')
6362
})
6463
})
65-
6664
})

vite.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
* SPDX-License-Identifier: GPL-3.0-or-later
44
*/
55
import { createLibConfig } from '@nextcloud/vite-config'
6-
import { readFileSync, readdirSync } from 'node:fs'
76
import { po as poParser } from 'gettext-parser'
7+
import { readdirSync, readFileSync } from 'node:fs'
88

99
const translations = Object.fromEntries(readdirSync('./l10n')
1010
.filter((name) => name !== 'messages.pot' && name.endsWith('.pot'))
@@ -23,7 +23,7 @@ const translations = Object.fromEntries(readdirSync('./l10n')
2323

2424
return [
2525
locale,
26-
json
26+
json,
2727
]
2828
}))
2929

@@ -32,6 +32,6 @@ export default createLibConfig({
3232
}, {
3333
libraryFormats: ['es', 'cjs'],
3434
replace: {
35-
LOCALES: JSON.stringify(translations)
35+
LOCALES: JSON.stringify(translations),
3636
},
3737
})

0 commit comments

Comments
 (0)