Skip to content

Commit

Permalink
compress-brotli - updating linting to be more inline (#1265)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredwray authored Dec 24, 2024
1 parent 6573d3f commit afc0a1c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
10 changes: 3 additions & 7 deletions packages/compress-brotli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@
},
"xo": {
"rules": {
"import/no-named-as-default": "off",
"unicorn/prefer-module": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"import/extensions": "off",
"import/no-extraneous-dependencies": "off"
"@typescript-eslint/no-unsafe-assignment": 0
}
},
"repository": {
Expand Down Expand Up @@ -59,8 +53,10 @@
},
"devDependencies": {
"@keyv/test-suite": "workspace:^",
"@vitest/coverage-v8": "^2.1.8",
"c8": "^10.1.2",
"rimraf": "^6.0.1",
"vitest": "^2.1.8",
"xo": "^0.60.0"
},
"tsd": {
Expand Down
1 change: 1 addition & 0 deletions packages/compress-brotli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export class KeyvBrotli {
}

async compress(value: any, options?: BrotliOptions): CompressResult {
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
return this.brotli.compress(value, options);
}

Expand Down
8 changes: 4 additions & 4 deletions packages/compress-brotli/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ export type Serialize = {
expires?: number;
};

export interface Options {
export type Options = {
compressOptions?: BrotliOptions;
decompressOptions?: BrotliOptions;
enable?: boolean;
serialize?: any;
deserialize?: any;
iltorb?: any;
}
};

export interface Brotli {
export type Brotli = {
serialize: BrotliSerialize<SerializeResult>;
deserialize: BrotliDeserialize<DeserializeResult>;
compress: (data: InputType, options?: BrotliOptions) => CompressResult;
decompress: (data: InputType, options?: BrotliOptions) => DecompressResult;
}
};
3 changes: 1 addition & 2 deletions packages/compress-brotli/test/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import zlib from 'node:zlib';
import v8 from 'node:v8';
import * as test from 'vitest';
import Keyv, {type KeyvStoreAdapter} from 'keyv';
import {Keyv} from 'keyv';
import KeyvBrotli from '../src/index.js';

type MyType = {
Expand All @@ -11,7 +11,6 @@ type MyType = {

test.it('default options', async t => {
const keyv = new Keyv({
// @ts-expect-error - KeyvBrotli and CompressionAdapter type
compression: new KeyvBrotli(),
});

Expand Down
2 changes: 1 addition & 1 deletion packages/compress-brotli/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {defineConfig, mergeConfig} from 'vitest/config';
import vitestConfig from '../../vitest.general.config';
import vitestConfig from '../../vitest.general.config.js';

export default mergeConfig(vitestConfig, defineConfig({}));

0 comments on commit afc0a1c

Please sign in to comment.