RenaiApp/.eslintrc.json

137 lines
3.9 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",
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": [
"src/**/*.spec.*",
"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",
"@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 }],
"@typescript-eslint/member-ordering": "error",
"@typescript-eslint/array-type": ["error", { "default": "array-simple" }]
}
},
{
"files": ["**/*.{spec,mock}.*"],
"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"
}
},
{
"files": ["**/*.d.ts"],
"rules": {
"import/no-default-export": "off"
}
}
]
}