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
Make Linting Great Again
Search
Andrey Okonetchnikov
April 21, 2017
Programming
0
160
Make Linting Great Again
Slides from my presentation at React Amsterdam 2017
Andrey Okonetchnikov
April 21, 2017
Tweet
Share
More Decks by Andrey Okonetchnikov
See All by Andrey Okonetchnikov
Component-Driven Design Systems Workshop
okonet
0
200
A Common Design Language
okonet
2
1.5k
Make Linting Great Again (Long version)
okonet
0
66
Modular CSS v2 (CSS-in-JS edition)
okonet
3
1k
Modular CSS — Agent Conf '17 Edition
okonet
3
330
Modular CSS
okonet
3
260
JavaScript для насыщенных пользовательских интерфейсов
okonet
0
80
Профессия "Front-end архитектор"
okonet
0
130
Other Decks in Programming
See All in Programming
Go の GC の不得意な部分を克服したい
taiyow
3
800
17年周年のWebアプリケーションにTanStack Queryを導入する / Implementing TanStack Query in a 17th Anniversary Web Application
saitolume
0
250
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
260
暇に任せてProxmoxコンソール 作ってみました
karugamo
2
720
数十万行のプロジェクトを Scala 2から3に完全移行した
xuwei_k
0
280
menu基盤チームによるGoogle Cloudの活用事例~Application Integration, Cloud Tasks編~
yoshifumi_ishikura
0
110
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
850
CSC305 Lecture 26
javiergs
PRO
0
140
Fibonacci Function Gallery - Part 1
philipschwarz
PRO
0
220
Amazon S3 NYJavaSIG 2024-12-12
sullis
0
100
命名をリントする
chiroruxx
1
420
Monixと常駐プログラムの勘どころ / Scalaわいわい勉強会 #4
stoneream
0
280
Featured
See All Featured
Building Your Own Lightsaber
phodgson
103
6.1k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
520
Become a Pro
speakerdeck
PRO
26
5k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Rails Girls Zürich Keynote
gr2m
94
13k
Designing Experiences People Love
moore
138
23k
What's in a price? How to price your products and services
michaelherold
243
12k
Typedesign – Prime Four
hannesfritz
40
2.4k
Building Adaptive Systems
keathley
38
2.3k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.4k
Transcript
Make Linting Great Again! with @okonetchnikov
What the lint?!
–Wikipedia “lint or a linter is any tool that flags
suspicious usage in software written in any computer language.”
Why lint?
You don’t need to uglify your code if it’s already
ugly!
Using lint tools leads to 1. Fewer bugs 2. Better
readability => less time for code reviews 3. Faster development
– http://www.prweb.com/releases/2013/1/prweb10298185.htm “On average, software developers spend 50% of their
time finding and fixing bugs.”
– http://www.prweb.com/releases/2013/1/prweb10298185.htm “…this inefficiency is estimated to cost the global
economy $312 billion per year.”
None
How to lint?
Stylelint JSON Lint
—Faster development?! —Really?!
None
None
None
None
None
None
None
None
None
Raise your hand if this sound familiar to you ✋
None
None
None
None
– Everyone “I wish I could lint before committing the
changes to the repository”
None
git hooks are 1. Hard to setup 2. Hard to
manage 3. Hard to share across the team
npm install -D husky yarn add --dev husky
{ "scripts": { "precommit": "eslint ." } }
None
git hooks are 1. Hard to setup 2. Hard to
manage 3. Hard to share across the team 4. Slow 5. Displaying irrelevant results
Meet lint-staged!
npm install -D lint-staged yarn add --dev lint-staged
{ "scripts": { "precommit": "lint-staged" } }
{ "scripts": { "precommit": "lint-staged" }, "lint-staged": { "*.js": "eslint"
} }
None
git hooks are 1. Hard to setup 2. Hard to
manage 3. Hard to share across the team 4. Very slow 5. Displaying irrelevant results AWE S OM E!
There is more!
Automatically fix lint errors
{ "lint-staged": { "*.js": [ "eslint --fix", "git add" ]
} }
Automatically reformat your code
{ "lint-staged": { "*.js": [ "prettier --write", "git add" ]
} }
None
lint-staged and prettier being used in create-react-app
None
https://github.com/okonet/lint-staged
Please solve real problems!
Thank You!
Andrey Okonetchnikov @okonetchnikov http://okonet.ru https://github.com/okonet