Skip to content

Commit 8e0e96b

Browse files
committed
chore: update eslint config and prettier
1 parent b0316a6 commit 8e0e96b

File tree

5 files changed

+489
-195
lines changed

5 files changed

+489
-195
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
"@lerna-lite/run": "^1.13.0",
2828
"commitlint": "^17.0.2",
2929
"concurrently": "^7.2.2",
30-
"eslint": "^8.18.0",
31-
"eslint-config-satya164": "^3.1.11",
32-
"prettier": "^2.7.1",
33-
"typescript": "^5.0.2"
30+
"eslint": "^8.52.0",
31+
"eslint-config-satya164": "^3.2.0",
32+
"prettier": "^3.0.3",
33+
"typescript": "^5.2.2"
3434
},
3535
"commitlint": {
3636
"extends": [

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -263,13 +263,15 @@ const args: Record<ArgName, yargs.Options> = {
263263
},
264264
};
265265

266+
// FIXME: fix the type
267+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
266268
async function create(argv: yargs.Arguments<any>) {
267269
let local = false;
268270

269271
if (typeof argv.local === 'boolean') {
270272
local = argv.local;
271273
} else {
272-
let hasPackageJson = await fs.pathExists(
274+
const hasPackageJson = await fs.pathExists(
273275
path.join(process.cwd(), 'package.json')
274276
);
275277

@@ -397,7 +399,7 @@ async function create(argv: yargs.Arguments<any>) {
397399
type: local ? null : 'text',
398400
name: 'authorUrl',
399401
message: 'What is the URL for the package author?',
400-
// @ts-ignore: this is supported, but types are wrong
402+
// @ts-expect-error this is supported, but types are wrong
401403
initial: async (previous: string) => {
402404
try {
403405
const username = await githubUsername(previous);
@@ -415,7 +417,6 @@ async function create(argv: yargs.Arguments<any>) {
415417
type: local ? null : 'text',
416418
name: 'repoUrl',
417419
message: 'What is the URL for the repository?',
418-
// @ts-ignore: this is supported, but types are wrong
419420
initial: (_: string, answers: Answers) => {
420421
if (/^https?:\/\/github.com\/[^/]+/.test(answers.authorUrl)) {
421422
return `${answers.authorUrl}/${answers.slug
@@ -550,9 +551,9 @@ async function create(argv: yargs.Arguments<any>) {
550551

551552
try {
552553
version = await Promise.race([
553-
new Promise<string>((resolve) =>
554-
setTimeout(() => resolve(FALLBACK_BOB_VERSION), 1000)
555-
),
554+
new Promise<string>((resolve) => {
555+
setTimeout(() => resolve(FALLBACK_BOB_VERSION), 1000);
556+
}),
556557
spawn('npm', ['view', 'react-native-builder-bob', 'dist-tags.latest']),
557558
]);
558559
} catch (e) {
@@ -870,8 +871,8 @@ async function create(argv: yargs.Arguments<any>) {
870871
.map(
871872
([script, { name, color }]) => `
872873
${kleur[color](`Run the example app on ${kleur.bold(name)}`)}${kleur.gray(
873-
':'
874-
)}
874+
':'
875+
)}
875876
876877
${kleur.gray('$')} yarn example ${script}`
877878
)
@@ -884,7 +885,7 @@ async function create(argv: yargs.Arguments<any>) {
884885
);
885886
}
886887
}
887-
// eslint-disable-next-line babel/no-unused-expressions
888+
888889
yargs
889890
.command('$0 [name]', 'create a react native library', args, create)
890891
.demandCommand()

packages/react-native-builder-bob/src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import buildModule from './targets/module';
1212
import buildTypescript from './targets/typescript';
1313
import type { Options } from './types';
1414

15-
// eslint-disable-next-line import/no-commonjs
15+
// eslint-disable-next-line import/no-commonjs, @typescript-eslint/no-var-requires
1616
const { name, version } = require('../package.json');
1717

1818
const root = process.cwd();
@@ -22,7 +22,6 @@ const explorer = cosmiconfigSync(name, {
2222

2323
const FLOW_PRGAMA_REGEX = /\*?\s*@(flow)\b/m;
2424

25-
// eslint-disable-next-line babel/no-unused-expressions
2625
yargs
2726
.command('init', 'configure the package to use bob', {}, async () => {
2827
if (isGitDirty()) {

packages/react-native-builder-bob/src/utils/logger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import kleur from 'kleur';
22

33
const logger =
4-
(type: string, color: Function) =>
4+
(type: string, color: kleur.Color) =>
55
(...messages: unknown[]) => {
66
console.log(
77
color(kleur.bold(type)),

0 commit comments

Comments
 (0)