Skip to content

Commit 350dfbf

Browse files
authored
infra(unicorn): no-array-push-push (#2454)
1 parent 72bf57d commit 350dfbf

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ module.exports = defineConfig({
5757
'unicorn/import-style': 'off',
5858
'unicorn/no-array-callback-reference': 'off',
5959
'unicorn/no-array-for-each': 'off',
60-
'unicorn/no-array-push-push': 'off',
6160
'unicorn/no-array-reduce': 'off',
6261
'unicorn/no-await-expression-member': 'off',
6362
'unicorn/no-for-loop': 'off',

scripts/generateLocales.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,14 +183,14 @@ async function generateLocalesIndexFile(
183183
content.push(
184184
...modules.map(
185185
(module) => `import ${escapeImport(name, module)} from './${module}';`
186-
)
187-
);
188-
189-
content.push(`\nconst ${name}${fieldType} = {
186+
),
187+
'',
188+
`const ${name}${fieldType} = {
190189
${modules.map((module) => `${escapeField(name, module)},`).join('\n')}
191-
};\n`);
192-
193-
content.push(`export default ${name};`);
190+
};`,
191+
'',
192+
`export default ${name};`
193+
);
194194

195195
writeFileSync(
196196
resolve(path, 'index.ts'),

src/modules/helpers/index.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,10 @@ export class SimpleHelpersModule {
463463
if (range[0].indexOf('-') === -1) {
464464
// handle non-ranges
465465
if (isCaseInsensitive && isNaN(Number(range[0]))) {
466-
rangeCodes.push(range[0].toUpperCase().charCodeAt(0));
467-
rangeCodes.push(range[0].toLowerCase().charCodeAt(0));
466+
rangeCodes.push(
467+
range[0].toUpperCase().charCodeAt(0),
468+
range[0].toLowerCase().charCodeAt(0)
469+
);
468470
} else {
469471
rangeCodes.push(range[0].charCodeAt(0));
470472
}
@@ -481,8 +483,10 @@ export class SimpleHelpersModule {
481483
for (let i = min; i <= max; i++) {
482484
if (isCaseInsensitive && isNaN(Number(String.fromCharCode(i)))) {
483485
const ch = String.fromCharCode(i);
484-
rangeCodes.push(ch.toUpperCase().charCodeAt(0));
485-
rangeCodes.push(ch.toLowerCase().charCodeAt(0));
486+
rangeCodes.push(
487+
ch.toUpperCase().charCodeAt(0),
488+
ch.toLowerCase().charCodeAt(0)
489+
);
486490
} else {
487491
rangeCodes.push(i);
488492
}

0 commit comments

Comments
 (0)