eslint: Disable syntax rules handled by Prettier.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2020-07-14 15:09:31 -07:00 committed by Tim Abbott
parent 8046b6477a
commit bd45216c21
4 changed files with 18 additions and 80 deletions

View File

@ -4,7 +4,8 @@
"es6": true
},
"extends": [
"eslint:recommended"
"eslint:recommended",
"prettier"
],
"parserOptions": {
"ecmaVersion": 2019,
@ -16,49 +17,18 @@
],
"rules": {
"array-callback-return": "error",
"array-bracket-spacing": "error",
"arrow-body-style": "error",
"arrow-parens": "error",
"arrow-spacing": [ "error", { "before": true, "after": true } ],
"block-scoped-var": "error",
"brace-style": [ "error", "1tbs", { "allowSingleLine": true } ],
"comma-dangle": [ "error", "always-multiline" ],
"comma-spacing": [ "error",
{
"before": false,
"after": true
}
],
"curly": "error",
"dot-notation": "error",
"empty-returns/main": "error",
"eol-last": "error",
"eqeqeq": "error",
"guard-for-in": "error",
"indent": ["error", 4, {
"ArrayExpression": "first",
"ObjectExpression": "first",
"SwitchCase": 1,
"CallExpression": {"arguments": "first"},
"FunctionExpression": {"parameters": "first"},
"FunctionDeclaration": {"parameters": "first"}
}],
"key-spacing": "error",
"keyword-spacing": "error",
"max-len": [ "error", 100, 2,
{
"ignoreUrls": true,
"ignoreRegExpLiterals": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true
}
],
"new-cap": [ "error",
{
"capIsNew": false
}
],
"new-parens": "error",
"no-alert": "error",
"no-array-constructor": "error",
"no-bitwise": "error",
@ -70,15 +40,12 @@
"no-else-return": "error",
"no-eq-null": "error",
"no-eval": "error",
"no-extra-parens": "error",
"no-floating-decimal": "error",
"no-implied-eval": "error",
"no-inner-declarations": "off",
"no-iterator": "error",
"no-label-var": "error",
"no-labels": "error",
"no-loop-func": "error",
"no-multi-spaces": "error",
"no-multi-str": "error",
"no-native-reassign": "error",
"no-new-func": "error",
@ -91,7 +58,6 @@
"no-script-url": "error",
"no-self-compare": "error",
"no-sync": "error",
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-unneeded-ternary": [ "error", { "defaultAssignment": false } ],
"no-unused-expressions": "error",
@ -104,9 +70,6 @@
"no-use-before-define": "error",
"no-useless-constructor": "error",
"no-var": "error",
"space-unary-ops": "error",
"no-whitespace-before-property": "error",
"object-curly-spacing": ["error", "never"],
"one-var": [ "error", "never" ],
"prefer-arrow-callback": "error",
"prefer-const": [ "error",
@ -114,31 +77,11 @@
"ignoreReadBeforeAssign": true
}
],
"quote-props": [ "error", "as-needed" ],
"quotes": [
"error",
"double",
{ "avoidEscape": true, "allowTemplateLiterals": false }
],
"radix": "error",
"semi": "error",
"semi-spacing": "error",
"sort-imports": "error",
"space-before-blocks": "error",
"space-before-function-paren": [ "error",
{
"anonymous": "always",
"named": "never",
"asyncArrow": "always"
}
],
"space-in-parens": "error",
"space-infix-ops": "error",
"spaced-comment": "off",
"strict": "off",
"template-curly-spacing": "error",
"valid-typeof": [ "error", { "requireStringLiterals": true } ],
"wrap-iife": ["error", "inside"],
"yoda": "error"
},
"overrides": [
@ -363,16 +306,6 @@
],
"rules": {
// Dont require ES features that PhantomJS doesnt support
"comma-dangle": [
"error",
{
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "never"
}
],
"no-var": "off",
"prefer-arrow-callback": "off"
}
@ -380,7 +313,8 @@
{
"files": ["**/*.ts"],
"extends": [
"plugin:@typescript-eslint/recommended"
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint"
],
"parserOptions": {
"project": "tsconfig.json"
@ -388,9 +322,6 @@
"rules": {
// Disable base rule to avoid conflict
"empty-returns/main": "off",
"indent": "off",
"no-extra-parens": "off",
"semi": "off",
"no-unused-vars": "off",
"no-useless-constructor": "off",
@ -398,12 +329,8 @@
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/explicit-function-return-type": ["error", { "allowExpressions": true }],
"@typescript-eslint/func-call-spacing": "error",
"@typescript-eslint/indent": "error",
"@typescript-eslint/member-delimiter-style": "error",
"@typescript-eslint/member-ordering": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-extra-parens": ["error", "all"],
"@typescript-eslint/no-extraneous-class": "error",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-parameter-properties": "error",
@ -416,8 +343,6 @@
"@typescript-eslint/prefer-regexp-exec": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/semi": "error",
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unified-signatures": "error"
}
}

View File

@ -92,6 +92,7 @@
"casperjs": "casperjs/casperjs",
"difflib": "^0.2.4",
"eslint": "^7.2.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-empty-returns": "^1.0.2",
"jsdom": "^16.1.0",
"nyc": "^15.0.0",

View File

@ -44,4 +44,4 @@ API_FEATURE_LEVEL = 27
# historical commits sharing the same major version, in which case a
# minor version bump suffices.
PROVISION_VERSION = '89.4'
PROVISION_VERSION = '89.5'

View File

@ -4344,6 +4344,13 @@ escodegen@~1.3.2:
optionalDependencies:
source-map "~0.1.33"
eslint-config-prettier@^6.11.0:
version "6.11.0"
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.11.0.tgz#f6d2238c1290d01c859a8b5c1f7d352a0b0da8b1"
integrity sha512-oB8cpLWSAjOVFEJhhyMZh6NOEOtBVziaqdDQ86+qhDHFbZXoRTM7pNSvFRfW/W/L/LrQ38C99J5CGuRBBzBsdA==
dependencies:
get-stdin "^6.0.0"
eslint-plugin-empty-returns@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/eslint-plugin-empty-returns/-/eslint-plugin-empty-returns-1.0.2.tgz#9f9d4b10215a25c719f32675f44ffe5c80963147"
@ -5161,6 +5168,11 @@ get-package-type@^0.1.0:
resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a"
integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==
get-stdin@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b"
integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==
get-stdin@^8.0.0:
version "8.0.0"
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-8.0.0.tgz#cbad6a73feb75f6eeb22ba9e01f89aa28aa97a53"