Skip to content

Commit 3225f92

Browse files
committed
fix lint errors, fix gha js lint
1 parent 28a07a7 commit 3225f92

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+100
-86
lines changed

.github/workflows/validate-js.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ jobs:
6767
bun install
6868
6969
- name: Run ESLint (rnqc)
70-
run: cd packages/react-native-quick-crypto && bun lint
70+
run: cd packages/react-native-quick-crypto && bun lint-fix
7171

7272
- name: Run ESLint (example)
73-
run: cd example && bun lint
73+
run: cd example && bun lint-fix
7474

7575
- name: Verify no files have changed after auto-fix
7676
run: git diff --exit-code HEAD

bun.lockb

12.2 KB
Binary file not shown.

example/eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ export default typescriptEslint.config(
3535
},
3636
// don't lint config files
3737
{
38-
ignores: ['.prettierrc.js', '*.config.js'],
38+
ignores: ['*.config.js'],
3939
},
4040
);

example/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
"android": "react-native run-android",
88
"ios": "react-native run-ios",
99
"clean": "del-cli android/build node_modules/**/android/build lib",
10+
"tsc": "tsc --noEmit",
11+
"typescript": "tsc --noEmit",
1012
"lint": "eslint \"**/*.{js,ts,tsx}\"",
11-
"lint-fix": "eslint \"src/**/*.{js,ts,tsx}\" --fix",
13+
"lint-fix": "eslint \"**/*.{js,ts,tsx}\" --fix",
1214
"start": "react-native start",
1315
"pods": "cd ios && RCT_NEW_ARCH_ENABLED=1 pod install && rm -rf .xcode.env.local",
1416
"build:android": "cd android && ./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a",

example/.prettierrc.js renamed to example/prettier.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = {
1+
export default {
22
arrowParens: 'avoid',
33
bracketSameLine: true,
44
bracketSpacing: true,

example/src/benchmarks/crypto-browserify/random.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// @ts-expect-error - crypto-browserify is not typed
22
import { randomBytes } from 'crypto-browserify'
3-
import type { RandomBytesFn } from '../types'
3+
import type { BenchmarkFn } from '../types'
44

5-
const randomBytes10: RandomBytesFn = () => {
5+
const randomBytes10: BenchmarkFn = () => {
66
randomBytes(10)
77
}
88

9-
const randomBytes1024: RandomBytesFn = () => {
9+
const randomBytes1024: BenchmarkFn = () => {
1010
randomBytes(1024)
1111
}
1212

example/src/benchmarks/rnqc/random.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import rnqc from 'react-native-quick-crypto'
2-
import { RandomBytesFn } from '../types'
2+
import type { BenchmarkFn } from '../types'
33

4-
const randomBytes10: RandomBytesFn = () => {
4+
const randomBytes10: BenchmarkFn = () => {
55
rnqc.randomBytes(10)
66
}
77

8-
const randomBytes1024: RandomBytesFn = () => {
8+
const randomBytes1024: BenchmarkFn = () => {
99
rnqc.randomBytes(1024)
1010
}
1111

example/src/benchmarks/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export type RandomBytesFn = () => void
1+
export type BenchmarkFn = () => void

example/src/benchmarks/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BenchmarkResult } from '../types/Results'
1+
import type { BenchmarkResult } from '../types/Results'
22

33
export const formatNumber = (
44
n: number,

example/src/hooks/useBenchmarksList.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useCallback, useState } from 'react'
22
import type { Benchmark, BenchmarkSuite, Suites } from '../types/Suite'
3+
import type { BenchmarkFn } from '../benchmarks/types'
34

45
export const useBenchmarksList = (
56
challenger: string
@@ -82,8 +83,7 @@ const loadBenchmarks = (suiteName: string, challenger: string): Benchmark[] => {
8283

8384
// can't use dynamic strings here, as require() is compile-time
8485
/* eslint-disable @typescript-eslint/no-require-imports */
85-
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
86-
const allBenchmarks: Record<string, Record<string, Function>> = {
86+
const allBenchmarks: Record<string, Record<string, BenchmarkFn>> = {
8787
'rnqc/random': require('../benchmarks/rnqc/random').default,
8888
'crypto-browserify/random': require('../benchmarks/crypto-browserify/random')
8989
.default,

0 commit comments

Comments
 (0)