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";
|
2023-05-20 17:26:37 +02:00
|
|
|
|
|
|
|
export default [
|
|
|
|
js.configs.recommended,
|
|
|
|
{
|
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,
|
|
|
|
},
|
|
|
|
],
|
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
|
|
|
];
|