[ESLint] React hook + Typescript ํ”„๋กœ์ ํŠธ ์‹œ ์„ค์ •ํ•œ rule ๊ณต์œ 
์›น (WEB)/๊ณต๋ถ€ 2020. 12. 14. 14:01

module.exports = { 'parser': '@typescript-eslint/parser', 'plugins': ['@typescript-eslint'], 'env': { 'commonjs': true, 'browser': true, 'es2021': true, 'node' : true }, 'extends': [ 'airbnb', 'airbnb/hooks', 'plugin:@typescript-eslint/recommended' ], 'parserOptions': { 'project': './tsconfig.json', 'ecmaFeatures': { 'jsx': true, }, 'ecmaVersion': 12, 'sourceType': 'module', }, 'rules': { 'inden..

[Typescript] ๊ธฐ์กด React + js ํ”„๋กœ์ ํŠธ ts๋กœ ๋ฐ”๊พธ๊ธฐ
์›น (WEB)/๊ณต๋ถ€ 2020. 12. 14. 13:58

Typescript ์ฐธ๊ณ  : https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html (Typescript ๊ณต์‹ ์‚ฌ์ดํŠธ) ๋ฐฐ์šฐ๋Š” ์ด์œ  JS์—์„œ๋Š” Type์ด ๊ณ„์† ์ฒดํฌ๋˜์ง€ ์•Š๋Š”๋‹ค. 1. ์ด๋Š” ์•”๋ฌต์  ํ˜•๋ณ€ํ™˜, hoisting, ๋ณต์žก์„ฑ ๋ฌธ์ œ๋ฅผ ์ผ์œผํ‚ฌ ์ˆ˜ ์žˆ๋‹ค. ์ด๋Ÿฌํ•œ ์ฝ”๋“œ ์ƒ์˜ ์˜ˆ์ƒ์น˜ ๋ชปํ•œ ๋ฒ„๊ทธ๋ฅผ ์—†์• ๊ธฐ ์œ„ํ•ด typescript๋ฅผ ์ฃผ๋กœ ์‚ฌ์šฉํ•œ๋‹ค. hoisting : ๋Œ์–ด์˜ฌ๋ฆฐ๋‹ค๋Š” ๋œป. javascript์—์„œ ์„ ์–ธ๋ฌธ์„ ๋Œ์–ด์˜ฌ๋ ค ์ฝ”๋“œ์—์„œ ์‚ฌ์šฉํ•  ๋•Œ ์ˆœ์„œ์— ์ƒ๊ด€์—†์ด ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•˜๋„๋ก ํ•˜๋Š” ๊ธฐ์ˆ . typescript๋Š” ๋ณต์žกํ•œ ์˜ˆ์™ธ์ฒ˜๋ฆฌ ์ฝ”๋“œ ์—†์ด ์ด๋ฅผ ์ˆ˜ํ–‰ํ•œ๋‹ค. 2. ํ˜‘์—… ์‹œ์—๋‚˜ ์ถ”ํ›„์— ๋ณธ์ธ์ด ์ง  ์ฝ”๋“œ๋ฅผ ๋ณด์•˜์„ ๋•Œ ํƒ€์ž…์ด ์ •์˜๋˜์–ด ์žˆ์ง€ ์•Š๋‹ค๋ฉด ํ•˜๋‚˜..

[Typescript] TS2691: import .ts file
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2020. 12. 14. 13:58

TS2691: import .ts file ์ฐธ๊ณ  : https://github.com/microsoft/TypeScript/issues/37582 https://github.com/microsoft/TypeScript/issues/27481 https://github.com/microsoft/TypeScript/issues/39965 ์ด ์˜ค๋ฅ˜๋Š” typescript ํŒŒ์ผ์„ ์ฐพ์„ ์ˆ˜ ์—†์–ด์„œ ๋‚˜๋Š” ์˜ค๋ฅ˜์ด๋‹ค. import A from 'A.tsx'; ์œ„์™€ ๊ฐ™์ด ํŒŒ์ผ์„ ๋ถˆ๋Ÿฌ์˜ค๋ฉด, import ์ „์— ts / tsx ํŒŒ์ผ์ด js / jsx ๋กœ ๋ณ€ํ™˜๋˜๊ธฐ ๋•Œ๋ฌธ์— ํ•ด๋‹น ํŒŒ์ผ์„ ์ฐพ์„ ์ˆ˜ ์—†๋‹ค๋Š” ์—๋Ÿฌ๊ฐ€ ๋œฌ๋‹ค. ๋”ฐ๋ผ์„œ, ๋‹จ์ˆœํžˆ ํ™•์žฅ์ž๋ฅผ ๋ถ™์ด์ง€ ์•Š๊ณ  import ํ•ด์˜ค๋Š” ๊ฒƒ์ด ๊ฐ€์žฅ ๊ฐ„๋‹จํ•œ ๋ฐฉ๋ฒ•์ธ๋ฐ ๊ทธ๋ ‡๊ฒŒ ํ•˜๋ฉด esl..

[React] React MVVM ๊ตฌ์กฐ MobX / Redux ์—†์ด ๊ตฌํ˜„ํ•˜๊ธฐ (Feat. Context API)
์›น (WEB)/๊ณต๋ถ€ 2020. 12. 8. 14:57

[2021-03-04 ์ตœ์ข… ์ˆ˜์ •] ๋ฐœ๋‹จ KOS ํ”„๋กœ์ ํŠธ ์ง„ํ–‰ ์ค‘์— ์ƒํƒœ๊ด€๋ฆฌ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ(Redux, Mobx)๋ฅผ ์ถ”ํ›„ ๋„์ž…ํ•˜๊ธฐ๋กœ ํ•˜๊ณ , ๋จผ์ € MVVM ํŒจํ„ด๋งŒ ์‚ฌ์šฉํ•˜๊ธฐ๋กœ ํ•˜์˜€๋‹ค. ํ•˜์ง€๋งŒ ๊ธฐ์กด์— ๋‚˜์™€์žˆ๋Š” ํด๋” ๊ตฌ์กฐ๋“ค์€ ๋ชจ๋‘ react์™€ Redux / Mobx ๋ฅผ ์—ฐ๋™ํ•˜์—ฌ ๋งŒ๋“ค์–ด๋‚ธ ๊ตฌ์กฐ๋“ค์ด์—ˆ๋‹ค. ๋‹ค์Œ์€ ์ƒํƒœ๊ด€๋ฆฌ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ณ  MVVM ํŒจํ„ด์„ ๊ตฌํ˜„ํ•œ ์‚ฌ์ดํŠธ์ด๋‹ค. https://github.com/davinci2015/react-mvvm-pokemon ( Class ์ด์šฉ ) https://velog.io/@dlrmsghks7/whatismvvmpattern ( Hook ์ด์šฉ ) ์œ„์˜ ์‚ฌ์ดํŠธ๋“ค์—์„œ ์ œ์•ˆํ•œ ๊ตฌ์กฐ๋ฅผ ๊ทธ๋ฆผ์œผ๋กœ ๋‚˜ํƒ€๋‚ด๋ณด์ž. View, View Controller, View Model, Model..

[ESLint] The react-srcipts package provided by Create React App requires a dependency :: ์˜์กด์„ฑ ๋ฌธ์ œ
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2020. 12. 3. 14:42

์˜์กด์„ฑ ์—๋Ÿฌ ํ•ด๊ฒฐ ์—๋Ÿฌ ๋ฐœ์ƒ ์ด๋Ÿฐ ์˜ค๋ฅ˜๊ฐ€ ๋–ด๋‹ค. CRA๊ฐ€ ์ œ๊ณตํ•˜๋Š” react-scripts ํŒจํ‚ค์ง€๊ฐ€ eslint 6.6.0 ๋ฒ„์ „์— ์˜์กดํ•˜๋Š”๋ฐ, 7.2.0 ๋ฒ„์ „์„ ์„ค์น˜ํ•ด์„œ ๊ทธ๋ ‡๋‹ค๊ณ  ํ•œ๋‹ค. ์ € ๋ฐ‘์— ๋‚˜์˜ค๋Š” ํ•ด๊ฒฐ๋ฐฉ๋ฒ•์ด ์žˆ๋Š”๋ฐ, ๋”ฐ๋ผํ•ด๋„ ํ•ด๊ฒฐ๋˜์ง€ ์•Š๋Š”๋‹ค ใ…Ž... ์ €๋ฒˆ์—๋„ ๊ฐ™์€ ๋ฌธ์ œ๋กœ ์†์ฉ์—ฌ์„œ ์ด๋ฒˆ์—” ์ œ๋Œ€๋กœ ๊ฐ์žก๊ณ  ํ•ด๊ฒฐํ•ด๋ณด๋ ค๊ณ  ํ•œ๋‹ค. ์ด์œ  ๋ฐœ๊ฒฌ ์ด์œ ๋Š” ๊ตฌ๊ธ€๋งํ•˜๋‹ค๊ฐ€ ๋ฐœ๊ฒฌํ–ˆ๋Š”๋ฐ(https://github.com/wesbos/eslint-config-wesbos/issues/17) , react-scripts์˜ eslint ์˜์กด์„ฑ ๋ฒ„์ „๊ณผ airbnb linting์—์„œ์˜ eslint ์˜์กด์„ฑ ๋ฒ„์ „์ด ์ผ์น˜ํ•˜์ง€ ์•Š์•„์„œ ๋‚˜์˜ค๋Š” ๋ฌธ์ œ์˜€๋‹ค. ๋ป˜์ง“ ๊ทธ๋ž˜์„œ ์ผ๋‹จ react-scripts version์„ `npm view react-s..

[ESLint] createRequire is not a function Referenced from: ...
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2020. 12. 3. 12:26

VScode์—์„œ eslint๊ฐ€ ์ ์šฉ์ด ์•ˆ๋˜๊ณ  ์ž๊พธ ํ•ด๋‹น ์—๋Ÿฌ๊ฐ€ ๋œจ๊ธธ๋ž˜ ๊ฒ€์ƒ‰ํ•ด๋ดค๋‹ค. ๋ฒ„์ „์ด ์•ˆ ๋งž์•„์„œ ๊ทธ๋Ÿฐ ๊ฒƒ์ด๋‹ˆ VScode๋ฅผ ๋‹ค์‹œ ๊น”๋ฉด ๋ฒ„์ „ ์—…๋ฐ์ดํŠธ๋˜๋ฉด์„œ eslint๊ฐ€ ์ž˜ ๋œ๋‹ค. ๋‹ค์šด๋กœ๋“œ : code.visualstudio.com/download ์ฐธ๊ณ  : https://github.com/typescript-eslint/typescript-eslint/issues/2020

[eslint] Error: Unexpected token 'export'
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2020. 11. 21. 21:46

์ฐธ๊ณ  : https://hoilzz.github.io/webpack/11-eslint-prettier/ eslint์˜ parser๊ฐ€ ๊ณต์‹์ ์œผ๋กœ ES ํ‘œ์ค€๋งŒ์„ ์ง€์›ํ•˜๊ธฐ ๋•Œ๋ฌธ์—, ES6~7 ํŒŒ์‹ฑ ์‹œ ๋ฌธ์ œ๊ฐ€ ์ƒ๊ธด๋‹ค. ๋”ฐ๋ผ์„œ, .eslintrc.js ํŒŒ์ผ์˜ export default๋ฅผ module.export๋กœ ๋ณ€๊ฒฝํ•˜๊ธฐ export๋Š” ES6 syntax์ด๊ณ , module export๋Š” commonJS syntax์ด๋‹ค. babel-eslint ์„ค์น˜ ํ›„ .eslintrc.js์— "parser": "babel-eslint",์ถ”๊ฐ€ํ•˜๊ธฐ ๋‘ ๋ฐฉ๋ฒ• ์ค‘ ํ•˜๋‚˜๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๋œ๋‹ค.

[์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์ค€๋น„] ์นด์นด์˜ค 2020 Recruitment ๋ฌธ์ œ :: ์˜คํ”ˆ์ฑ„ํŒ…๋ฐฉ
Algorithm ๋ฌธ์ œ/ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค 2020. 11. 19. 21:33

์˜คํ”ˆ์ฑ„ํŒ…๋ฐฉ ๋ฌธ์ œ ์นด์นด์˜คํ†ก ์˜คํ”ˆ์ฑ„ํŒ…๋ฐฉ์—์„œ๋Š” ์นœ๊ตฌ๊ฐ€ ์•„๋‹Œ ์‚ฌ๋žŒ๋“ค๊ณผ ๋Œ€ํ™”๋ฅผ ํ•  ์ˆ˜ ์žˆ๋Š”๋ฐ, ๋ณธ๋ž˜ ๋‹‰๋„ค์ž„์ด ์•„๋‹Œ ๊ฐ€์ƒ์˜ ๋‹‰๋„ค์ž„์„ ์‚ฌ์šฉํ•˜์—ฌ ์ฑ„ํŒ…๋ฐฉ์— ๋“ค์–ด๊ฐˆ ์ˆ˜ ์žˆ๋‹ค. ์‹ ์ž…์‚ฌ์›์ธ ๊น€ํฌ๋ฃจ๋Š” ์นด์นด์˜คํ†ก ์˜คํ”ˆ ์ฑ„ํŒ…๋ฐฉ์„ ๊ฐœ์„คํ•œ ์‚ฌ๋žŒ์„ ์œ„ํ•ด, ๋‹ค์–‘ํ•œ ์‚ฌ๋žŒ๋“ค์ด ๋“ค์–ด์˜ค๊ณ , ๋‚˜๊ฐ€๋Š” ๊ฒƒ์„ ์ง€์ผœ๋ณผ ์ˆ˜ ์žˆ๋Š” ๊ด€๋ฆฌ์ž์ฐฝ์„ ๋งŒ๋“ค๊ธฐ๋กœ ํ–ˆ๋‹ค. ์ฑ„ํŒ…๋ฐฉ์— ๋ˆ„๊ตฐ๊ฐ€ ๋“ค์–ด์˜ค๋ฉด ๋‹ค์Œ ๋ฉ”์‹œ์ง€๊ฐ€ ์ถœ๋ ฅ๋œ๋‹ค. [๋‹‰๋„ค์ž„]๋‹˜์ด ๋“ค์–ด์™”์Šต๋‹ˆ๋‹ค. ์ฑ„ํŒ…๋ฐฉ์—์„œ ๋ˆ„๊ตฐ๊ฐ€ ๋‚˜๊ฐ€๋ฉด ๋‹ค์Œ ๋ฉ”์‹œ์ง€๊ฐ€ ์ถœ๋ ฅ๋œ๋‹ค. [๋‹‰๋„ค์ž„]๋‹˜์ด ๋‚˜๊ฐ”์Šต๋‹ˆ๋‹ค. ์ฑ„ํŒ…๋ฐฉ์—์„œ ๋‹‰๋„ค์ž„์„ ๋ณ€๊ฒฝํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋‘ ๊ฐ€์ง€์ด๋‹ค. ์ฑ„ํŒ…๋ฐฉ์„ ๋‚˜๊ฐ„ ํ›„, ์ƒˆ๋กœ์šด ๋‹‰๋„ค์ž„์œผ๋กœ ๋‹ค์‹œ ๋“ค์–ด๊ฐ„๋‹ค. ์ฑ„ํŒ…๋ฐฉ์—์„œ ๋‹‰๋„ค์ž„์„ ๋ณ€๊ฒฝํ•œ๋‹ค. ๋‹‰๋„ค์ž„์„ ๋ณ€๊ฒฝํ•  ๋•Œ๋Š” ๊ธฐ์กด์— ์ฑ„ํŒ…๋ฐฉ์— ์ถœ๋ ฅ๋˜์–ด ์žˆ๋˜ ๋ฉ”์‹œ์ง€์˜ ๋‹‰๋„ค์ž„๋„ ์ „๋ถ€ ๋ณ€๊ฒฝ๋œ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, ์ฑ„ํŒ…๋ฐฉ์—..