File tree Expand file tree Collapse file tree 4 files changed +11
-10
lines changed
Expand file tree Collapse file tree 4 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 55 "extends" : [" eslint:recommended" , " plugin:@typescript-eslint/recommended" ],
66 "rules" : {
77 "@typescript-eslint/consistent-type-imports" : " error" ,
8+ "@typescript-eslint/consistent-type-definitions" : [" error" , " type" ],
89 "@typescript-eslint/no-unused-vars" : [
910 " error" ,
1011 {
Original file line number Diff line number Diff line change @@ -5,17 +5,17 @@ import { decompress } from 'lz4js';
55export type ParseTypeGuardFunction < T > = ( obj : any ) => obj is T ;
66export type ParseReviverFunction = ( this : any , key : string , value : any ) => any ;
77
8- export interface ParseOptions {
8+ export type ParseOptions = {
99 extended ?: boolean | { enable : boolean ; relaxed ?: boolean } ;
1010 unminify ?: boolean | { enable : boolean ; keyMap ?: Record < string , string > } ;
1111 decompress ?: boolean | { enable : boolean } ;
12- }
12+ } ;
1313
14- interface _ParseOptions {
14+ type _ParseOptions = {
1515 extended : { enable : boolean ; relaxed : boolean } ;
1616 unminify : { enable : boolean ; keyMap ?: Record < string , string > } ;
1717 decompress : { enable : boolean } ;
18- }
18+ } ;
1919
2020const defaultOptions : _ParseOptions = {
2121 extended : { enable : false , relaxed : true } ,
Original file line number Diff line number Diff line change @@ -14,17 +14,17 @@ export type StringifyReplacerFunction = (
1414 value : any ,
1515) => any ;
1616
17- export interface StringifyOptions {
17+ export type StringifyOptions = {
1818 extended ?: boolean | { enable : boolean ; relaxed ?: boolean } ;
1919 minify ?: boolean | { enable : boolean ; keyMap ?: Record < string , string > } ;
2020 compress ?: boolean | { enable : boolean } ;
21- }
21+ } ;
2222
23- interface _StringifyOptions {
23+ type _StringifyOptions = {
2424 extended : { enable : boolean ; relaxed : boolean } ;
2525 minify : { enable : boolean ; keyMap : Record < string , string > | undefined } ;
2626 compress : { enable : boolean } ;
27- }
27+ } ;
2828
2929const defaultOptions : _StringifyOptions = {
3030 extended : { enable : false , relaxed : true } ,
Original file line number Diff line number Diff line change @@ -175,10 +175,10 @@ describe('[parse] decompress', () => {
175175} ) ;
176176
177177describe ( '[parse] type guard' , ( ) => {
178- interface TestObject {
178+ type TestObject = {
179179 a : number ;
180180 b : string ;
181- }
181+ } ;
182182
183183 const typeGuard = ( obj : any ) : obj is TestObject => {
184184 return typeof obj ?. a === 'number' && typeof obj ?. b === 'string' ;
You can’t perform that action at this time.
0 commit comments