์ ๊ธฐ ๋ฐฐํฌ๊ฐ ๋๊ฐ์ผ ํ๋๋ฐ ๋น๋์ค์ eslint ์๋ฌ๋ก ๋ฉ์ถ ์ ์ด ์๋ค.
ํด๋น ํ์ผ์ tsx ์ด๊ณ , ์ ํ๊ธฐ๋ฒ์ผ๋ก ๊ฐ์ฒด๋ฅผ ์กฐํํ๋ ๋ถ๋ถ์์ ๋๋ ์๋ฌ์๋ค.
ํด๋น ์๋ฌ๋ฅผ ์์ ํ PR์ ์ฝ๋ ๋ฆฌ๋ทฐํ๋ฉฐ ์ฒ์์์๋ ๊ฐ์ฒด ์กฐํ ํ์ ๊ฐ์ ์ฐจ์ด ๋๋ฌธ์ธ๊ฐ? ์ถ์๋๋ฐ ์ฐพ์๋ณด๋ ํ์ ์คํฌ๋ฆฝํธ์์ ๊ฐ์ฒด๋ฅผ ์กฐํํ ๋์ ๋ฌธ์ ์๋ค.


์ ์ฝ๋๋ฅผ ๋ณด๋ฉด target.childNodes๋ฅผ ๋ณต์ฌํ์ฌ ๋ด๋ถ ๋ฐฐ์ด์ ์ํํ๋ค. ์ด๋ ๊ฐ ๋ฐฐ์ด์๋ ๊ฐ์ฒด๊ฐ ๋ค์ด์๋๋ฐ ์ด ๊ฐ์ฒด๋ฅผ ๊ฐ๋ฆฌํค๋๊ฒ cur์ด๋ค. ํ์ง๋ง cur์ ๋ํ ์ด๋ ํ ํ์ ์ ์๋ ๋์ด์์ง ์๋ค.
ํ์ ์คํฌ๋ฆฝํธ์์๋ ๊ฐ์ฒด์ ๋ํ ํ์ ์ ์๋ฅผ type ๋๋ interface๋ฅผ ํตํด์ ์ ๊ณตํ๋๋ฐ ํ์ ์ด ๋ช ์๋์ด ์์ง ์์ ๊ฒฝ์ฐ ์ ํ๊ธฐ๋ฒ์ ํตํด ๊ฐ์ฒด๋ฅผ ์กฐํํ๋ฉด ์๋ฌ๋ฅผ ๋ฟ๋๋ค.
๋ฐ๋๋ผ ์๋ฐ์คํฌ๋ฆฝํธ์์์ ์ ํ๊ธฐ๋ฒ๊ณผ ๋๊ดํธ ํ๊ธฐ๋ฒ์ ๊ธฐ๋ฅ์ ์ผ๋ก ๋์ผํ๋ค. ( ๋์ ๋ฐ๋ผ ๋๊ดํธ ํ๊ธฐ๋ฒ์ ์จ์ผ ํ๊ธฐ๋ ํ๋ค. ) ํ์ง๋ง ํ์ ์คํฌ๋ฆฝํธ์์๋ ์กฐ๊ธ ๋ ๊ฐํ ์ ์ฝ์ ์ค์ผ๋ก์ ๋ฐ์ํ ์ ์๋ ์ฌ์ด๋ ์ดํํธ๋ฅผ ๋ฐฉ์งํด์ค๋ค.
์ฐธ๊ณ ํ ์ฌ์ดํธ
https://stackoverflow.com/questions/30089879/typescript-and-dot-notation-access-to-objects
TypeScript and dot-notation access to objects
If TypeScript is a strict superset of JavaScript, why is dot notation on an arbitrary object erroneous? I have JS code that I want to convert over to TS for better type safety, but all access using...
stackoverflow.com
https://www.bennadel.com/blog/3126-object-access-bracket-notation-vs-dot-notation-with-typescript-in-angular-2-rc-4.htmhttps://stackoverflow.com/questions/30089879/typescript-and-dot-notation-access-to-objects
Object Access: Bracket-Notation vs. Dot-Notation With TypeScript In An
Ben Nadel looks at object access in TypeScript and how bracket-notation and dot-notation have different type-checking implications in an Angular 2 application running on TypeScript.
www.bennadel.com