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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Andrey Okonetchnikov
April 21, 2017
Programming
180
0
Share
Make Linting Great Again
Slides from my presentation at React Amsterdam 2017
Andrey Okonetchnikov
April 21, 2017
More Decks by Andrey Okonetchnikov
See All by Andrey Okonetchnikov
Component-Driven Design Systems Workshop
okonet
0
240
A Common Design Language
okonet
2
2.1k
Make Linting Great Again (Long version)
okonet
0
100
Modular CSS v2 (CSS-in-JS edition)
okonet
3
1.1k
Modular CSS — Agent Conf '17 Edition
okonet
3
400
Modular CSS
okonet
3
300
JavaScript для насыщенных пользовательских интерфейсов
okonet
0
130
Профессия "Front-end архитектор"
okonet
0
170
Other Decks in Programming
See All in Programming
These Five Tricks Can Make Your Apps Greener, Cheaper, & Nicer
hollycummins
0
180
運用エージェントは "作る" から "育てる" へ - 記憶と自己進化の3層設計パターン / self-evolving-agents-three-layer-agent-design
gawa
10
1.2k
AWSはOSSをどのように 考えているのか?
akihisaikeda
1
140
今さら聞けないCancellationToken
htkym
0
180
AI時代になぜ書くのか
mutsumix
0
450
Talking to terminals (and how they talk back) (KotlinConf 2026)
jakewharton
PRO
1
110
AlarmKitで明後日起きれるアラームアプリを作る
trickart
0
150
ECR拡張スキャンでSBOMを収集して サプライチェーン攻撃の影響調査を 爆速で終わらせてみた
akihisaikeda
2
190
cloudnative conference 2026 flyle
azihsoyn
1
210
Agent Skills を社内で育てる仕組み作り
jackchuka
1
2.4k
Cloudflare で始める Data Platform
ta93abe
0
300
ReactとSvelteのその先、Ripple-TS / Beyond React and Svelte: Ripple-TS
ssssota
3
800
Featured
See All Featured
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
130
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
290
SEO for Brand Visibility & Recognition
aleyda
0
4.6k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
210
sira's awesome portfolio website redesign presentation
elsirapls
0
250
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
360
Google's AI Overviews - The New Search
badams
0
1k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
510
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
70
39k
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