Skip to content

Commit

Permalink
typescript:basic
Browse files Browse the repository at this point in the history
  • Loading branch information
Seong Min Park committed Nov 18, 2020
1 parent bdb53b7 commit a88d7cd
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 23 deletions.
12 changes: 3 additions & 9 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{
"parser": "babel-eslint",
"extends": "@ridi/eslint-config",
"rules": {
"arrow-body-style": 0,
"arrow-parens": 0,
"no-param-reassign": 0,
"no-underscore-dangle": 0,
"react/destructuring-assignment": 0
}
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": ["plugin:@typescript-eslint/recommended"]
}
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"scripts": {
"clean": "rimraf ./*.log && lerna exec --parallel -- rimraf coverage lib/* temp",
"build": "yarn clean && lerna exec --parallel -- babel src --out-dir lib --config-file ../../.babelrc",
"build:js": "yarn clean && lerna exec --parallel -- babel src --out-dir lib --extensions \".ts,.tsx\" --config-file ../../.babelrc --source-maps inline",
"build:types": "lerna exec --scope @ridi/parser-core -- tsc --emitDeclarationOnly",
"build": "yarn build:js && yarn build:types",
"test": "yarn build && yarn lint && lerna exec --concurrency 1 -- nyc mocha --recursive",
"type": "lerna exec -- tsc",
"type:doc": "lerna exec --scope @ridi/content-parser -- typedoc",
"type:doc": "lerna exec --scope @ridi/parser-core -- typedoc",
"lint": "eslint packages",
"postinstall": "yarn build && yarn bootstrap",
"bootstrap": "lerna bootstrap",
Expand All @@ -20,12 +21,15 @@
"@babel/plugin-proposal-object-rest-spread": "^7.12.1",
"@babel/plugin-transform-runtime": "^7.12.1",
"@babel/preset-env": "^7.12.1",
"@babel/preset-typescript": "^7.12.1",
"@babel/runtime": "^7.12.5",
"@ridi/eslint-config": "^5.1.0",
"@types/chai": "^4.2.14",
"@types/chai-spies": "^1.0.2",
"@types/mocha": "^8.0.3",
"@types/sinon": "^9.0.8",
"@typescript-eslint/eslint-plugin": "^4.7.0",
"@typescript-eslint/parser": "^4.7.0",
"babel-eslint": "^10.1.0",
"babel-plugin-add-module-exports": "^1.0.4",
"chai": "^4.2.0",
Expand Down
38 changes: 27 additions & 11 deletions packages/parser-core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
{
// Change this to match your project
"include": [
"src/**/*"
],
"compilerOptions": {
// Tells TypeScript to read JS files, as
// normally they are ignored as source files
"allowJs": true,
// Generate d.ts files
"target": "es2017",
"module": "commonjs",
// Object.fromEntries
"lib": ["dom", "es2017", "es2019.object"],
"declaration": true,
// This compiler run should
// only output d.ts files
"composite": true,
"emitDeclarationOnly": true,
"outDir": "type"
"isolatedModules": true,
"importsNotUsedAsValues": "error",
"allowJs": false,
"strict": true,

/* Additional Checks */
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,

/* Module Resolution Options */
"moduleResolution": "node",
/* This needs to be false so our types are possible to consume without setting this */
"esModuleInterop": true,
"resolveJsonModule": true,

"rootDir": "src",
"outDir": "lib",
"declarationDir": "type"
},
"include": ["src"],
"exclude": ["lib","type"]
}

0 comments on commit a88d7cd

Please sign in to comment.