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.6k
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
340
Modular CSS
okonet
3
260
JavaScript для насыщенных пользовательских интерфейсов
okonet
0
80
Профессия "Front-end архитектор"
okonet
0
130
Other Decks in Programming
See All in Programming
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
9
2.3k
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
8
1.9k
混沌とした例外処理とエラー監視に秩序をもたらす
morihirok
13
2.2k
いりゃあせ、PHPカンファレンス名古屋2025 / Welcome to PHP Conference Nagoya 2025
ttskch
1
160
はてなにおけるfujiwara-wareの活用やecspressoのCI/CD構成 / Fujiwara Tech Conference 2025
cohalz
2
2.6k
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
240
見えないメモリを観測する: PHP 8.4 `pg_result_memory_size()` とSQL結果のメモリ管理
kentaroutakeda
0
930
快速入門可觀測性
blueswen
0
500
サーバーゆる勉強会 DBMS の仕組み編
kj455
1
300
Simple組み合わせ村から大都会Railsにやってきた俺は / Coming to Rails from the Simple
moznion
3
2.1k
php-conference-japan-2024
tasuku43
0
430
PSR-15 はあなたのための ものではない? - phpcon2024
myamagishi
0
400
Featured
See All Featured
Become a Pro
speakerdeck
PRO
26
5.1k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Building Flexible Design Systems
yeseniaperezcruz
328
38k
Practical Orchestrator
shlominoach
186
10k
For a Future-Friendly Web
brad_frost
176
9.5k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
230
52k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.6k
What's in a price? How to price your products and services
michaelherold
244
12k
Documentation Writing (for coders)
carmenintech
67
4.5k
Scaling GitHub
holman
459
140k
How GitHub (no longer) Works
holman
312
140k
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
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