Skip to content

Commit

Permalink
ts 적용 및 build 파일 위치 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
jojoldu committed Mar 24, 2022
1 parent a79b69d commit 5b20500
Show file tree
Hide file tree
Showing 9 changed files with 3,418 additions and 354 deletions.
51 changes: 51 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
},
plugins: ['@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/member-ordering': [
'error',
{
default: {
memberTypes: [
'public-static-field',
'protected-static-field',
'private-static-field',
'public-instance-field',
'protected-instance-field',
'private-instance-field',
'constructor',
'public-static-method',
'protected-static-method',
'private-static-method',
'public-instance-method',
'protected-instance-method',
'private-instance-method',
'get',
],
},
},
],
'no-console': 'error',
},
};
5 changes: 2 additions & 3 deletions src/build.js → json-validate/src/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ const fs = require('fs-extra');
* @returns {Promise<object>}
*/
async function build() {
const data = await fs.readFile('db.json', 'utf8');
const trim = JSON.stringify(data.trim());
return JSON.parse(trim);
const json = await fs.readFile('db.json', 'utf8');
return JSON.parse(JSON.stringify(json.trim()));
}

const failMessage = 'db.json Parse Fail';
Expand Down
105 changes: 0 additions & 105 deletions package-lock.json

This file was deleted.

52 changes: 49 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "build",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "node src/build.js"
"build": "node json-validate/src/build.js"
},
"repository": {
"type": "git",
Expand All @@ -21,8 +21,54 @@
"url": "https://github.com/jojoldu/junior-recruit-scheduler/issues"
},
"homepage": "https://github.com/jojoldu/junior-recruit-scheduler#readme",
"devDependencies": {
"dependencies": {
"amanda": "^1.0.1",
"fs-extra": "^10.0.1",
"https": "^1.0.0"
"ts-node": "^10.7.0"
},
"devDependencies": {
"@types/fs-extra": "^9.0.13",
"@types/jest": "^27.4.1",
"@types/node": "^17.0.23",
"@typescript-eslint/eslint-plugin": "^5.16.0",
"@typescript-eslint/parser": "^5.16.0",
"eslint": "^8.11.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "^27.5.1",
"jest-junit": "^13.0.0",
"prettier": "^2.6.0",
"ts-jest": "^27.1.3",
"ts-loader": "^9.2.8",
"typescript": "^4.6.2"
},
"jest": {
"globals": {
"ts-jest": {
"isolatedModules": true
}
},
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": ".",
"testRegex": ".*.(spec|test).ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "./coverage",
"testEnvironment": "node",
"roots": [
"<rootDir>/"
],
"testTimeout": 10000
},
"lint-staged": {
"*.ts": "eslint --fix"
}
}
Loading

0 comments on commit 5b20500

Please sign in to comment.