1
0
mirror of https://github.com/louislam/uptime-kuma.git synced 2024-12-04 09:42:56 +02:00
uptime-kuma/.eslintrc.js

170 lines
5.1 KiB
JavaScript
Raw Normal View History

2021-07-27 19:33:44 +02:00
module.exports = {
2022-04-13 18:30:32 +02:00
ignorePatterns: [
"test/*.js",
"test/cypress",
2022-04-13 18:30:32 +02:00
"server/modules/apicache/*",
"src/util.js"
],
root: true,
2021-07-27 19:33:44 +02:00
env: {
browser: true,
commonjs: true,
2021-07-29 13:23:10 +02:00
es2020: true,
2021-07-27 19:33:44 +02:00
node: true,
},
extends: [
"eslint:recommended",
"plugin:vue/vue3-recommended",
"plugin:jsdoc/recommended-error",
2021-07-27 19:33:44 +02:00
],
parser: "vue-eslint-parser",
2021-07-27 19:33:44 +02:00
parserOptions: {
parser: "@typescript-eslint/parser",
2021-07-27 19:33:44 +02:00
sourceType: "module",
requireConfigFile: false,
2021-07-27 19:33:44 +02:00
},
plugins: [
"jsdoc",
"@typescript-eslint",
],
2021-07-27 19:33:44 +02:00
rules: {
2022-04-17 09:43:03 +02:00
"yoda": "error",
eqeqeq: [ "warn", "smart" ],
2022-04-17 09:27:35 +02:00
"linebreak-style": [ "error", "unix" ],
"camelcase": [ "warn", {
2021-09-07 16:42:46 +02:00
"properties": "never",
"ignoreImports": true
}],
2022-04-17 09:27:35 +02:00
"no-unused-vars": [ "warn", {
"args": "none"
}],
2021-07-29 13:33:45 +02:00
indent: [
"error",
4,
{
2022-04-17 09:27:35 +02:00
ignoredNodes: [ "TemplateLiteral" ],
2021-07-29 13:33:45 +02:00
SwitchCase: 1,
},
],
2022-04-21 18:06:46 +02:00
quotes: [ "error", "double" ],
2022-04-13 18:30:32 +02:00
semi: "error",
2022-04-21 18:06:46 +02:00
"vue/html-indent": [ "error", 4 ], // default: 2
2021-07-27 19:33:44 +02:00
"vue/max-attributes-per-line": "off",
"vue/singleline-html-element-content-newline": "off",
"vue/html-self-closing": "off",
"vue/require-component-is": "off", // not allow is="style" https://github.com/vuejs/eslint-plugin-vue/issues/462#issuecomment-430234675
2021-09-15 08:34:30 +02:00
"vue/attribute-hyphenation": "off", // This change noNL to "no-n-l" unexpectedly
2022-04-26 01:26:57 +02:00
"vue/multi-word-component-names": "off",
2022-04-17 09:27:35 +02:00
"no-multi-spaces": [ "error", {
2021-07-27 19:33:44 +02:00
ignoreEOLComments: true,
}],
2022-04-17 09:27:35 +02:00
"array-bracket-spacing": [ "warn", "always", {
"singleValue": true,
"objectsInArrays": false,
"arraysInArrays": false
}],
"space-before-function-paren": [ "error", {
2021-08-10 15:59:15 +02:00
"anonymous": "always",
"named": "never",
"asyncArrow": "always"
}],
2021-07-27 19:33:44 +02:00
"curly": "error",
2022-04-17 09:27:35 +02:00
"object-curly-spacing": [ "error", "always" ],
"object-curly-newline": "off",
2021-07-27 19:33:44 +02:00
"object-property-newline": "error",
"comma-spacing": "error",
"brace-style": "error",
"no-var": "error",
"key-spacing": "warn",
"keyword-spacing": "warn",
2023-09-09 20:05:52 +02:00
"space-infix-ops": "error",
2021-07-27 19:33:44 +02:00
"arrow-spacing": "warn",
2022-04-21 18:06:46 +02:00
"no-trailing-spaces": "error",
2022-04-17 09:27:35 +02:00
"no-constant-condition": [ "error", {
2021-07-30 09:13:51 +02:00
"checkLoops": false,
}],
2021-07-27 19:33:44 +02:00
"space-before-blocks": "warn",
//"no-console": "warn",
2021-07-27 19:33:44 +02:00
"no-extra-boolean-cast": "off",
2022-04-17 09:27:35 +02:00
"no-multiple-empty-lines": [ "warn", {
2021-07-27 19:33:44 +02:00
"max": 1,
"maxBOF": 0,
}],
2022-04-17 09:27:35 +02:00
"lines-between-class-members": [ "warn", "always", {
2021-07-27 19:33:44 +02:00
exceptAfterSingleLine: true,
}],
"no-unneeded-ternary": "error",
2022-04-17 09:27:35 +02:00
"array-bracket-newline": [ "error", "consistent" ],
"eol-last": [ "error", "always" ],
//"prefer-template": "error",
"template-curly-spacing": [ "warn", "never" ],
2022-04-17 09:27:35 +02:00
"comma-dangle": [ "warn", "only-multiline" ],
"no-empty": [ "error", {
2021-08-21 13:45:29 +02:00
"allowEmptyCatch": true
}],
"no-control-regex": "off",
2022-04-17 09:27:35 +02:00
"one-var": [ "error", "never" ],
"max-statements-per-line": [ "error", { "max": 1 }],
"jsdoc/check-tag-names": [
"error",
{
"definedTags": [ "link" ]
}
],
"jsdoc/no-undefined-types": "off",
"jsdoc/no-defaults": [
"error",
{ "noOptionalParamNames": true }
],
"jsdoc/require-throws": "warn",
"jsdoc/require-jsdoc": [
"error",
{
"require": {
"FunctionDeclaration": true,
"MethodDefinition": true,
}
}
],
"jsdoc/no-blank-block-descriptions": "error",
"jsdoc/require-returns-description": "warn",
"jsdoc/require-returns-check": [
"error",
{ "reportMissingReturnForUndefinedTypes": false }
],
"jsdoc/require-returns": [
"warn",
{
"forceRequireReturn": true,
"forceReturnsWithAsync": true
}
],
"jsdoc/require-param-type": "warn",
"jsdoc/require-param-description": "warn"
2021-07-27 19:33:44 +02:00
},
"overrides": [
{
2021-09-15 08:34:30 +02:00
"files": [ "src/languages/*.js", "src/icon.js" ],
"rules": {
2022-04-17 09:27:35 +02:00
"comma-dangle": [ "error", "always-multiline" ],
}
2021-10-03 12:16:55 +02:00
},
// Override for TypeScript
{
"files": [
"**/*.ts",
],
extends: [
"plugin:@typescript-eslint/recommended",
],
"rules": {
"jsdoc/require-returns-type": "off",
"jsdoc/require-param-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"prefer-const": "off",
}
}
]
};