formwork/panel/eslint.config.js

57 lines
1.6 KiB
JavaScript
Raw Normal View History

2023-12-03 15:08:58 +01:00
import eslintConfigPrettier from "eslint-config-prettier";
2023-12-09 23:03:58 +01:00
import globals from "globals";
import js from "@eslint/js";
2024-02-24 17:29:32 +01:00
import tseslint from "typescript-eslint";
2023-05-20 17:26:37 +02:00
export default [
js.configs.recommended,
2024-02-24 17:29:32 +01:00
...tseslint.configs.recommended,
2023-05-20 17:26:37 +02:00
{
2023-12-03 15:08:58 +01:00
languageOptions: {
2023-12-09 23:03:58 +01:00
ecmaVersion: 13,
2023-12-03 15:08:58 +01:00
globals: {
2023-05-20 17:26:37 +02:00
...globals.browser,
2023-12-03 15:08:58 +01:00
Formwork: "readonly",
2023-05-20 17:26:37 +02:00
},
2023-12-03 15:08:58 +01:00
sourceType: "module",
2023-05-20 17:26:37 +02:00
},
2024-02-19 22:49:51 +01:00
ignores: ["*.min.js"],
2023-12-03 15:08:58 +01:00
rules: {
"arrow-body-style": ["error", "as-needed"],
curly: ["error", "all"],
eqeqeq: ["error", "always"],
2023-12-09 23:03:58 +01:00
"no-console": ["warn"],
2023-12-03 15:08:58 +01:00
"no-else-return": ["error"],
"no-lonely-if": ["error"],
"no-unneeded-ternary": ["error"],
"no-var": ["error"],
"one-var": [
"error",
{
initialized: "never",
uninitialized: "always",
},
],
"operator-assignment": ["error"],
"prefer-arrow-callback": ["error"],
"prefer-const": ["error"],
"prefer-template": ["error"],
2023-12-09 23:03:58 +01:00
"sort-imports": [
"warn",
{
ignoreCase: true,
allowSeparatedGroups: true,
},
],
2024-02-24 17:29:32 +01:00
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/typedef": [
"warn",
{
parameter: true,
},
],
2023-05-20 17:26:37 +02:00
},
2023-12-03 15:08:58 +01:00
},
eslintConfigPrettier,
2023-05-20 17:26:37 +02:00
];