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
Walking through the source code of an OSS libra...
Search
kkeeth
May 21, 2022
Programming
0
170
Walking through the source code of an OSS library(ESLint)
kkeeth
May 21, 2022
Tweet
Share
More Decks by kkeeth
See All by kkeeth
The history of Javascript frameworks: changes in front-end design philosophy
clown0082
2
110
Visually experience the beauty of mathematics with p5.js
clown0082
1
2.8k
Rediscover the joy of coding with Creative Coding
clown0082
0
1.4k
全員が意思決定する会社で開発者体験や生産性を見る大変さについて
clown0082
0
560
JavaScript × Mathematics go to Digital Art
clown0082
1
330
In-house study group at YUMEMI
clown0082
0
170
Playing Ionic Logo by p5.js
clown0082
0
220
Skills that employers recommend students to acquire
clown0082
1
260
Walking through the source code of an OSS Library(ESLint))
clown0082
0
360
Other Decks in Programming
See All in Programming
テストケースの名前はどうつけるべきか?
orgachem
PRO
0
160
ブラウザ単体でmp4書き出すまで - muddy-web - 2024-12
yue4u
3
490
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
330
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
190
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
4
350
見えないメモリを観測する: PHP 8.4 `pg_result_memory_size()` とSQL結果のメモリ管理
kentaroutakeda
0
720
ドメインイベント増えすぎ問題
h0r15h0
2
430
Jakarta EE meets AI
ivargrimstad
0
280
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
180
テストコードのガイドライン 〜作成から運用まで〜
riku929hr
5
950
useSyncExternalStoreを使いまくる
ssssota
6
1.4k
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
110
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
67
4.5k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Designing for humans not robots
tammielis
250
25k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.1k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
How to Think Like a Performance Engineer
csswizardry
22
1.2k
GraphQLとの向き合い方2022年版
quramy
44
13k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
A better future with KSS
kneath
238
17k
Transcript
Walking through the source code of an OSS library(ESLint)
'SPOUFOE&OHJOFFS-5 #FFS#BTI @kkeeth @kuwahara_jsri @kkeeth
Who am I const my_info = { Name: ‘Kuwahara KEETH
Kiyohito’, Company: ‘Yumemi Inc’, Position: ‘Servant Leader/Board’, Skills: ‘Riot.js/Next.js/Chit-chat’, }
Published
OQNKTDPNdLLFFUI
🙇 Sorry … 🙇 This slide is written in English.
However, I am still learning English, and there may be some inappropriate expressions. Plz feedback for me called “Masakari” about my talk!!
Let’s start 😆
one day in development 💁
*NDPODFSOFEBCPVUUIFCFIBWJPS PGUIJTEFQFOEFOUMJCSBSZ🤔 *TOUUIBUBIVSEMFUPCFHJOXJUI $BOZPVSFBMMZSFBEJU me my “inner voice” -FUTSFBEUIFDPEFPGUIJTMJCSBSZ
me
:FT CVU*EPOUVOEFSTUBOEXIBU UIJTMJCSBSZJTEPJOHBOE .BZCFZPVEPOUIBWFUIFUJNF *TUIBUFTTFOUJBMMZXIBUZPVXBOUUP TPMWF me my “inner
voice” *UEFQFOETPOUIFUIJOH CVU JOUFSJNTVQQPSUDBOCFBMJBCJMJUZ MBUFSPO me
#VUFWFOJGZPVVOEFSTUBOEUIF TPVSDFDPEF XIBUEPZPVEPXJUI JU my “inner voice” *GJUTBCVH JUTCFTUUPDSFBUFBO JTTVFPS13
me 8IFOEPZPVUIJOLUIBUXJMMCF SFTPMWFE %PZPVUIJOLJUXJMMCF EPOFPOUJNF my “inner voice”
*GOPU UIFXPSTUUIBUDBOIBQQFOJT UIBUXFGPSLUIFSFQPTJUPSZBOE MPBEUIFDIBOHFT 8IPJTHPJOHUPNBJOUBJOJU 8IBUTUIFDPTU me my “inner
voice” )NNN*HVFTTTP0LBZ MFUT KVTUBTTVNFUIBUTUIFEFTJHOJUT TVQQPTFEUPCF😅 me
*GOPU UIFXPSTUUIBUDBOIBQQFOJT UIBUXFGPSLUIFSFQPTJUPSZBOE MPBEUIFDIBOHFT 8IPJTHPJOHUPNBJOUBJOJU 8IBUTUIFDPTU me my “inner
voice” )NNN*HVFTTTP0LBZ MFUT KVTUBTTVNFUIBUTUIFEFTJHOJUT TVQQPTFEUPCF😅 me none of your business ʘ(^o^)ʗ
I feel like I could learn more from reading codes
😆
Then, let's read the source code of ESLint!
*NBHFCZIUUQTFTMJOUPSH
Basically, we start from the module written in the main
of package.json💁
Next, let’s look at “bin” dir.
Only 3 helper functions and an executable function here💁
None
Next, let’s look at “lib/cli.js” fi le.
None
“cli.js” depends on “ESLint” module “ESLint” module depends on “CLIEngine”
module
I found out later that...
There exists a dependency map💁 *NBHFCZIUUQTHJUIVCDPNFTMJOUFTMJOUCMPCNBJOEPDTTSDEFWFMPQFSHVJEFBSDIJUFDUVSFEFQFOEFODZTWH
Knowledge 1: Overall design
Unified format for writing each module📝
Uni fi ed format for writing each module
Uni fi ed format for writing each module
util objects rich in methods📝
w /PEFKTlVUJMzPCKFDU w MJCSVMFTVUJMTBTUVUJMT w MJCTIBSFETUSJOHVUJMT w MJCTIBSFETBTUVUJMT NFUIPET SFHHFYQBUUFSOT
w MJCTPVSDFDPEFUPLFOTUPSFVUJMT the number of using methods
Knowledge 2: Node.js’s “util” module is useful
w VUJMJOTQFDU w VUJMGPSNBU w VUJMJOIFSJUT w VUJMMQSPNJTJGZ ˡ8IBUTVSQSJTFENFXBTUIJT Methods
used by ESLint
*NBHFCZIUUQTOPEFKTPSHBQJVUJMIUNM
Knowledge 3: Generator functions in JavaScript
Do you understand the following code?💁
None
Let's take a look at some sample codes💁
None
None
None
more detail, show MDN👉
An afterthought
An afterthought w /PUXSJUUFOJOUZQFTDSJQU UZQFEF fi OJUJPOTBSFXSJUUFO w "OZXBZ
UIFEPDVNFOUBUJPOJTFYUFOTJWF w +4%PDJTXFMMEPDVNFOUFE BTJTNE w %PDVNFOUBUJPOJTVTJOH&MFWFOUZKT UZ w 5PPMTGPS44( w %PDVNFOUBUJPOBQQJTFBTJFSUPWJFXUIBOUIFP ff i DJBMTJUF w 5IFSFBSFBMTPDPODFQUTPGMBZPVUBOEDPNQPOFOUT
None
None
Thoughts💁
Thoughts w 8FEPOUIBWFUPVOEFSTUBOEJUUPUBMZ👍 w %FTJHOJOHGBNPVTMJCSBSJFTJTBHSFBUMFBSOJOHFYQFSJFODF👍 w 8FDBOJNQSPWFNZTLJMMTGPSTVSF👍 w *GZPV fi
OEJUEJ ff i DVMU ZPVDBOSFBEJUXJUITPNFPOFFMTF👍 w *GZPVIBWFUSPVCMF JU`THPPEUPSFBEGSPNUIFUFTUDPEF👍
None