From 9c6964aa19703618bf1f8655e3ff89086db96a18 Mon Sep 17 00:00:00 2001 From: Thomas Ip Date: Mon, 25 Mar 2019 22:35:44 +0800 Subject: [PATCH] ESLint: Modify recommended typescript rules to fit our use case. --- .eslintrc.json | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index cb7ecf8edf..af6ddb9dfb 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -417,49 +417,52 @@ }, "plugins": ["@typescript-eslint"], "rules": { + "empty-returns/main": 0, + "indent": 0, + "@typescript-eslint/adjacent-overload-signatures": 2, "@typescript-eslint/array-type": 2, "@typescript-eslint/ban-types": 2, - "@typescript-eslint/ban-ts-ignore": 2, - "@typescript-eslint/camelcase": 2, + "@typescript-eslint/ban-ts-ignore": 0, + "@typescript-eslint/camelcase": 0, "@typescript-eslint/class-name-casing": 2, "@typescript-eslint/explicit-function-return-type": 2, - "@typescript-eslint/explicit-member-accessibility": 2, + "@typescript-eslint/explicit-member-accessibility": 0, "@typescript-eslint/generic-type-naming": 0, "@typescript-eslint/indent": 2, - "@typescript-eslint/interface-name-prefix": 2, + "@typescript-eslint/interface-name-prefix": 0, "@typescript-eslint/member-delimiter-style": 2, - "@typescript-eslint/member-naming": 0, - "@typescript-eslint/member-ordering": 0, + "@typescript-eslint/member-naming": ["error", { "private": "^_" } ], + "@typescript-eslint/member-ordering": 2, "@typescript-eslint/no-angle-bracket-type-assertion": 2, "@typescript-eslint/no-array-constructor": 2, "@typescript-eslint/no-empty-interface": 2, - "@typescript-eslint/no-explicit-any": 2, - "@typescript-eslint/no-extraneous-class": 0, + "@typescript-eslint/no-explicit-any": 0, + "@typescript-eslint/no-extraneous-class": 2, "@typescript-eslint/no-for-in-array": 0, "@typescript-eslint/no-inferrable-types": 2, "@typescript-eslint/no-misused-new": 2, "@typescript-eslint/no-namespace": 2, - "@typescript-eslint/no-non-null-assertion": 2, + "@typescript-eslint/no-non-null-assertion": 0, "@typescript-eslint/no-object-literal-type-assertion": 2, "@typescript-eslint/no-parameter-properties": 2, - "@typescript-eslint/no-require-imports": 2, + "@typescript-eslint/no-require-imports": 0, "@typescript-eslint/no-this-alias": 0, "@typescript-eslint/no-triple-slash-reference": 2, "@typescript-eslint/no-type-alias": 0, - "@typescript-eslint/no-unnecessary-qualifier": 0, - "@typescript-eslint/no-unnecessary-type-assertion": 0, + "@typescript-eslint/no-unnecessary-qualifier": 2, + "@typescript-eslint/no-unnecessary-type-assertion": 2, "@typescript-eslint/no-unused-vars": 2, "@typescript-eslint/no-use-before-define": 2, - "@typescript-eslint/no-useless-constructor": 0, - "@typescript-eslint/no-var-requires": 2, + "@typescript-eslint/no-useless-constructor": 2, + "@typescript-eslint/no-var-requires": 0, "@typescript-eslint/prefer-function-type": 0, - "@typescript-eslint/prefer-interface": 2, + "@typescript-eslint/prefer-interface": 0, "@typescript-eslint/prefer-namespace-keyword": 2, "@typescript-eslint/promise-function-async": 2, "@typescript-eslint/restrict-plus-operands": 0, "@typescript-eslint/type-annotation-spacing": 2, - "@typescript-eslint/unified-signatures": 0 + "@typescript-eslint/unified-signatures": 2 } } ]