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
410
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.1k
Other Decks in Programming
See All in Programming
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
340
受け取る人から提供する人になるということ
little_rubyist
0
250
subpath importsで始めるモック生活
10tera
0
310
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
2k
色々なIaCツールを実際に触って比較してみる
iriikeita
0
330
Realtime API 入門
riofujimon
0
150
役立つログに取り組もう
irof
28
9.6k
距離関数を極める! / SESSIONS 2024
gam0022
0
290
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
8
540
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
1
300
CSC509 Lecture 12
javiergs
PRO
0
160
Remix on Hono on Cloudflare Workers
yusukebe
1
300
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
Scaling GitHub
holman
458
140k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Into the Great Unknown - MozCon
thekraken
32
1.5k
Faster Mobile Websites
deanohume
305
30k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Rails Girls Zürich Keynote
gr2m
94
13k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
Building an army of robots
kneath
302
43k
Embracing the Ebb and Flow
colly
84
4.5k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
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