2020-02-03 09:45:14 +01:00
module . exports = {
env : {
es6 : true ,
jasmine : true ,
node : true ,
worker : true ,
} ,
parser : "@typescript-eslint/parser" ,
parserOptions : {
ecmaVersion : 2018 ,
2021-05-04 18:40:25 +02:00
project : "./tsconfig.eslint.json" ,
2020-02-03 09:45:14 +01:00
tsconfigRootDir : _ _dirname ,
} ,
2020-08-04 09:39:05 +02:00
plugins : [ "@typescript-eslint" , "prettier" , "simple-import-sort" , "import" ] ,
2020-02-03 09:45:14 +01:00
extends : [
"eslint:recommended" ,
"plugin:@typescript-eslint/recommended" ,
2021-05-04 18:40:25 +02:00
"prettier" ,
2020-02-03 09:45:14 +01:00
"plugin:prettier/recommended" ,
"plugin:import/typescript" ,
] ,
rules : {
curly : [ "warn" , "multi-line" , "consistent" ] ,
2020-02-19 09:42:20 +01:00
"no-bitwise" : "warn" ,
2020-09-15 17:15:33 +02:00
"no-console" : [ "warn" , { allow : [ "error" , "info" , "table" , "warn" ] } ] ,
2020-02-03 09:45:14 +01:00
"no-param-reassign" : "warn" ,
2020-10-21 13:36:37 +02:00
"no-shadow" : "off" , // disabled in favour of @typescript-eslint/no-shadow, see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-shadow.md
2020-06-19 13:20:29 +02:00
"no-unused-vars" : "off" , // disabled in favour of @typescript-eslint/no-unused-vars, see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-vars.md
2020-02-03 09:45:14 +01:00
"prefer-const" : "warn" ,
2020-07-07 16:57:35 +02:00
radix : [ "warn" , "always" ] ,
2020-02-03 09:45:14 +01:00
"spaced-comment" : [ "warn" , "always" , { line : { markers : [ "/ <reference" ] } } ] ,
"import/no-cycle" : "warn" ,
2021-05-04 18:40:25 +02:00
"simple-import-sort/imports" : "warn" ,
2021-12-01 11:58:57 +01:00
"simple-import-sort/exports" : "warn" ,
2020-07-07 16:57:35 +02:00
"@typescript-eslint/array-type" : [ "warn" , { default : "array-simple" } ] ,
2020-02-19 08:59:59 +01:00
"@typescript-eslint/await-thenable" : "warn" ,
2020-08-04 11:30:42 +02:00
"@typescript-eslint/ban-types" : "warn" ,
2020-02-03 09:45:14 +01:00
"@typescript-eslint/explicit-function-return-type" : [ "warn" , { allowExpressions : true } ] ,
2020-09-29 17:29:00 +02:00
"@typescript-eslint/explicit-member-accessibility" : "warn" ,
2020-07-15 13:23:06 +02:00
"@typescript-eslint/naming-convention" : [
"warn" ,
{
selector : "default" ,
format : [ "strictCamelCase" ] ,
} ,
{
selector : "typeLike" ,
format : [ "StrictPascalCase" ] ,
} ,
{
selector : "enumMember" ,
format : [ "StrictPascalCase" ] ,
} ,
{
selector : "variable" ,
format : [ "strictCamelCase" ] ,
leadingUnderscore : "allow" ,
} ,
{
selector : "parameter" ,
format : [ "strictCamelCase" ] ,
leadingUnderscore : "allow" ,
} ,
] ,
2020-02-19 09:03:17 +01:00
"@typescript-eslint/no-dynamic-delete" : "warn" ,
2020-02-03 09:45:14 +01:00
"@typescript-eslint/no-empty-function" : "off" ,
"@typescript-eslint/no-empty-interface" : "off" ,
"@typescript-eslint/no-explicit-any" : "off" ,
2020-02-19 08:58:34 +01:00
"@typescript-eslint/no-floating-promises" : "warn" ,
2020-09-29 17:29:00 +02:00
"@typescript-eslint/no-parameter-properties" : "warn" ,
2020-10-21 13:36:37 +02:00
"@typescript-eslint/no-shadow" : "warn" ,
2020-02-03 09:45:14 +01:00
"@typescript-eslint/no-unused-vars" : [ "warn" , { argsIgnorePattern : "^_" , varsIgnorePattern : "^_" } ] ,
2020-02-13 10:38:14 +01:00
"@typescript-eslint/no-unnecessary-type-assertion" : "warn" ,
2020-02-03 09:45:14 +01:00
"@typescript-eslint/no-use-before-define" : "warn" ,
2020-02-03 09:46:35 +01:00
"@typescript-eslint/prefer-readonly" : "warn" ,
2020-02-03 09:45:14 +01:00
} ,
overrides : [
{
files : "**/*.js" ,
rules : {
"@typescript-eslint/no-var-requires" : "off" ,
2020-02-07 16:40:15 +01:00
"@typescript-eslint/explicit-function-return-type" : "off" ,
2020-09-29 17:29:00 +02:00
"@typescript-eslint/explicit-member-accessibility" : "off" ,
2022-01-25 16:50:03 +01:00
"@typescript-eslint/explicit-module-boundary-types" : "off" ,
2020-02-03 09:45:14 +01:00
} ,
} ,
{
files : "**/*.spec.ts" ,
rules : {
"@typescript-eslint/no-non-null-assertion" : "off" ,
} ,
} ,
] ,
} ;