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
68
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
140
Other Decks in Programming
See All in Programming
チームリードになって変わったこと
isaka1022
0
200
[Fin-JAWS 第38回 ~re:Invent 2024 金融re:Cap~]FaultInjectionServiceアップデート@pre:Invent2024
shintaro_fukatsu
0
410
ソフトウェアエンジニアの成長
masuda220
PRO
10
1.1k
定理証明プラットフォーム lapisla.net
abap34
1
1.8k
Honoをフロントエンドで使う 3つのやり方
yusukebe
7
3.2k
Boost Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
200
社内フレームワークとその依存性解決 / in-house framework and its dependency management
vvakame
1
560
CNCF Project の作者が考えている OSS の運営
utam0k
6
710
SRE、開発、QAが協業して挑んだリリースプロセス改革@SRE Kaigi 2025
nealle
3
4.3k
pylint custom ruleで始めるレビュー自動化
shogoujiie
0
110
Pythonでもちょっとリッチな見た目のアプリを設計してみる
ueponx
1
550
Domain-Driven Transformation
hschwentner
2
1.9k
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1368
200k
Build The Right Thing And Hit Your Dates
maggiecrowley
34
2.5k
A Tale of Four Properties
chriscoyier
158
23k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.2k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
630
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
30
2.2k
Fontdeck: Realign not Redesign
paulrobertlloyd
83
5.4k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
100
18k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
40
2k
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.5k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.3k
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