Set up TS, linter and formatter

This commit is contained in:
Henrik HerHde Huettemann 2023-05-19 17:16:13 +02:00
parent 17a76ea343
commit bdf3ef1e52
Signed by: HueHe
GPG key ID: 9F7BD10E0A8A111E
7 changed files with 4786 additions and 17 deletions

13
.editorconfig Normal file
View file

@ -0,0 +1,13 @@
# editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false

19
.eslintrc.yaml Normal file
View file

@ -0,0 +1,19 @@
env:
es6: true
node: true
mocha: true
parserOptions:
parser: "@typescript-eslint/parser"
ecmaVersion: 2022
sourceType: module
plugins:
- "@typescript-eslint"
- prettier
extends:
- plugin:@typescript-eslint/recommended
- prettier
rules:
prettier/prettier:
- error
# "@typescript-eslint/no-explicit-any": 'off'
# "@typescript-eslint/no-empty-interface": 'off'

4
.prettierrc.yaml Normal file
View file

@ -0,0 +1,4 @@
semi: false
singleQuote: true
endOfLine: lf
bracketSpacing: true

4718
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,18 +1,35 @@
{
"devDependencies": {
"typescript": "^5.0.4"
},
"name": "rocketchat2matrix",
"version": "0.1.0",
"author": "HerHde",
"description": "Rocket.Chat to Matrix migration script",
"main": "functions.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"license": "AGPL-3.0-or-later",
"main": "dist/app.js",
"name": "rocketchat2matrix",
"repository": {
"type": "git",
"url": "https://git.verdigado.com/NB-Public/rocketchat2matrix"
},
"author": "HerHde",
"license": "AGPL-3.0-or-later"
"scripts": {
"format": "prettier 'src/**/*.ts' --write",
"lint": "eslint src/ --ext .ts",
"lint-fix": "eslint src/ --fix --ext .ts",
"prefix": "npm run format",
"fix": "npm run lint-fix",
"test": "echo \"Error: no test specified\" && exit 1",
"compile": "rm -rf dist/ && tsc",
"start": "npm run compile && node dist/app.js"
},
"version": "0.1.0",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.59.6",
"@typescript-eslint/parser": "^5.59.6",
"eslint": "^8.40.0",
"eslint-config-prettier": "^8.8.0",
"eslint-config-standard-with-typescript": "^34.0.1",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.1.1",
"prettier": "2.8.8",
"typescript": "^5.0.4"
}
}

0
src/app.ts Normal file
View file

View file

@ -11,7 +11,7 @@
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
/* Language and Environment */
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
"target": "ES2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "jsx": "preserve", /* Specify what JSX code is generated. */
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
@ -26,7 +26,7 @@
/* Modules */
"module": "commonjs", /* Specify what module code is generated. */
// "rootDir": "./", /* Specify the root folder within your source files. */
"rootDir": "./src", /* Specify the root folder within your source files. */
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
@ -55,7 +55,7 @@
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./", /* Specify an output folder for all emitted files. */
"outDir": "./dist", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
@ -64,8 +64,8 @@
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
// "newLine": "crlf", /* Set the newline character for emitting files. */
"emitBOM": false, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
"newLine": "lf", /* Set the newline character for emitting files. */
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */