Skip to content

Commit

Permalink
Add tsc
Browse files Browse the repository at this point in the history
  • Loading branch information
segayuu committed Jun 5, 2020
1 parent de8657b commit 50a6c59
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 8 deletions.
15 changes: 14 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
{
"root": true,
"extends": "hexo"
"parser": "@typescript-eslint/parser",
"plugins": ["node", "@typescript-eslint"],
"extends": ["hexo", "plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/recommended"],
"ignorePatterns": ["built"],
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"ecmaFeatures": {
"modules": true
}
},
"rules": {
"node/no-unsupported-features/es-syntax": 0
}
}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ node_modules/
.nyc_output/
*.log
docs/
coverage/
coverage/
built
13 changes: 13 additions & 0 deletions .tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"outDir": "./built",
"allowJs": true,
"target": "ES2018",
"lib": ["ES2018"],
"module": "commonjs",
"esModuleInterop": true
},
"include": [
"./src/**/*"
]
}
22 changes: 16 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@
"name": "warehouse",
"version": "4.0.0",
"description": "Simple JSON-based database",
"main": "lib/database",
"main": "built/database",
"directories": {
"lib": "./lib"
"lib": "./built"
},
"files": [
"lib/"
"built/"
],
"scripts": {
"eslint": "eslint lib test",
"pretest": "npm run typescript",
"typescript": "tsc --build .tsconfig.json",
"eslint": "eslint src test",
"test": "mocha \"test/scripts/**/*.js\"",
"test-cov": "nyc --reporter=lcov --reporter=text-summary npm test",
"jsdoc": "jsdoc --configure .jsdoc.json"
"jsdoc": "jsdoc --configure .jsdoc.json",
"prepublish": "npm run typescript"
},
"repository": "hexojs/warehouse",
"keywords": [
Expand All @@ -32,6 +35,12 @@
"rfdc": "^1.1.4"
},
"devDependencies": {
"@types/bluebird": "^3.5.32",
"@types/graceful-fs": "^4.1.3",
"@types/jsonstream": "^0.8.30",
"@types/node": "^14.0.5",
"@typescript-eslint/eslint-plugin": "^3.0.0",
"@typescript-eslint/parser": "^3.0.0",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"eslint": "^7.0.0",
Expand All @@ -41,7 +50,8 @@
"minami": "^1.1.1",
"mocha": "^7.0.0",
"nyc": "^15.0.0",
"sinon": "^9.0.2"
"sinon": "^9.0.2",
"typescript": "^3.9.3"
},
"engines": {
"node": ">=10.13.0"
Expand Down

0 comments on commit 50a6c59

Please sign in to comment.