diff --git a/packages/core/.prettierrc b/packages/core/.prettierrc deleted file mode 100644 index fed742a7a..000000000 --- a/packages/core/.prettierrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "printWidth": 100, - "trailingComma": "es5", - "bracketSpacing": true -} diff --git a/packages/core/.xo-config.json b/packages/core/.xo-config.json deleted file mode 100644 index 7116a679b..000000000 --- a/packages/core/.xo-config.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "space": true, - "prettier": true, - "rules": { - "unicorn/no-array-reduce": "off" - } -} diff --git a/packages/core/package.json b/packages/core/package.json index 46acf5be2..e0245f623 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -12,6 +12,7 @@ "dev": "tsc-watch --onSuccess \"node ./build/index.js\"" }, "dependencies": { + "@logto/essentials": "^1.0.2", "@logto/schemas": "^1.0.0", "dayjs": "^1.10.5", "dotenv": "^10.0.0", @@ -36,5 +37,6 @@ "engines": { "node": "14", "yarn": "1" - } + }, + "prettier": "@logto/essentials/.prettierrc.json" } diff --git a/packages/core/src/init/index.ts b/packages/core/src/init/index.ts index 0deb69a93..5688dd3b6 100644 --- a/packages/core/src/init/index.ts +++ b/packages/core/src/init/index.ts @@ -5,7 +5,6 @@ import initOidc from './oidc'; import initRouter from './router'; export default async function initApp(app: Koa, port: number): Promise { - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument app.use(logger()); await initOidc(app, port); initRouter(app); diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index 3d3ea5386..5d40dd9b3 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -1,16 +1,7 @@ { + "extends": "@logto/essentials/tsconfig.base", "compilerOptions": { - "target": "es2021", - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true, - "module": "commonjs", - "moduleResolution": "node", "outDir": "build" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/packages/core/xo.config.js b/packages/core/xo.config.js new file mode 100644 index 000000000..9a8c91c1c --- /dev/null +++ b/packages/core/xo.config.js @@ -0,0 +1 @@ +module.exports = require("@logto/essentials/.xo-config.json"); diff --git a/packages/core/yarn.lock b/packages/core/yarn.lock index b997ec63f..518350783 100644 --- a/packages/core/yarn.lock +++ b/packages/core/yarn.lock @@ -251,6 +251,14 @@ dependencies: vary "^1.1.2" +"@logto/essentials@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@logto/essentials/-/essentials-1.0.2.tgz#02a8c878b4079a63709c35ce8c143370f259bb13" + integrity sha512-GN6m1c5ll7EhOgJbmFwRESkeWGjdoihst8O1aVIxvEOXhLe/79bph4hejsdm59piX3jgKWakEHimpqcBT1kO+Q== + dependencies: + lodash.orderby "^4.6.0" + lodash.pick "^4.4.0" + "@logto/schemas@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@logto/schemas/-/schemas-1.0.0.tgz#5dbeec9caa9b1882b00b7507b8f6f337c8665ca9" @@ -3272,6 +3280,16 @@ lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== +lodash.orderby@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.orderby/-/lodash.orderby-4.6.0.tgz#e697f04ce5d78522f54d9338b32b81a3393e4eb3" + integrity sha1-5pfwTOXXhSL1TZM4syuBozk+TrM= + +lodash.pick@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.pick/-/lodash.pick-4.4.0.tgz#52f05610fff9ded422611441ed1fc123a03001b3" + integrity sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM= + lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"