-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Linter features for Flutter code #57238
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
Comments
For reference, the wrapper bits we want to do away with (formerly |
@Hixie : closing for staleness. Feel free to re-open or harvest into a fresh ticket. Thanks! |
I don't understand. In what sense is it stale? (I can't reopen.) |
Sorry, too brash. I was meaning possibly not up to date and maybe superseded by individual issues. Happy to keep it open. 👍 |
I've updated the list slightly but it's mostly still the same as before. |
Awesome thanks!
(Though that is a little sad.) |
See also: flutter/website#1985. |
Flutter adds to the Dart style guide with:
https://github.com/flutter/engine/blob/master/sky/specs/style-guide.md
Many things in that list could be caught by a linter (or a code reformatter), such as:
var
._
,__
,___
, etc._
arguments.as
.{}
,[]
,()
blocks should be symmetric at the start and end. (i.e. If a block starts with a newline, it ends with a newline. If it starts with two, it ends with two. If it starts with a space, it ends with a space. And so on.)if
on its own line.Avoid braces around one-line code blocks (e.g. inwe've decided to be lax about thisif
statements) unless there's a chain (withelse
) and one of the elements in the chain has a multi-line block.if
chain or?:
operator.=>
if both sides fit on the same line or if the expression is a single constructor call.The text was updated successfully, but these errors were encountered: