2020-06-06 11:37:14 +02:00
|
|
|
/*
|
|
|
|
👋 Hi! This file was autogenerated by tslint-to-eslint-config.
|
|
|
|
https://github.com/typescript-eslint/tslint-to-eslint-config
|
|
|
|
|
|
|
|
It represents the closest reasonable ESLint configuration to this
|
|
|
|
project's original TSLint configuration.
|
|
|
|
|
|
|
|
We recommend eventually switching this configuration to extend from
|
2021-02-04 19:58:47 +01:00
|
|
|
the recommended rulesets in typescript-eslint.
|
2020-06-06 11:37:14 +02:00
|
|
|
https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md
|
|
|
|
|
|
|
|
Happy linting! 💖
|
|
|
|
*/
|
|
|
|
module.exports = {
|
|
|
|
"env": {
|
|
|
|
"browser": true,
|
|
|
|
"es6": true,
|
|
|
|
"node": true
|
|
|
|
},
|
|
|
|
"extends": [
|
|
|
|
"plugin:@typescript-eslint/recommended",
|
|
|
|
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
|
|
|
"prettier",
|
2020-06-06 14:52:38 +02:00
|
|
|
"plugin:sonarjs/recommended"
|
2020-06-06 11:37:14 +02:00
|
|
|
],
|
|
|
|
"parser": "@typescript-eslint/parser",
|
|
|
|
"parserOptions": {
|
2020-06-17 18:00:24 +01:00
|
|
|
"project": ["tsconfig.json", "tsconfig.eslint.json"],
|
2020-06-06 11:37:14 +02:00
|
|
|
"sourceType": "module"
|
|
|
|
},
|
|
|
|
"plugins": [
|
|
|
|
"@typescript-eslint",
|
2020-06-06 14:52:38 +02:00
|
|
|
"@typescript-eslint/tslint",
|
|
|
|
"sonarjs"
|
2020-06-06 11:37:14 +02:00
|
|
|
],
|
|
|
|
"rules": {
|
2023-09-17 18:08:53 +02:00
|
|
|
"unsupported-apis": "warn",
|
2020-06-17 14:58:32 +01:00
|
|
|
"sonarjs/cognitive-complexity": "off", //"error",
|
2020-06-18 21:30:58 +01:00
|
|
|
"sonarjs/no-duplicate-string": "off",
|
2020-06-19 21:04:52 +01:00
|
|
|
"sonarjs/no-unused-collection": "off", //"error", // There seems to be a bug with this rule - exported collections are assumed unused
|
2020-06-06 11:37:14 +02:00
|
|
|
"@typescript-eslint/adjacent-overload-signatures": "error",
|
2020-12-10 22:56:16 +01:00
|
|
|
"@typescript-eslint/array-type": "off",
|
2020-06-06 11:37:14 +02:00
|
|
|
"@typescript-eslint/await-thenable": "error",
|
|
|
|
"@typescript-eslint/ban-ts-comment": "error",
|
|
|
|
"@typescript-eslint/ban-types": [
|
2020-06-18 21:55:04 +01:00
|
|
|
"error",
|
2020-06-06 11:37:14 +02:00
|
|
|
{
|
|
|
|
"types": {
|
|
|
|
"Object": {
|
|
|
|
"message": "Avoid using the `Object` type. Did you mean `object`?"
|
|
|
|
},
|
|
|
|
"Function": {
|
|
|
|
"message": "Avoid using the `Function` type. Prefer a specific function type, like `() => void`."
|
|
|
|
},
|
|
|
|
"Boolean": {
|
|
|
|
"message": "Avoid using the `Boolean` type. Did you mean `boolean`?"
|
|
|
|
},
|
|
|
|
"Number": {
|
|
|
|
"message": "Avoid using the `Number` type. Did you mean `number`?"
|
|
|
|
},
|
|
|
|
"String": {
|
|
|
|
"message": "Avoid using the `String` type. Did you mean `string`?"
|
|
|
|
},
|
|
|
|
"Symbol": {
|
|
|
|
"message": "Avoid using the `Symbol` type. Did you mean `symbol`?"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"@typescript-eslint/class-name-casing": "off",
|
|
|
|
"@typescript-eslint/consistent-type-assertions": "error",
|
|
|
|
"@typescript-eslint/consistent-type-definitions": "error",
|
2021-01-27 12:57:42 +01:00
|
|
|
"@typescript-eslint/dot-notation": "off", // this should be "error" but the fix silently breaks code almost 100% of the time. not worth the headaches
|
2020-06-06 11:37:14 +02:00
|
|
|
"@typescript-eslint/explicit-member-accessibility": [
|
|
|
|
"off",
|
|
|
|
{
|
|
|
|
"accessibility": "explicit"
|
|
|
|
}
|
|
|
|
],
|
2020-06-19 21:04:15 +01:00
|
|
|
"@typescript-eslint/explicit-module-boundary-types": "off", //"warn", // This is another hard one to enable
|
2020-06-06 11:37:14 +02:00
|
|
|
"@typescript-eslint/indent": "off",
|
|
|
|
"@typescript-eslint/interface-name-prefix": "off",
|
|
|
|
"@typescript-eslint/member-delimiter-style": [
|
|
|
|
"off",
|
|
|
|
{
|
|
|
|
"multiline": {
|
|
|
|
"delimiter": "none",
|
|
|
|
"requireLast": true
|
|
|
|
},
|
|
|
|
"singleline": {
|
|
|
|
"delimiter": "semi",
|
|
|
|
"requireLast": false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
2020-06-18 22:18:13 +01:00
|
|
|
"@typescript-eslint/member-ordering": "error",
|
2020-06-06 11:37:14 +02:00
|
|
|
"@typescript-eslint/no-array-constructor": "error",
|
2020-06-18 22:35:24 +01:00
|
|
|
"@typescript-eslint/no-empty-function": "error",
|
2020-06-06 11:37:14 +02:00
|
|
|
"@typescript-eslint/no-empty-interface": "error",
|
|
|
|
"@typescript-eslint/no-explicit-any": "off",
|
|
|
|
"@typescript-eslint/no-extra-non-null-assertion": "error",
|
2020-06-19 21:02:08 +01:00
|
|
|
"@typescript-eslint/no-floating-promises": "off", //"error", // We should turn this on eventually but it will take a while to fix
|
2020-06-06 11:37:14 +02:00
|
|
|
"@typescript-eslint/no-for-in-array": "error",
|
|
|
|
"@typescript-eslint/no-implied-eval": "error",
|
2020-06-19 21:00:55 +01:00
|
|
|
"@typescript-eslint/no-inferrable-types": "error",
|
2020-06-06 11:37:14 +02:00
|
|
|
"@typescript-eslint/no-misused-new": "error",
|
2020-06-19 20:54:45 +01:00
|
|
|
"@typescript-eslint/no-misused-promises": ["error",
|
|
|
|
{
|
|
|
|
"checksVoidReturn": false,
|
|
|
|
},
|
|
|
|
],
|
2020-06-06 11:37:14 +02:00
|
|
|
"@typescript-eslint/no-namespace": "error",
|
|
|
|
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
|
|
|
|
"@typescript-eslint/no-non-null-assertion": "warn",
|
|
|
|
"@typescript-eslint/no-parameter-properties": "off",
|
|
|
|
"@typescript-eslint/no-this-alias": "error",
|
2020-06-19 20:47:40 +01:00
|
|
|
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
2020-06-17 14:58:32 +01:00
|
|
|
"@typescript-eslint/no-unsafe-assignment": "off", //"error",
|
|
|
|
"@typescript-eslint/no-unsafe-call": "off", //"error",
|
2020-06-19 20:40:04 +01:00
|
|
|
"@typescript-eslint/no-unsafe-member-access": "off", //"error", // We've done this a lot, but it would be a good idea to fix it
|
2020-06-19 20:39:30 +01:00
|
|
|
"@typescript-eslint/no-unsafe-return": "off", //"error", // We've done this a lot, but it would be a good idea to fix it
|
2020-06-19 20:36:56 +01:00
|
|
|
"@typescript-eslint/no-unused-expressions": [
|
|
|
|
"error",
|
|
|
|
{
|
|
|
|
"allowShortCircuit": true,
|
|
|
|
"allowTernary": true,
|
|
|
|
}
|
|
|
|
],
|
2020-12-15 19:07:38 +01:00
|
|
|
"@typescript-eslint/no-unused-vars-experimental": [
|
2020-06-19 20:30:07 +01:00
|
|
|
"error",
|
|
|
|
{
|
2020-12-15 19:07:38 +01:00
|
|
|
"ignoreArgsIfArgsAfterAreUsed": true,
|
|
|
|
},
|
2020-06-19 20:30:07 +01:00
|
|
|
],
|
2020-12-15 19:07:38 +01:00
|
|
|
"@typescript-eslint/no-unused-vars": "off",
|
2020-06-06 11:37:14 +02:00
|
|
|
"@typescript-eslint/no-use-before-define": "off",
|
|
|
|
"@typescript-eslint/no-var-requires": "error",
|
|
|
|
"@typescript-eslint/prefer-as-const": "error",
|
|
|
|
"@typescript-eslint/prefer-for-of": "error",
|
|
|
|
"@typescript-eslint/prefer-function-type": "error",
|
|
|
|
"@typescript-eslint/prefer-namespace-keyword": "error",
|
2020-06-19 15:19:46 +01:00
|
|
|
"@typescript-eslint/prefer-regexp-exec": "error",
|
2020-06-06 11:37:14 +02:00
|
|
|
"@typescript-eslint/quotes": [
|
2020-06-19 13:55:22 +01:00
|
|
|
"error",
|
2020-06-06 11:37:14 +02:00
|
|
|
"double",
|
|
|
|
{
|
2020-06-19 13:55:22 +01:00
|
|
|
"avoidEscape": true,
|
|
|
|
"allowTemplateLiterals": true,
|
|
|
|
},
|
2020-06-06 11:37:14 +02:00
|
|
|
],
|
2020-06-19 13:48:22 +01:00
|
|
|
"@typescript-eslint/require-await": "error",
|
2020-06-19 13:34:25 +01:00
|
|
|
"@typescript-eslint/restrict-plus-operands": "off", //"error", // We use this a lot - fixing it is a problem for a rainy day
|
|
|
|
"@typescript-eslint/restrict-template-expressions": "off",
|
2020-06-06 11:37:14 +02:00
|
|
|
"@typescript-eslint/semi": [
|
|
|
|
"off",
|
|
|
|
null
|
|
|
|
],
|
|
|
|
"@typescript-eslint/triple-slash-reference": [
|
|
|
|
"error",
|
|
|
|
{
|
|
|
|
"path": "always",
|
|
|
|
"types": "prefer-import",
|
|
|
|
"lib": "always"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"@typescript-eslint/type-annotation-spacing": "error",
|
2020-06-19 13:31:00 +01:00
|
|
|
"@typescript-eslint/unbound-method": "error",
|
2020-06-19 13:11:03 +01:00
|
|
|
"@typescript-eslint/unified-signatures": "error",
|
2020-06-19 13:08:23 +01:00
|
|
|
"arrow-body-style": "error",
|
2020-06-06 11:37:14 +02:00
|
|
|
"arrow-parens": [
|
|
|
|
"off",
|
|
|
|
"always"
|
|
|
|
],
|
|
|
|
"brace-style": [
|
2020-06-19 13:05:31 +01:00
|
|
|
"error",
|
2020-06-06 11:37:14 +02:00
|
|
|
"1tbs"
|
|
|
|
],
|
|
|
|
"camelcase": "off",
|
|
|
|
"comma-dangle": "off",
|
|
|
|
"complexity": "off",
|
|
|
|
"constructor-super": "error",
|
|
|
|
"curly": "off",
|
|
|
|
"eol-last": "error",
|
|
|
|
"eqeqeq": [
|
|
|
|
"off",
|
|
|
|
"always"
|
|
|
|
],
|
2020-06-19 13:02:43 +01:00
|
|
|
"guard-for-in": "error",
|
2020-06-06 11:37:14 +02:00
|
|
|
"id-blacklist": "off",
|
|
|
|
"id-match": "off",
|
|
|
|
"import/order": "off",
|
|
|
|
"jsdoc/check-alignment": "off",
|
|
|
|
"jsdoc/check-indentation": "off",
|
|
|
|
"jsdoc/newline-after-description": "off",
|
|
|
|
"max-classes-per-file": "off",
|
|
|
|
"max-len": "off",
|
|
|
|
"new-parens": "error",
|
|
|
|
"no-array-constructor": "off",
|
|
|
|
"no-bitwise": "error",
|
|
|
|
"no-caller": "error",
|
|
|
|
"no-cond-assign": "error",
|
|
|
|
"no-console": "off",
|
|
|
|
"no-debugger": "error",
|
|
|
|
"no-empty": [
|
|
|
|
"error",
|
|
|
|
{
|
|
|
|
"allowEmptyCatch": true
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"no-empty-function": "off",
|
|
|
|
"no-eval": "off",
|
|
|
|
"no-fallthrough": "off",
|
|
|
|
"no-invalid-this": "off",
|
|
|
|
"no-multiple-empty-lines": "error",
|
|
|
|
"no-new-wrappers": "error",
|
|
|
|
"no-shadow": [
|
|
|
|
"off",
|
|
|
|
{
|
|
|
|
"hoist": "all"
|
|
|
|
}
|
|
|
|
],
|
2021-02-04 19:58:47 +01:00
|
|
|
"no-throw-literal": "error",
|
2020-06-06 11:37:14 +02:00
|
|
|
"no-trailing-spaces": "error",
|
|
|
|
"no-undef-init": "error",
|
|
|
|
"no-underscore-dangle": "off",
|
|
|
|
"no-unsafe-finally": "off",
|
|
|
|
"no-unused-labels": "error",
|
|
|
|
"no-unused-vars": "off",
|
|
|
|
"no-var": "error",
|
|
|
|
"object-shorthand": "error",
|
|
|
|
"one-var": [
|
|
|
|
"error",
|
|
|
|
"never"
|
|
|
|
],
|
|
|
|
"prefer-arrow/prefer-arrow-functions": "off",
|
|
|
|
"prefer-const": [
|
2020-06-18 18:28:10 +01:00
|
|
|
"error",
|
2020-06-06 11:37:14 +02:00
|
|
|
{
|
|
|
|
"destructuring": "all"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"quote-props": "off",
|
2020-06-18 22:52:49 +01:00
|
|
|
"radix": "error",
|
2020-06-06 11:37:14 +02:00
|
|
|
"require-await": "off",
|
|
|
|
"spaced-comment": [
|
2020-06-18 22:43:38 +01:00
|
|
|
"error",
|
2020-06-06 11:37:14 +02:00
|
|
|
"always",
|
|
|
|
{
|
|
|
|
"markers": [
|
|
|
|
"/"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"use-isnan": "error",
|
|
|
|
"valid-typeof": "off"
|
2020-06-18 22:35:24 +01:00
|
|
|
},
|
2020-07-06 18:27:35 +01:00
|
|
|
"overrides": [
|
|
|
|
{
|
|
|
|
"files": ["src/completions/*.ts", "src/excmds.ts"],
|
|
|
|
"rules": {
|
|
|
|
// We have methods that must be async in some classes but not in others
|
|
|
|
// In src/excmds anything that crosses between content<->background must be async even if it looks like it isn't
|
|
|
|
"@typescript-eslint/require-await": "off",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"files": ["src/lib/editor_utils.ts"],
|
|
|
|
"rules": {
|
|
|
|
// The regexes use the /g flag which match handles differently to exec
|
|
|
|
"@typescript-eslint/prefer-regexp-exec": "off",
|
|
|
|
},
|
2020-06-19 13:48:22 +01:00
|
|
|
},
|
2020-07-06 18:27:35 +01:00
|
|
|
],
|
2020-06-06 11:37:14 +02:00
|
|
|
};
|