chore: upgrade eslint and prettier (#2376)

* chore: upgrade eslint and prettier

* chore: add restrict-template-expressions
This commit is contained in:
Mo
2023-07-27 14:36:05 -05:00
committed by GitHub
parent acc41edb02
commit 4a29e2a24c
1283 changed files with 4416 additions and 5131 deletions

View File

@@ -5,8 +5,12 @@ export class ByteChunker {
private bytes = new Uint8Array()
private index = 1
constructor(private minimumChunkSize: number, private onChunk: OnChunkCallbackNoProgress) {}
constructor(
private minimumChunkSize: number,
private onChunk: OnChunkCallbackNoProgress,
) {}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
private log(...args: any[]): void {
if (!this.loggingEnabled) {
return

View File

@@ -1,4 +1,4 @@
import { PureCryptoInterface, StreamDecryptor, SodiumConstant } from '@standardnotes/sncrypto-common'
import { PureCryptoInterface, StreamDecryptor, SodiumTag } from '@standardnotes/sncrypto-common'
import { FileContent } from '@standardnotes/models'
export class FileDecryptor {
@@ -22,7 +22,7 @@ export class FileDecryptor {
return undefined
}
const isFinal = result.tag === SodiumConstant.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL
const isFinal = result.tag === SodiumTag.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL
return { decryptedBytes: result.message, isFinalChunk: isFinal }
}

View File

@@ -1,5 +1,5 @@
import { FileContent } from '@standardnotes/models'
import { PureCryptoInterface, StreamEncryptor, SodiumConstant } from '@standardnotes/sncrypto-common'
import { PureCryptoInterface, StreamEncryptor, SodiumTag } from '@standardnotes/sncrypto-common'
import { FileEncryptor } from './FileEncryptor'
describe('file encryptor', () => {
@@ -46,7 +46,7 @@ describe('file encryptor', () => {
expect.any(Object),
decryptedBytes,
file.remoteIdentifier,
SodiumConstant.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL,
SodiumTag.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL,
)
})

View File

@@ -1,5 +1,5 @@
import { FileContent } from '@standardnotes/models'
import { PureCryptoInterface, StreamEncryptor, SodiumConstant } from '@standardnotes/sncrypto-common'
import { PureCryptoInterface, StreamEncryptor, SodiumTag } from '@standardnotes/sncrypto-common'
export class FileEncryptor {
private stream!: StreamEncryptor
@@ -20,7 +20,7 @@ export class FileEncryptor {
throw new Error('FileEncryptor must call initializeHeader first')
}
const tag = isFinalChunk ? SodiumConstant.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL : undefined
const tag = isFinalChunk ? SodiumTag.CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL : undefined
const encryptedBytes = this.crypto.xchacha20StreamEncryptorPush(
this.stream,