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
CSC509 Lecture 11
javiergs
PRO
0
180
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
5
2.1k
弊社の「意識チョット低いアーキテクチャ」10選
texmeijin
5
24k
Click-free releases & the making of a CLI app
oheyadam
2
120
ヤプリ新卒SREの オンボーディング
masaki12
0
130
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
120
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
2
670
Laravel や Symfony で手っ取り早く OpenAPI のドキュメントを作成する
azuki
2
120
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
EventSourcingの理想と現実
wenas
6
2.3k
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
4
1.4k
watsonx.ai Dojo #4 生成AIを使ったアプリ開発、応用編
oniak3ibm
PRO
1
100
Featured
See All Featured
Site-Speed That Sticks
csswizardry
0
24
Designing Experiences People Love
moore
138
23k
How STYLIGHT went responsive
nonsquared
95
5.2k
Facilitating Awesome Meetings
lara
50
6.1k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Code Review Best Practice
trishagee
64
17k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
Building Applications with DynamoDB
mza
90
6.1k
Agile that works and the tools we love
rasmusluckow
327
21k
A Modern Web Designer's Workflow
chriscoyier
693
190k
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