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
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
390
良いユニットテストを書こう
mototakatsu
11
3.6k
Fixstars高速化コンテスト2024準優勝解法
eijirou
0
190
ある日突然あなたが管理しているサーバーにDDoSが来たらどうなるでしょう?知ってるようで何も知らなかったDDoS攻撃と対策 #phpcon.2024
akase244
2
7.7k
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
770
令和7年版 あなたが使ってよいフロントエンド機能とは
mugi_uno
10
5.2k
watsonx.ai Dojo #6 継続的なAIアプリ開発と展開
oniak3ibm
PRO
0
170
見えないメモリを観測する: PHP 8.4 `pg_result_memory_size()` とSQL結果のメモリ管理
kentaroutakeda
0
940
Alba: Why, How and What's So Interesting
okuramasafumi
0
210
ChatGPT とつくる PHP で OS 実装
memory1994
PRO
3
190
どうして手を動かすよりもチーム内のコードレビューを優先するべきなのか
okashoi
3
870
オニオンアーキテクチャを使って、 Unityと.NETでコードを共有する
soi013
0
370
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
94
13k
We Have a Design System, Now What?
morganepeng
51
7.3k
Making the Leap to Tech Lead
cromwellryan
133
9k
Optimising Largest Contentful Paint
csswizardry
33
3k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
Code Reviewing Like a Champion
maltzj
521
39k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.3k
Building Your Own Lightsaber
phodgson
104
6.2k
The Language of Interfaces
destraynor
155
24k
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
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