RenaiApp/.eslintrc.json

113 lines
3.2 KiB
JSON

{
"root": true,
"extends": ["eslint:recommended", "prettier"],
"plugins": ["import"],
"parserOptions": {
"ecmaVersion": 2019
},
"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",
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": [
"tests/**/*",
"mocks/**/*",
"src/renderer/**/*",
"templates/**/*",
"buildfile.js",
"forge.config.js"
]
}
],
"import/no-default-export": "error"
},
"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/core-modules": ["electron"]
},
"rules": {
"no-console": "error",
"no-magic-numbers": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/typedef": [
"error",
{
"arrowParameter": true,
"memberVariableDeclaration": true,
"parameter": true,
"propertyDeclaration": true
}
],
"@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/interface-name-prefix": ["error", { "prefixWithI": "always" }],
"@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 }]
}
},
{
"files": ["**/*.d.ts"],
"rules": {
"import/no-default-export": "off"
}
},
{
"files": ["src/renderer/**/*.*"],
"parserOptions": {
"sourceType": "module"
}
}
]
}