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