Skip to content

Commit 988961c

Browse files
committed
fix: linting issues
1 parent 75f0ceb commit 988961c

File tree

1 file changed

+15
-16
lines changed
  • packages/create-react-native-library/src

1 file changed

+15
-16
lines changed

packages/create-react-native-library/src/index.ts

+15-16
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,8 @@ const args: Record<ArgName, yargs.Options> = {
268268
// FIXME: fix the type
269269
// eslint-disable-next-line @typescript-eslint/no-explicit-any
270270
async function create(_argv: yargs.Arguments<any>) {
271-
const {_, $0, ...argv} = _argv;
272-
271+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
272+
const { _, $0, ...argv } = _argv;
273273

274274
let local = false;
275275

@@ -366,7 +366,7 @@ async function create(_argv: yargs.Arguments<any>) {
366366
validate?: (value: string) => boolean | string;
367367
}
368368
> = {
369-
'slug': {
369+
slug: {
370370
type: 'text',
371371
name: 'slug',
372372
message: 'What is the name of the npm package?',
@@ -379,28 +379,28 @@ async function create(_argv: yargs.Arguments<any>) {
379379
validateNpmPackage(input).validForNewPackages ||
380380
'Must be a valid npm package name',
381381
},
382-
'description': {
382+
description: {
383383
type: 'text',
384384
name: 'description',
385385
message: 'What is the description for the package?',
386386
validate: (input) => Boolean(input) || 'Cannot be empty',
387387
},
388-
'authorName': {
388+
authorName: {
389389
type: local ? null : 'text',
390390
name: 'authorName',
391391
message: 'What is the name of package author?',
392392
initial: name,
393393
validate: (input) => Boolean(input) || 'Cannot be empty',
394394
},
395-
'authorEmail': {
395+
authorEmail: {
396396
type: local ? null : 'text',
397397
name: 'authorEmail',
398398
message: 'What is the email address for the package author?',
399399
initial: email,
400400
validate: (input) =>
401401
/^\S+@\S+$/.test(input) || 'Must be a valid email address',
402402
},
403-
'authorUrl': {
403+
authorUrl: {
404404
type: local ? null : 'text',
405405
name: 'authorUrl',
406406
message: 'What is the URL for the package author?',
@@ -418,7 +418,7 @@ async function create(_argv: yargs.Arguments<any>) {
418418
},
419419
validate: (input) => /^https?:\/\//.test(input) || 'Must be a valid URL',
420420
},
421-
'repoUrl': {
421+
repoUrl: {
422422
type: local ? null : 'text',
423423
name: 'repoUrl',
424424
message: 'What is the URL for the repository?',
@@ -433,13 +433,13 @@ async function create(_argv: yargs.Arguments<any>) {
433433
},
434434
validate: (input) => /^https?:\/\//.test(input) || 'Must be a valid URL',
435435
},
436-
'type': {
436+
type: {
437437
type: 'select',
438438
name: 'type',
439439
message: 'What type of library do you want to develop?',
440440
choices: TYPE_CHOICES,
441441
},
442-
'languages': {
442+
languages: {
443443
type: 'select',
444444
name: 'languages',
445445
message: 'Which languages do you want to use?',
@@ -795,7 +795,7 @@ async function create(_argv: yargs.Arguments<any>) {
795795
}
796796

797797
// Some of the passed args can already be derived from the generated package.json file.
798-
const ignoredAnswers: Array<keyof Answers> = [
798+
const ignoredAnswers: (keyof Answers)[] = [
799799
'name',
800800
'slug',
801801
'description',
@@ -814,15 +814,14 @@ async function create(_argv: yargs.Arguments<any>) {
814814

815815
const libraryMetadata = Object.fromEntries(
816816
(Object.entries(answers) as AnswerEntries).filter(
817-
([answer]) =>
818-
!(
819-
ignoredAnswers.includes(answer)
820-
)
817+
([answer]) => !ignoredAnswers.includes(answer)
821818
)
822819
);
823820
libraryMetadata.version = version;
824821

825-
const libraryPackageJson = await fs.readJson(path.join(folder, 'package.json'));
822+
const libraryPackageJson = await fs.readJson(
823+
path.join(folder, 'package.json')
824+
);
826825
libraryPackageJson['create-react-native-library'] = libraryMetadata;
827826
await fs.writeJson(path.join(folder, 'package.json'), libraryPackageJson, {
828827
spaces: 2,

0 commit comments

Comments
 (0)