1seok2

add: make update html function

1 +module.exports = {
2 + "env": {
3 + "browser": true,
4 + "es6": true
5 + },
6 + "extends": [
7 + "eslint:recommended",
8 + "plugin:@typescript-eslint/eslint-recommended"
9 + ],
10 + "globals": {
11 + "Atomics": "readonly",
12 + "SharedArrayBuffer": "readonly"
13 + },
14 + "parser": "@typescript-eslint/parser",
15 + "parserOptions": {
16 + "ecmaVersion": 2018,
17 + "sourceType": "module"
18 + },
19 + "plugins": [
20 + "@typescript-eslint"
21 + ],
22 + "rules": {
23 + "indent": [
24 + "error",
25 + 2
26 + ],
27 + "linebreak-style": [
28 + "error",
29 + "unix"
30 + ],
31 + "quotes": [
32 + "error",
33 + "single"
34 + ],
35 + "semi": [
36 + "error",
37 + "always"
38 + ]
39 + },
40 + "ignorePatterns": ["dist/", "node_modules/"],
41 +};
...\ No newline at end of file ...\ No newline at end of file
1 -{
2 - "extends": "./node_modules/gts/"
3 -}
1 module.exports = { 1 module.exports = {
2 - ...require('gts/.prettierrc.json') 2 + singleQuote: true,
3 -} 3 + semi: true,
4 + useTabs: false,
5 + tabWidth: 2,
6 + trailingComma: 'all',
7 + printWidth: 60,
8 + arrowParens: 'always',
9 + orderedImports: true,
10 + bracketSpacing: true,
11 + jsxBracketSameLine: false,
12 + arrowParens: 'avoid',
13 +};
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -23,10 +23,12 @@ ...@@ -23,10 +23,12 @@
23 "@types/node": "^14.11.2", 23 "@types/node": "^14.11.2",
24 "clean-webpack-plugin": "^3.0.0", 24 "clean-webpack-plugin": "^3.0.0",
25 "css-loader": "^5.1.1", 25 "css-loader": "^5.1.1",
26 + "eslint": "^7.23.0",
26 "file-loader": "^6.2.0", 27 "file-loader": "^6.2.0",
27 "gts": "^3.1.0", 28 "gts": "^3.1.0",
28 "html-webpack-plugin": "^5.3.0", 29 "html-webpack-plugin": "^5.3.0",
29 "node-sass": "^5.0.0", 30 "node-sass": "^5.0.0",
31 + "prettier": "2.2.1",
30 "sass-loader": "^11.0.1", 32 "sass-loader": "^11.0.1",
31 "style-loader": "^2.0.0", 33 "style-loader": "^2.0.0",
32 "ts-loader": "^8.0.17", 34 "ts-loader": "^8.0.17",
...@@ -34,5 +36,8 @@ ...@@ -34,5 +36,8 @@
34 "webpack": "^5.24.3", 36 "webpack": "^5.24.3",
35 "webpack-cli": "^4.5.0", 37 "webpack-cli": "^4.5.0",
36 "webpack-dev-server": "^3.11.2" 38 "webpack-dev-server": "^3.11.2"
39 + },
40 + "prettier": {
41 + "tabWidth": 2
37 } 42 }
38 } 43 }
......
...@@ -15,7 +15,6 @@ import './assets/style/App.scss'; ...@@ -15,7 +15,6 @@ import './assets/style/App.scss';
15 const App = (pathname : string) : string => { 15 const App = (pathname : string) : string => {
16 /* id 없을 시 id 입력으로 redirect */ 16 /* id 없을 시 id 입력으로 redirect */
17 if(!getState().insta_id) pathname = ''; 17 if(!getState().insta_id) pathname = '';
18 -
19 history.pushState('','', pathname); 18 history.pushState('','', pathname);
20 19
21 return ` 20 return `
......
1 +export const updateHtml = (
2 + type : string = 'literal',
3 + tag : string | HTMLElement = '<div></div>',
4 + target : string = 'app'
5 +) => {
6 + const $target : null | HTMLElement = document.querySelector(target);
7 +
8 + $target && ($target.innerHTML = `${tag}`)
9 +}
...\ No newline at end of file ...\ No newline at end of file