From b798cfdc64dacfa3ed37be21f2b8e43067d22d28 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Sat, 7 May 2022 15:59:05 -0500 Subject: [PATCH] Ts more configs again (#4567) * tsconfig comments also recreate tsconfig base from tsc --init * Add eslint-define-config Rewrite eslintrc * More tsconfig adjustments * Move bad tsRules to separate var --- .eslintrc.cjs | 211 ++++++++++++++++++++------------------ client/tsconfig.json | 22 ++-- package.json | 5 +- src/tsconfig.json | 18 ++-- test/client/tsconfig.json | 101 ------------------ test/tsconfig.json | 113 +++----------------- tsconfig.base.json | 110 +++++++++++++++++--- tsconfig.json | 22 ++-- yarn.lock | 59 +++++++---- 9 files changed, 308 insertions(+), 353 deletions(-) delete mode 100644 test/client/tsconfig.json diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 6249e49a..bb707a9a 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,101 +1,18 @@ -const projects = ["./tsconfig.json", "./client/tsconfig.json", "./src/tsconfig.json"]; +// @ts-check +const {defineConfig} = require("eslint-define-config"); -module.exports = { - root: true, - overrides: [ - { - files: [ - "**/*.ts", - // "**/*.vue" - ], - parser: "@typescript-eslint/parser", - parserOptions: { - tsconfigRootDir: __dirname, - project: ["./tsconfig.json", "./client/tsconfig.json", "./src/tsconfig.json"], - extraFileExtensions: [".vue"], - projects: projects, - }, - plugins: ["@typescript-eslint"], - extends: [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:@typescript-eslint/recommended-requiring-type-checking", - "prettier", - ], - rules: { - // note you must disable the base rule as it can report incorrect errors - "no-shadow": "off", - "@typescript-eslint/no-shadow": ["error"], - // TODO: eventually remove these - "@typescript-eslint/ban-ts-comment": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-non-null-assertion": "off", - "@typescript-eslint/no-this-alias": "off", - "@typescript-eslint/no-unnecessary-type-assertion": "off", - "@typescript-eslint/no-unsafe-argument": "off", - "@typescript-eslint/no-unsafe-assignment": "off", - "@typescript-eslint/no-unsafe-call": "off", - "@typescript-eslint/no-unsafe-member-access": "off", - "@typescript-eslint/no-unused-vars": "off", - }, - }, - // TODO: verify - { - files: ["**/*.vue"], - parser: "vue-eslint-parser", - parserOptions: { - ecmaVersion: 2022, - ecmaFeatures: { - jsx: true, - }, - parser: { - // Script parser for `