From 38c55e0b625e7c6ff2d441ec85b7bda43686f492 Mon Sep 17 00:00:00 2001 From: Archangel Date: Mon, 15 Jul 2024 20:25:07 +0200 Subject: [PATCH] Chore: Update build files --- .eslintignore | 9 +-- .eslintrc.json | 165 ++++++++++++++++++++++++++++--------------------- tsconfig.json | 21 +++---- 3 files changed, 106 insertions(+), 89 deletions(-) diff --git a/.eslintignore b/.eslintignore index 9922d9a..f7dd9e1 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,9 +1,10 @@ # Exclude these folders from linting -node_modules -dist/ -types/ +**/node_modules +/tmp +/dist +/types # Exclude these filetypes from linting *.json *.txt -*.exe \ No newline at end of file +*.exe diff --git a/.eslintrc.json b/.eslintrc.json index 1deee58..757b0bd 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,75 +1,98 @@ { - "root": true, - "parser": "@typescript-eslint/parser", - "plugins": [ - "@typescript-eslint" - ], - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@typescript-eslint/no-explicit-any": 0, - "@typescript-eslint/no-unused-vars": 1, - "@typescript-eslint/no-empty-interface": 0, - "@typescript-eslint/no-namespace": 0, - "@typescript-eslint/comma-dangle": 1, - "@typescript-eslint/func-call-spacing": 2, - "@typescript-eslint/quotes": 1, - "@typescript-eslint/brace-style": [ - "warn", - "1tbs" + "root": true, + "parser": "@typescript-eslint/parser", + "plugins": [ + "@typescript-eslint" ], - "@typescript-eslint/naming-convention": [ - "warn", - { - "selector": "default", - "format": ["camelCase"], - "leadingUnderscore": "allow" - }, - { - "selector": "typeLike", - "format": ["PascalCase"] - }, - { - "selector": "objectLiteralProperty", - "format": ["PascalCase", "camelCase"], - "leadingUnderscore": "allow" - }, - { - "selector": "typeProperty", - "format": ["PascalCase", "camelCase"], - "leadingUnderscore": "allow" - }, - { - "selector": "enumMember", - "format": ["UPPER_CASE"] - } + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended" ], - "@typescript-eslint/indent": [ - "warn", - 2 - ], - "@typescript-eslint/no-unused-expressions": [ - "warn", - { - "allowShortCircuit": false, - "allowTernary": false - } - ], - "@typescript-eslint/keyword-spacing": [ - "warn", - { - "before": true, - "after": true - } - ], - "@typescript-eslint/explicit-module-boundary-types": [ - "warn", - { - "allowArgumentsExplicitlyTypedAsAny": true - } + "rules": { + "@typescript-eslint/no-explicit-any": 0, + "@typescript-eslint/no-unused-vars": 1, + "@typescript-eslint/no-empty-interface": 0, + "@typescript-eslint/no-namespace": 0, + "@typescript-eslint/comma-dangle": 1, + "@typescript-eslint/func-call-spacing": 2, + "@typescript-eslint/quotes": 1, + "@typescript-eslint/brace-style": [ + "warn", + "allman" + ], + "@typescript-eslint/naming-convention": [ + "warn", + { + "selector": "default", + "format": [ + "camelCase" + ], + "leadingUnderscore": "allow" + }, + { + "selector": "typeLike", + "format": [ + "PascalCase" + ] + }, + { + "selector": "objectLiteralProperty", + "format": [ + "PascalCase", + "camelCase" + ], + "leadingUnderscore": "allow" + }, + { + "selector": "typeProperty", + "format": [ + "PascalCase", + "camelCase" + ], + "leadingUnderscore": "allow" + }, + { + "selector": "enumMember", + "format": [ + "UPPER_CASE" + ] + } + ], + "@typescript-eslint/indent": [ + "warn", + 4 + ], + "@typescript-eslint/no-unused-expressions": [ + "warn", + { + "allowShortCircuit": false, + "allowTernary": false + } + ], + "@typescript-eslint/keyword-spacing": [ + "warn", + { + "before": true, + "after": true + } + ], + "@typescript-eslint/explicit-module-boundary-types": [ + "warn", + { + "allowArgumentsExplicitlyTypedAsAny": true + } + ] + }, + "overrides": [ + { + "files": [ + "*.mjs", + "*.ts" + ], + "env": { + "node": true + } + } ] - } -} \ No newline at end of file +} diff --git a/tsconfig.json b/tsconfig.json index 8151310..7d2e93d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,25 +1,18 @@ { "compilerOptions": { "allowJs": true, - "module": "CommonJS", - "target": "es2020", - "moduleResolution": "node", + "module": "NodeNext", + "target": "ES2022", + "moduleResolution": "NodeNext", "esModuleInterop": true, "downlevelIteration": true, "experimentalDecorators": true, "emitDecoratorMetadata": true, "resolveJsonModule": true, "outDir": "tmp", - "baseUrl": ".", "paths": { - "@spt-aki/*": ["./types/*"] - } + "@spt/*": ["./types/*"], + }, }, - "lib": [ - "es2020" - ], - "include": [ - "src/*", - "src/**/*" - ] -} \ No newline at end of file + "exclude": ["node_modules", "dist", "tmp"], +}