From 98bccc441d1024372617d7c92078e765320049b5 Mon Sep 17 00:00:00 2001 From: Igx22 Date: Sun, 17 Nov 2024 17:05:58 +0700 Subject: [PATCH] fix: dockerize --- .eslintrc.json | 10 +++++----- .gitignore | 3 ++- eslint.config.cjs.old | 40 ---------------------------------------- eslint.config.mjs.old | 13 ------------- package-lock.json | 26 ++++++++++++++++++++++++++ package.json | 4 +++- src/main.ts | 2 +- 7 files changed, 37 insertions(+), 61 deletions(-) delete mode 100644 eslint.config.cjs.old delete mode 100644 eslint.config.mjs.old diff --git a/.eslintrc.json b/.eslintrc.json index 8eba801..aee92ed 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -9,12 +9,12 @@ "ecmaVersion": "latest", "sourceType": "module" }, - "plugins": ["@typescript-eslint", "simple-import-sort"], + "plugins": ["@typescript-eslint"], "rules": { - "unused-imports/no-unused-imports": "error", + "unused-imports/no-unused-imports": "off", "prefer-const": "off", - "simple-import-sort/imports": "error", - "simple-import-sort/exports": "error", - "no-var": "error" + "simple-import-sort/imports": "off", + "simple-import-sort/exports": "off", + "no-var": "off" } } diff --git a/.gitignore b/.gitignore index d9eac21..69f53bb 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ app.log app.log .idea build/ -log/ \ No newline at end of file +log/ +external/ \ No newline at end of file diff --git a/eslint.config.cjs.old b/eslint.config.cjs.old deleted file mode 100644 index dc473a2..0000000 --- a/eslint.config.cjs.old +++ /dev/null @@ -1,40 +0,0 @@ -const path = require('path'); - -module.exports = [ - { - files: ['**/*.ts'], - ignores: ['src/utilz/*.ts'], - languageOptions: { - parser: require('@typescript-eslint/parser'), - parserOptions: { - project: path.join(__dirname, './tsconfig.json'), - tsconfigRootDir: __dirname, - sourceType: 'module', - }, - }, - plugins: { - '@typescript-eslint': require('@typescript-eslint/eslint-plugin'), - import: require('eslint-plugin-import'), - }, - rules: { - '@typescript-eslint/no-unused-vars': [ - 'warn', - { argsIgnorePattern: '^_' }, - ], - 'import/no-unused-modules': [1, { unusedExports: true }], - 'import/order': [ - 'error', - { - 'newlines-between': 'always', - groups: [ - ['builtin', 'external'], - 'internal', - ['parent', 'sibling', 'index'], - ], - alphabetize: { order: 'asc', caseInsensitive: true }, - }, - ], - '@typescript-eslint/prefer-const': 'off', - }, - }, -]; diff --git a/eslint.config.mjs.old b/eslint.config.mjs.old deleted file mode 100644 index 63830e9..0000000 --- a/eslint.config.mjs.old +++ /dev/null @@ -1,13 +0,0 @@ -import globals from 'globals'; -import pluginJs from '@eslint/js'; -import tseslint from 'typescript-eslint'; - -export default [ - { files: ['**/*.{js,mjs,cjs}'] }, - { files: ['**/*.js'], - ignores: ['src/utilz/*.ts'], - languageOptions: { sourceType: 'commonjs' } }, - { languageOptions: { globals: globals.browser } }, - pluginJs.configs.recommended, - ...tseslint.configs.recommended, -]; diff --git a/package-lock.json b/package-lock.json index 4926da8..4f0b5cf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -61,6 +61,8 @@ "chai": "^5.1.1", "eslint": "^8.57.0", "eslint-plugin-import": "^2.29.1", + "eslint-plugin-simple-import-sort": "^12.1.1", + "eslint-plugin-unused-imports": "^4.0.0", "globals": "^15.9.0", "husky": "^9.1.4", "jest": "^29.7.0", @@ -6541,6 +6543,30 @@ "strip-bom": "^3.0.0" } }, + "node_modules/eslint-plugin-simple-import-sort": { + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-12.1.1.tgz", + "integrity": "sha512-6nuzu4xwQtE3332Uz0to+TxDQYRLTKRESSc2hefVT48Zc8JthmN23Gx9lnYhu0FtkRSL1oxny3kJ2aveVhmOVA==", + "dev": true, + "peerDependencies": { + "eslint": ">=5.0.0" + } + }, + "node_modules/eslint-plugin-unused-imports": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-4.1.4.tgz", + "integrity": "sha512-YptD6IzQjDardkl0POxnnRBhU1OEePMV0nd6siHaRBbd+lyh6NAhFEobiznKU7kTsSsDeSD62Pe7kAM1b7dAZQ==", + "dev": true, + "peerDependencies": { + "@typescript-eslint/eslint-plugin": "^8.0.0-0 || ^7.0.0 || ^6.0.0 || ^5.0.0", + "eslint": "^9.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "@typescript-eslint/eslint-plugin": { + "optional": true + } + } + }, "node_modules/eslint-scope": { "version": "7.2.2", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", diff --git a/package.json b/package.json index 6fd6c27..20bad11 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,9 @@ "ts-mocha": "^10.0.0", "ts-protoc-gen": "^0.15.0", "typescript": "^5.5.4", - "typescript-eslint": "^8.0.1" + "typescript-eslint": "^8.0.1", + "eslint-plugin-simple-import-sort": "^12.1.1", + "eslint-plugin-unused-imports": "^4.0.0" }, "dependencies": { "@ethersproject/transactions": "^5.7.0", diff --git a/src/main.ts b/src/main.ts index 203005e..aae4222 100644 --- a/src/main.ts +++ b/src/main.ts @@ -27,6 +27,6 @@ async function bootstrap() { const document = SwaggerModule.createDocument(app, config); SwaggerModule.setup('api', app, document); - await app.listen(EnvLoader.getPropertyAsNumber("ANODE_PORT", 3000)); + await app.listen(EnvLoader.getPropertyAsNumber("PORT", 3000)); } bootstrap();