Skip to content

Enable max-statements-per-line lint rule#45475

Merged
RyanCavanaugh merged 2 commits intomicrosoft:mainfrom
RyanCavanaugh:banMultiStatements
Aug 16, 2021
Merged

Enable max-statements-per-line lint rule#45475
RyanCavanaugh merged 2 commits intomicrosoft:mainfrom
RyanCavanaugh:banMultiStatements

Conversation

@RyanCavanaugh
Copy link
Copy Markdown
Member

@amcasey found this concerning line

const inputTime = getModifiedTime(host, inputFile); host.getModifiedTime(inputFile);

I've turned on the max statements per line rule and fixed all violations. No other suspicious lines were found.

eslint's interpretation of "multiple statements" means this is mostly just regularizing our use of if (e) { s; } to if (e) s; and effectively banning single-line cb(e => { s; })

@RyanCavanaugh RyanCavanaugh changed the title Ban multi statements Enable max-statements-per-line lint rule Aug 16, 2021
@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Aug 16, 2021
@RyanCavanaugh RyanCavanaugh merged commit e00b5ec into microsoft:main Aug 16, 2021
@RyanCavanaugh RyanCavanaugh deleted the banMultiStatements branch August 17, 2021 16:04
BobobUnicorn pushed a commit to BobobUnicorn/TypeScript that referenced this pull request Oct 24, 2021
* Enable the rule

* Fix all the violations
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants