Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Lintでレビューをラクにしよう/ Easing Code Review with Lint ...
Search
TATSUNO Yasuhiro
April 03, 2019
Programming
690
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Lintでレビューをラクにしよう/ Easing Code Review with Lint for TypeScript
名古屋フロントエンドユーザーグループ TypeScript勉強会 での発表です。
https://nfug.connpass.com/event/123497/
TATSUNO Yasuhiro
April 03, 2019
More Decks by TATSUNO Yasuhiro
See All by TATSUNO Yasuhiro
No More NoSuchMethodError
exoego
1
58
ゆくKotlin くるRust
exoego
1
380
Scala 3 で GLSL のための c-like-for を実装してみた
exoego
1
1.1k
Bun に LCOV 出力を実装した
exoego
2
410
terraform-provider-aws にプルリクして マージされるまで
exoego
2
550
ライブラリをパブリッシュせずにすばやく試す
exoego
2
400
esbuild 最適化芸人
exoego
3
2.8k
いい感じに AWS を組み合わせたビルディングブロックでアプリ開発を支援する / TdTechTalk 2022 11
exoego
0
970
Empowering App Dev by Nicely-Crafted High-Level AWS Components
exoego
0
140
Other Decks in Programming
See All in Programming
速習iPhone Duo対応
yuukiw00w
2
980
wkhtmltopdfの次どうするか問題2026
willnet
2
1.9k
Agents on Rails - Rails at Scale 2026
irinanazarova
0
530
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
480
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
570
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.6k
AWSに止められる覚悟してますか?
morizo_1984
2
530
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
250
SREの越境 / SRE Collaboration
y0hgi
2
300
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
370
Unity6 URPによる海底をテーマにしたVJシステムの解説 | Unity Shader 完全に理解した 勉強会
gam0022
0
360
Workers Cache を知る
syumai
0
350
Featured
See All Featured
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
400
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
530
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
470
Build your cross-platform service in a week with App Engine
jlugia
234
19k
SEO for Brand Visibility & Recognition
aleyda
0
4.8k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
How STYLIGHT went responsive
nonsquared
100
6.3k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
940
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
620
エンジニアに許された特別な時間の終わり
watany
109
250k
My Coaching Mixtape
mlcsv
0
350
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Transcript
Lintでレビューをラクにしよう @exoego 2019-4-3 TypeScript勉強会 #nfug
twitter: @exoego 長野県の田舎でリモートワーク フロントエンドもバックエンドもプロダクトマネージメントもOSSもやるマン コミュニティ Vue i18n Japan AWS User
Group 名古屋支部 名古屋 Java User Group
TypeScriptの型検査 便利!
という話は誰かがして くれるはずなので 違う「検査」を紹介
Lint 使ってますか? 全員使ってたらLT終了
本日のお話 1. Lint の紹介 2. Lint があってよかった実体験 3. TypeScript で
Lint
1. Lint の紹介
重要だけど退屈なレビューに 時間をかけてませんか? コーディングスタイルに従ってる? 未使用コードが残ってる? 古い書き方しちゃってる?
重要だけど退屈なレビューに 時間をかけてませんか? コーディングスタイルに従ってる? 未使用コードが残ってる? 古い書き方しちゃってる? こういうレビューを自動で やってくれるのが Lint(er)
要するに Lint(またはLinter) とは プログラミングの支援ツール。ソースコードを分析し、 様々な問題を検査してくれる 検査は Warning(無視してよい)にもできるし、Error 扱 いにして見逃さず修正にしてもよい 最近の
Lint は、自動修正までやってくれる よくある修正は Lint に任せて 工数節約してコード品質アップ
色々な言語で使える Lint JavaScript: ESLint TypeScript: ESLint, TSLint CSS/altCSS: Stylelint HTML:
htmllint, tidy Markdown: markdownlint Ruby: RuboCop PHP: phplint, PHP_CodeSniffer Python: Pylint, Pycodestyle Java: Checkstyle, SpotBugs Scala: Scalafix
ESLint/TSLint で 見つけられる問題の例 ESLint: no-await-in-loop ルール ループ内の非効率かもしれない await を発見。非同期処理のレビューがラクに ESLint:
no-cond-assign ルール if (foo.bar = ‘message’”) を発見。たまにやらかす… TSLint: no-unsafe-any ルール any型での雑なメンバーアクセス、ダメ絶対。ちゃんとキャストかジェネリクス使って!!
様々な OSS が Pull Req に自動 Lint してレビューコストを下げてる →OSSメンテ続けやすくする仕組み Vue
i18n みんなも自動 Lint でレビューをラクに!
2. Lint があって よかった実体験
とある OSS に ESLint 導入→バグ発見 rules: function (field, rules) {
if (Array.isArray(field)) { $.each(fields, function (index, field) { module.remove.rule(field, rules); }); } else { module.remove.rule(field, rules); } 数年物のバグ、あなたはレビューで見つけられますか? テストがないのが問題だけど
3. TypeScript で Lint
導入デモ TypeScriptの著名レポジトリに Lint 導入して、 見つけた問題を修正 Pull Req してみた …をやろうとしたら、著名レポジトリでは あらかた導入済みだった!
著名レポジトリを参考にしよう!
TSLint派 angular/angular Microsoft/vscode nestjs/nest codercom/code-server grafana/grafana ESLint派 denoland/deno
現在 TypeScript では TSLint がメジャー が、Microsoft は ESLint を推してく らしい
ESLint/TSLint 設定多すぎて迷う? デファクトの設定に従うのがオススメ JavaScript Standard Styleベース https://www.npmjs.com/package/eslint-config-standard https://www.npmjs.com/package/tslint-config-standard 著名企業が公開した設定も広く使われてます https://www.npmjs.com/package/eslint-config-airbnb
https://www.npmjs.com/package/eslint-config-google https://www.npmjs.com/package/tslint-microsoft-contrib
まとめ 退屈なレビューは Lint に任せて、本質的な レビューに集中しよう! TypeScript では TSLint がデファクトだけど JS
にも対応した ESLint もいいよ! Lint の設定は、よく練られたデファクトに 乗っかるとラクだよ!