RenaiApp/.eslintrc.json

166 lines
4.5 KiB
JSON

{
"root": true,
"plugins": ["@typescript-eslint", "import"],
"extends": ["eslint:recommended", "prettier"],
"parserOptions": {
"ecmaVersion": 2019
},
"settings": {
"import/core-modules": ["electron"]
},
"env": {
"browser": true,
"node": true
},
"rules": {
"no-shadow": "error",
"no-magic-numbers": ["error", { "ignore": [-1, 0, 1, 10, 100] }],
"no-param-reassign": "error",
"prefer-template": "error",
"prefer-arrow-callback": "error",
"arrow-body-style": ["error", "as-needed"],
"no-unused-expressions": "error",
"prefer-const": "error",
"max-classes-per-file": "error",
"object-shorthand": ["error", "methods"],
"no-useless-rename": "error",
"prefer-promise-reject-errors": "error",
"eqeqeq": "error",
"prefer-destructuring": [
"error",
{
"array": false,
"object": true
}
],
"no-constant-condition": ["error", { "checkLoops": false }],
"no-throw-literal": "error",
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": [
"**/*.{spec,mock}.*",
"src/**/test/*",
"mocks/**/*",
"src/renderer/**/*",
"templates/**/*",
"buildfile.js",
"forge.config.js"
]
}
],
"import/no-default-export": "error",
"import/first": "error",
"import/order": [
"error",
{
"alphabetize": {
"order": "asc"
}
}
]
},
"overrides": [
{
"files": ["**/*.ts"],
"extends": [
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier/@typescript-eslint"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"settings": {
"import/extensions": [".ts", "d.ts", ".js", ".json"],
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".d.ts"]
}
},
"rules": {
"no-console": "error",
"no-magic-numbers": "off",
"no-shadow": "off",
"@typescript-eslint/ban-types": [
"error",
{
"extendDefaults": true,
"types": {
"object": false
}
}
],
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-magic-numbers": [
"error",
{
"ignore": [-1, 0, 1],
"ignoreNumericLiteralTypes": true,
"ignoreReadonlyClassProperties": true,
"ignoreEnums": true
}
],
"@typescript-eslint/no-inferrable-types": [
"error",
{
"ignoreParameters": true,
"ignoreProperties": true
}
],
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "interface",
"format": ["PascalCase"],
"prefix": ["I"]
}
],
"@typescript-eslint/explicit-member-accessibility": "error",
"@typescript-eslint/unbound-method": "off",
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-misused-promises": ["error", { "checksVoidReturn": false }],
"@typescript-eslint/member-ordering": "error",
"@typescript-eslint/array-type": ["error", { "default": "array-simple" }],
"@typescript-eslint/restrict-template-expressions": [
"error",
{
"allowNumber": true,
"allowBoolean": false,
"allowAny": false,
"allowNullish": false
}
],
"@typescript-eslint/no-shadow": ["error"]
}
},
{
"files": ["**/*.{spec,mock}.*", "src/**/test/*.*"],
"rules": {
"no-unused-expressions": "off",
"import/order": "off",
"@typescript-eslint/no-magic-numbers": "off",
"@typescript-eslint/typedef": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/ban-ts-comment": "off"
}
},
{
"files": ["**/*.d.ts"],
"rules": {
"import/no-default-export": "off"
}
}
]
}