Add space-within-parens rule

This commit is contained in:
Jerko Steiner 2019-04-02 15:09:47 +08:00
parent adfa7a069a
commit 0630260628
3 changed files with 3 additions and 33 deletions

View File

@ -1,31 +0,0 @@
export type NonUndefinedPropertyNames<T> = {
[K in keyof T]: T[K] extends undefined ? never: K
}[keyof T]
export type OnlyRequired<T> = Pick<T, NonUndefinedPropertyNames<T>>
type Args1 = OnlyRequired<{
query: {a: number, b: string}
params: {c: number}
}>
type Args2 = OnlyRequired<{
query: {a: number, b: string}
params: undefined
}>
type Args3 = OnlyRequired<{
query: undefined
params: undefined
}>
const a: Args1 = {
query: {a: 1, b: 'two'},
params: {c: 3},
}
const b: Args2 = {
query: {a: 1, b: 'two'},
}
const c: Args3 = {}

View File

@ -67,7 +67,7 @@ describe('user', () => {
.get('/users/emails/:email', { .get('/users/emails/:email', {
params: { params: {
email: 'non-existing@address.com', email: 'non-existing@address.com',
} },
}) })
.expect(200) .expect(200)
.expect(/^$/g) .expect(/^$/g)

View File

@ -32,7 +32,8 @@
}, },
"singleline": "never", "singleline": "never",
"esSpecCompliant": true "esSpecCompliant": true
}] }],
"space-within-parens": 0
}, },
"rulesDirectory": [] "rulesDirectory": []
} }