Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Work around Dart custom lint rule
Search
tomocy
February 28, 2020
Programming
1
430
Work around Dart custom lint rule
Flutter Meetup Osaka #2
tomocy
February 28, 2020
Tweet
Share
More Decks by tomocy
See All by tomocy
Write Container Runtime in Go
tomocy
4
3.2k
Other Decks in Programming
See All in Programming
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
1.3k
ecspresso, ecschedule, lambroll を PipeCDプラグインとして動かしてみた (プロトタイプ) / Running ecspresso, ecschedule, and lambroll as PipeCD Plugins (prototype)
tkikuc
2
1.9k
月刊 競技プログラミングをお仕事に役立てるには
terryu16
1
1.2k
Lookerは可視化だけじゃない。UIコンポーネントもあるんだ!
ymd65536
1
130
DevinとCursorから学ぶAIエージェントメモリーの設計とMoatの考え方
itarutomy
0
150
PicoRubyと暮らす、シェアハウスハック
ryosk7
0
220
Запуск 1С:УХ в крупном энтерпрайзе: мечта и реальность ПМа
lamodatech
0
960
선언형 UI에서의 상태관리
l2hyunwoo
0
270
ATDDで素早く安定した デリバリを実現しよう!
tonnsama
1
1.9k
Package Traits
ikesyo
1
210
AWS re:Invent 2024個人的まとめ
satoshi256kbyte
0
100
はてなにおけるfujiwara-wareの活用やecspressoのCI/CD構成 / Fujiwara Tech Conference 2025
cohalz
3
2.8k
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.7k
RailsConf 2023
tenderlove
29
970
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.3k
Rails Girls Zürich Keynote
gr2m
94
13k
Producing Creativity
orderedlist
PRO
343
39k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
Speed Design
sergeychernyshev
25
740
Product Roadmaps are Hard
iamctodd
PRO
50
11k
Building an army of robots
kneath
302
45k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Transcript
Dart ಠࣗLintϧʔϧͷ ϫʔΫΞϥϯυ 2020/02/28 Flutter Meetup Osaka #2 tomocy (@towocy)
੩తղੳͱ
੩తղੳ ࣮ߦϑΝΠϧΛ࣮ߦ͢Δ͜ͱͳ͘ ղੳΛߦ͏͜ͱ https://ja.wikipedia.org/wiki/%E9%9D%99%E7%9A%84%E3%82%B3%E3%83%BC%E3%83%89%E8%A7%A3%E6%9E%90
੩తղੳΛར༻͢Δ͜ͱͰ ιʔείʔυͷ ิϑΥʔϚοτ͕Ͱ͖Δ
Lint ιʔείʔυʹજΉΛ ݕग़ɺࢦఠ͢Δ
None
Lint ιʔείʔυʹજΉΛ ݕग़ɺࢦఠ͢Δ
Lint ιʔείʔυʹજΉΛ ݕग़ɺࢦఠ͢Δ
analysis_options.yaml
analysis_opsions.yaml LintϧʔϧΛྻڍͯ͠ ݕग़ɺࢦఠͷରΛఆΊΔ
ಠࣗLintϧʔϧ
ಠࣗLintϧʔϧ ެࣜҎ֎ͷLintϧʔϧཉ͍͠
ಠࣗLintϧʔϧ dart-lang/linter#697ʹͯݕ౼த (2020/02/28࣌) https://github.com/dart-lang/linter/issues/697
ಠࣗLintϧʔϧ ͲͷΑ͏ʹ࣮ݱ͞ΕΔʹͤΑ dart-lang/linterΛ͏͜ͱʹͳΓͦ͏
None
LintRuleʢϧʔϧͷ໊લɺઆ໌ɺରͷNodeΛઃఆʣ VisitorʢରͷNodeʹର͢ΔݕূΛ࣮ʣ ʢSimpleAstVisitorҎ֎ʹVisitor͕͋Δʣ
None
1. LintRuleଆͰରͷNodeΛొ͓ͯ͘͠
2. VisitorଆͰͦͷNodeΛݕࠪ͢Δ 1. LintRuleଆͰରͷNodeΛొ͓ͯ͘͠
ಠࣗLintϧʔϧͷ ϫʔΫΞϥϯυ
WidgetͷίϯετϥΫλʔͷҾ ׳शతʹ໊લ͖Ҿʹ͢Δ https://api.flutter.dev/flutter/widgets/StatelessWidget-class.html
WidgetͷίϯετϥΫλʔͷҾ ׳शతʹ໊લ͖Ҿʹ͢Δ ίϯετϥΫλʔͷҾ໊͕લ͖ҾͰͳ͍WidgetΛ ͱͯ͠ࢦఠ͢ΔLintϧʔϧ https://api.flutter.dev/flutter/widgets/StatelessWidget-class.html
ಠࣗLintϧʔϧ use named parameters in widget constructors
None
None
tool/rule.dart LintϧʔϧͷܗͱͦͷςετΛੜ͢Δ Lintϧʔϧͷ໊લ
None
ςετ LintΤϥʔΛग़ͯ͠ཉ͍͠ߦʹ // Lint ίϝϯτΛॻ͘
None
Line Rule Lintϧʔϧͷ આ໌ͱৄࡉ
None
Lint Rule LintͷରͷNodeΛొ
Lint Rule LintͷରͷNodeΛొ ࠓճΫϥεఆٛͷNodeΛղੳ͢Δ
None
Visitor ରͷNodeͷղੳ
Visitor ରͷNodeͷղੳ WidgetͷίϯετϥΫλʔͷҾ͕ ໊લ͖ҾͰ͋Δ͔Λ֬ೝ
None
None
None
None
·ͱΊ
- LintͰίʔυͷΛݕग़ - analysis_options.yamlͰ ɹLintϧʔϧΛΈ߹Θͤ - ಠࣗLintϧʔϧ·ͩඇެࣜ
ϧʔϧΛकָͬͯ͘͠Flutter/Dart!
͋Γ͕ͱ͏͍͟͝·ͨ͠
Links ੩తղੳ https://api.flutter.dev/flutter/widgets/StatelessWidget-class.html Issue ‘Support custom lint rule' https://api.flutter.dev/flutter/widgets/StatelessWidget-class.html Stateless
Widget https://api.flutter.dev/flutter/widgets/StatelessWidget-class.html Lint rule ‘use named parameters in widget constructors’ https://github.com/tomocy/dart-linter/tree/use_named_parameters_in_widget_constructors