From e70c17a6c36edcdde90215705b4d432fede52266 Mon Sep 17 00:00:00 2001 From: youKnowOwO Date: Fri, 28 Aug 2020 23:06:14 +0800 Subject: [PATCH] code(config): Move eslint and typescript config (probably) --- .eslintrc | 121 +------------------------------------------------- package.json | 1 + tsconfig.json | 12 +---- yarn.lock | 4 ++ 4 files changed, 7 insertions(+), 131 deletions(-) diff --git a/.eslintrc b/.eslintrc index 613d992..1efe52e 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,122 +1,3 @@ { - "env": { - "browser": true, - "es6": true, - "node": true - }, - "extends": [ - "plugin:@typescript-eslint/recommended", - "plugin:@typescript-eslint/recommended-requiring-type-checking" - ], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint" - ], - "rules": { - "@typescript-eslint/array-type": "off", - "@typescript-eslint/indent": [ - "warn", - 4 - ], - "@typescript-eslint/interface-name-prefix": "off", - "@typescript-eslint/member-delimiter-style": [ - "error", - { - "multiline": { - "delimiter": "semi", - "requireLast": true - }, - "singleline": { - "delimiter": "semi", - "requireLast": false - } - } - ], - "no-undef": "error", - "@typescript-eslint/no-empty-function": "warn", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/unbound-method": "off", - "@typescript-eslint/no-parameter-properties": "off", - "@typescript-eslint/no-use-before-define": "off", - "@typescript-eslint/prefer-for-of": "warn", - "@typescript-eslint/no-unused-vars": "warn", - "@typescript-eslint/prefer-function-type": "warn", - "@typescript-eslint/explicit-function-return-type": "warn", - "@typescript-eslint/no-var-requires": "off", - "prefer-template": "warn", - "@typescript-eslint/no-non-null-assertion": "off", - "@typescript-eslint/no-floating-promises": "off", - "@typescript-eslint/no-unsafe-assignment": "off", - "@typescript-eslint/no-unsafe-call": "off", - "@typescript-eslint/no-unsafe-member-access": "off", - "@typescript-eslint/no-unsafe-return": "off", - "@typescript-eslint/restrict-template-expressions": "off", - "@typescript-eslint/quotes": [ - "warn", - "double", - { - "avoidEscape": true - } - ], - "@typescript-eslint/semi": [ - "warn", - "always" - ], - "@typescript-eslint/no-misused-promises": "warn", - "@typescript-eslint/require-await": "warn", - "@typescript-eslint/unified-signatures": "error", - "complexity": "off", - "constructor-super": "warn", - "dot-notation": "warn", - "import/order": "off", - "max-classes-per-file": [ - "warn", - 3 - ], - "new-parens": "error", - "no-bitwise": "error", - "no-caller": "error", - "no-cond-assign": "error", - "no-console": "warn", - "no-debugger": "warn", - "no-empty": "warn", - "no-eval": "warn", - "no-fallthrough": "off", - "no-invalid-this": "off", - "no-new-wrappers": "error", - "no-shadow": [ - "off", - { - "hoist": "all" - } - ], - "no-var": "warn", - "no-alert": "error", - "no-extra-label": "warn", - "no-extra-parens": "off", - "no-extra-semi": "warn", - "no-throw-literal": "error", - "no-const-assign": "error", - "no-useless-return": "warn", - "no-unreachable": "warn", - "no-trailing-spaces": "warn", - "no-undef-init": "error", - "no-underscore-dangle": "warn", - "no-unsafe-finally": "warn", - "no-unused-expressions": "warn", - "no-unused-labels": "warn", - "object-shorthand": "warn", - "one-var": [ - "error", - "never" - ], - "radix": "off", - "spaced-comment": "warn", - "use-isnan": "warn", - "valid-typeof": "off" - } + "extends": "@youKnowOwO/eslint-config" } \ No newline at end of file diff --git a/package.json b/package.json index 5f69a27..b8b4584 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "@types/ws": "^7.2.6", "@typescript-eslint/eslint-plugin": "^3.10.0", "@typescript-eslint/parser": "^3.10.0", + "@youKnowOwO/eslint-config": "github:youKnowOwO/eslint-config#build", "rimraf": "^3.0.2", "typescript": "^4.0.2" }, diff --git a/tsconfig.json b/tsconfig.json index 6f459b0..a8157d7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,16 +1,6 @@ { + "extends": "@youKnowOwO/eslint-config/tsconfig", "compilerOptions": { - "experimentalDecorators": true, - "target": "ES2020", - "module": "commonjs", - "allowJs": true, - "strict": true, - "skipLibCheck": true, - "noImplicitAny": true, - "alwaysStrict": true, - "allowSyntheticDefaultImports": true, - "esModuleInterop": true, - "resolveJsonModule": true, "typeRoots": [ "node_modules/@types", "src/interfaces" diff --git a/yarn.lock b/yarn.lock index f5a4a6c..bbd4e83 100644 --- a/yarn.lock +++ b/yarn.lock @@ -166,6 +166,10 @@ dependencies: eslint-visitor-keys "^1.1.0" +"@youKnowOwO/eslint-config@github:youKnowOwO/eslint-config#build": + version "0.0.0" + resolved "https://codeload.github.com/youKnowOwO/eslint-config/tar.gz/df9d7d73752a657b8ccd055230c263bdb4e4cd78" + abab@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.3.tgz#623e2075e02eb2d3f2475e49f99c91846467907a"