-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(linting): use zero-config ts-standard #2198
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm(?) Some minor comments on places where it is weird.
This works...but...is this how we want to format our code? We're losing things like import sorting.
@@ -6,11 +6,11 @@ import '@testing-library/jest-dom' | |||
|
|||
// Handle TypeError: env.window.matchMedia is not a function | |||
window.matchMedia = | |||
window.matchMedia || | |||
window.matchMedia ?? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering if this is ok here? Given that ??
and ||
are not exactly equivalent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be okay? window.matchMedia
is expected to be a function, so it will either be that, or undefined
or null
, but never the other falsy values
const { data } = useQuery( | ||
['health'], | ||
() => api.url(`/health`).get().json<HealthDto>(), | ||
// eslint-disable-next-line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to disable the next line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got tired fighting the linter
@Res() res: Response, | ||
@Body() generateOtpDto: GenerateOtpDto, | ||
@Body() generateOtpDto: GenerateOtpDto |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Body() generateOtpDto: GenerateOtpDto | |
@Body() generateOtpDto: GenerateOtpDto |
This one seems odd to format it in this manner (indenting subsequent decorators)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ts-standard
quirkiness I'm afraid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
|
||
addFormats({ | ||
'required-string': { | ||
validate: (val?: string): void => { | ||
if (val == undefined || val === '') { | ||
if (val === undefined || val === null || val === '') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (val === undefined || val === null || val === '') { | |
if (!val) { |
Would this be equivalent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strict-boolean-expressions
, unfortch
@@ -4,15 +4,15 @@ import { Column, DeleteDateColumn, Entity, Index, PrimaryColumn } from 'typeorm' | |||
@Entity({ name: 'sessions' }) | |||
export class Session implements ISession { | |||
@PrimaryColumn('varchar', { length: 255 }) | |||
id!: string | |||
id!: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird formatting here...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See also the standard core team's response at mightyiam/eslint-config-love#978, and related issue at standard/standard#1872
bcc8287
to
174b175
Compare
174b175
to
e9785d8
Compare
This died due to #2360 hehe rip 🪦 |
Closing this for now; here's hoping we never have to visit zero-config linting ever again, in favour of our own eslint config and some ground rules about never ever touching lint config files |
Hong mentioned zero config just last week again, so I don't think it's going away. Apologies we didn't get to merge this, best to bite the bullet and just do it. |
Actually, I have a plan... |
Context
Fixes #2197
Approach