/* 👋 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 the recommended rulesets in typescript-eslint. 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", "plugin:sonarjs/recommended" ], "ignorePatterns": [ "node_modules", "build", "coverage", "*.test.ts", "test_utils.ts", "e2e_tests", "compiler", "node_modules", "build", "coverage", "*.test.ts", "test_utils.ts", "e2e_tests", "compiler" ], "parser": "@typescript-eslint/parser", "parserOptions": { "project": ["tsconfig.json", "tsconfig.eslint.json"], "sourceType": "module" }, "plugins": [ "sonarjs", "eslint-plugin-jsdoc", "eslint-plugin-prefer-arrow", "eslint-plugin-import", "@typescript-eslint", ], "root": true, "rules": { "@typescript-eslint/adjacent-overload-signatures": "error", "@typescript-eslint/array-type": [ "error", { "default": "array-simple" } ], "@typescript-eslint/await-thenable": "error", "@typescript-eslint/ban-ts-comment": "error", "@typescript-eslint/ban-types": [ "error", { "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": "Use boolean instead", "fixWith": "boolean" }, "Number": { "message": "Use number instead", "fixWith": "number" }, "String": { "message": "Use string instead", "fixWith": "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", "@typescript-eslint/dot-notation": "off", // TODO: enable "@typescript-eslint/explicit-function-return-type": "off", "@typescript-eslint/explicit-member-accessibility": [ "off", { "accessibility": "explicit" } ], "@typescript-eslint/explicit-module-boundary-types": "off", "@typescript-eslint/interface-name-prefix": "off", "@typescript-eslint/member-delimiter-style": [ "off", { "multiline": { "delimiter": "none", "requireLast": true }, "singleline": { "delimiter": "semi", "requireLast": false } } ], "@typescript-eslint/member-ordering": "error", "@typescript-eslint/naming-convention": [ "off", { "selector": "variable", "format": [ "camelCase", "UPPER_CASE" ], "leadingUnderscore": "forbid", "trailingUnderscore": "forbid" } ], "@typescript-eslint/no-array-constructor": "error", "@typescript-eslint/no-empty-function": "error", "@typescript-eslint/no-empty-interface": "error", "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-extra-non-null-assertion": "error", "@typescript-eslint/no-floating-promises": "off", "@typescript-eslint/no-for-in-array": "error", "@typescript-eslint/no-implied-eval": "error", "@typescript-eslint/no-inferrable-types": "error", "@typescript-eslint/no-misused-new": "error", "@typescript-eslint/no-misused-promises": [ "error", { "checksVoidReturn": false } ], "@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-shadow": [ "off", { "hoist": "all" } ], "@typescript-eslint/no-this-alias": "error", "@typescript-eslint/no-unnecessary-type-assertion": "error", "@typescript-eslint/no-unsafe-argument": "off", // probably a good idea to turn back on, exercise for a rainy day "@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/no-unused-expressions": [ "error", { "allowShortCircuit": true, "allowTernary": true } ], "@typescript-eslint/no-unused-vars": "off", "@typescript-eslint/no-unused-vars": [ "error", { "args": "after-used", "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" } ], "@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", "@typescript-eslint/prefer-regexp-exec": "error", "@typescript-eslint/quotes": [ "error", "double", { "avoidEscape": true, "allowTemplateLiterals": true } ], "@typescript-eslint/require-array-sort-compare": [ "error", { "ignoreStringArrays": true } ], "@typescript-eslint/require-await": "error", "@typescript-eslint/restrict-plus-operands": "off", "@typescript-eslint/restrict-template-expressions": "off", "@typescript-eslint/semi": [ "off", null ], "@typescript-eslint/triple-slash-reference": [ "error", { "path": "always", "types": "prefer-import", "lib": "always" } ], "@typescript-eslint/type-annotation-spacing": "error", "@typescript-eslint/typedef": "off", "@typescript-eslint/unbound-method": "error", "@typescript-eslint/unified-signatures": "error", "arrow-body-style": "error", "arrow-parens": [ "off", "always" ], "brace-style": [ "error", "1tbs" ], "camelcase": "off", "complexity": "off", "constructor-super": "error", "default-case-last": "error", "dot-notation": "off", "eol-last": "error", "eqeqeq": [ "off", "always" ], "guard-for-in": "error", "id-blacklist": "off", "id-denylist": "off", "id-match": "off", "import/order": [ "off", { "alphabetize": { "caseInsensitive": true, "order": "asc" }, "newlines-between": "ignore", "groups": [ [ "builtin", "external", "internal", "unknown", "object", "type" ], "parent", [ "sibling", "index" ] ], "distinctGroup": false, "pathGroupsExcludedImportTypes": [], "pathGroups": [ { "pattern": "./", "patternOptions": { "nocomment": true, "dot": true }, "group": "sibling", "position": "before" }, { "pattern": ".", "patternOptions": { "nocomment": true, "dot": true }, "group": "sibling", "position": "before" }, { "pattern": "..", "patternOptions": { "nocomment": true, "dot": true }, "group": "parent", "position": "before" }, { "pattern": "../", "patternOptions": { "nocomment": true, "dot": true }, "group": "parent", "position": "before" } ] } ], "jsdoc/check-alignment": "off", "jsdoc/check-indentation": "off", "jsdoc/newline-after-description": "off", "max-classes-per-file": "off", "max-lines-per-function": [ "off", { "max": 200 } ], "max-params": [ "error", { "max": 8 } ], "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-empty-pattern": "error", "no-eval": "off", "no-extra-parens": "off", "no-fallthrough": "off", "no-implied-eval": "off", "no-invalid-this": "off", "no-multi-str": "error", "no-multiple-empty-lines": "error", "no-new-wrappers": "error", "no-self-assign": "error", "no-shadow": "off", "no-throw-literal": "off", "no-trailing-spaces": "error", "no-undef-init": "error", "no-underscore-dangle": "off", "no-unsafe-finally": "off", "no-unused-expressions": "off", "no-unused-labels": "error", "no-unused-vars": "off", "no-use-before-define": "off", "no-var": "error", "object-shorthand": "error", "one-var": [ "error", "never" ], "prefer-arrow/prefer-arrow-functions": "off", "prefer-const": [ "error", { "destructuring": "all" } ], "radix": "error", "require-await": "off", "sonarjs/cognitive-complexity": "off", "sonarjs/elseif-without-else": "off", "sonarjs/max-switch-cases": "error", "sonarjs/no-all-duplicated-branches": "error", "sonarjs/no-collapsible-if": "error", "sonarjs/no-collection-size-mischeck": "error", "sonarjs/no-duplicate-string": "off", "sonarjs/no-duplicated-branches": "error", "sonarjs/no-element-overwrite": "error", "sonarjs/no-empty-collection": "error", "sonarjs/no-extra-arguments": "error", "sonarjs/no-gratuitous-expressions": "error", "sonarjs/no-identical-conditions": "error", "sonarjs/no-identical-expressions": "error", "sonarjs/no-identical-functions": "error", "sonarjs/no-ignored-return": "error", "sonarjs/no-inverted-boolean-check": "error", "sonarjs/no-nested-switch": "error", "sonarjs/no-nested-template-literals": "error", "sonarjs/no-one-iteration-loop": "error", "sonarjs/no-redundant-boolean": "error", "sonarjs/no-redundant-jump": "error", "sonarjs/no-same-line-conditional": "error", "sonarjs/no-small-switch": "error", "sonarjs/no-unused-collection": "error", "sonarjs/no-use-of-empty-return-value": "error", "sonarjs/no-useless-catch": "error", "sonarjs/non-existent-operator": "error", "sonarjs/prefer-immediate-return": "error", "sonarjs/prefer-object-literal": "error", "sonarjs/prefer-single-boolean-return": "error", "sonarjs/prefer-while": "error", "space-before-function-paren": [ "error", { "anonymous": "never", "asyncArrow": "always", "named": "never" } ], "spaced-comment": [ "error", "always", { "markers": [ "/" ] } ], "use-isnan": "error", "valid-typeof": "off" }, "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", }, }, ], };