aboutsummaryrefslogtreecommitdiffstats
path: root/eslint.config.mjs
diff options
context:
space:
mode:
authormoisseev <moiseev@mezonplus.ru>2024-07-18 17:30:45 +0300
committermoisseev <moiseev@mezonplus.ru>2024-07-18 17:30:45 +0300
commitb4c2c5c07ca44a28a59363f6804bc28378d50c88 (patch)
tree59f7f17ecb6cdf06c8e04d3393d6d239b6862c6f /eslint.config.mjs
parentcc32ef81407e0b43751d914b19ea1f6da07781b4 (diff)
downloadrspamd-b4c2c5c07ca44a28a59363f6804bc28378d50c88.tar.gz
rspamd-b4c2c5c07ca44a28a59363f6804bc28378d50c88.zip
[Test] Migrate ESLint to 9.7.0
Diffstat (limited to 'eslint.config.mjs')
-rw-r--r--eslint.config.mjs84
1 files changed, 84 insertions, 0 deletions
diff --git a/eslint.config.mjs b/eslint.config.mjs
new file mode 100644
index 000000000..2f256afcb
--- /dev/null
+++ b/eslint.config.mjs
@@ -0,0 +1,84 @@
+import globals from "globals";
+import js from "@eslint/js";
+import stylistic from "@stylistic/eslint-plugin";
+
+export default [
+ js.configs.all,
+ stylistic.configs["all-flat"],
+ {ignores: ["interface/js/lib/"]},
+ {
+ languageOptions: {
+ ecmaVersion: 2016,
+ globals: {
+ ...globals.browser,
+ define: false,
+ },
+ sourceType: "script",
+ },
+ plugins: {
+ "@stylistic": stylistic,
+ },
+ rules: {
+ "@stylistic/array-bracket-newline": ["error", "consistent"],
+ "@stylistic/array-element-newline": "off",
+ "@stylistic/brace-style": ["error", "1tbs", {allowSingleLine: true}],
+ "@stylistic/comma-dangle": ["error", "only-multiline"],
+ "@stylistic/dot-location": ["error", "property"],
+ "@stylistic/function-call-argument-newline": "off",
+ "@stylistic/function-paren-newline": "off",
+ "@stylistic/indent-binary-ops": "off",
+ "@stylistic/max-len": ["error", {code: 128}],
+ "@stylistic/max-statements-per-line": ["error", {max: 2}],
+ "@stylistic/multiline-comment-style": "off",
+ "@stylistic/multiline-ternary": ["error", "always-multiline"],
+ "@stylistic/newline-per-chained-call": ["error", {ignoreChainWithDepth: 5}],
+ "@stylistic/no-extra-parens": ["error", "functions"],
+ "@stylistic/object-property-newline": ["error", {allowAllPropertiesOnSameLine: true}],
+ "@stylistic/padded-blocks": ["error", "never"],
+ "@stylistic/quote-props": ["error", "consistent-as-needed"],
+ "@stylistic/quotes": ["error", "double", {avoidEscape: true}],
+ "@stylistic/semi": ["error", "always"],
+ "@stylistic/space-before-function-paren": ["error", {
+ anonymous: "always",
+ named: "never",
+ }],
+
+ "camelcase": "off",
+ "capitalized-comments": "off",
+ "curly": ["error", "multi-line"],
+ "func-names": "off",
+ "func-style": ["error", "declaration"],
+ "id-length": ["error", {min: 1}],
+ "line-comment-position": "off",
+ "logical-assignment-operators": ["error", "never"],
+ "max-lines": "off",
+ "max-lines-per-function": "off",
+ "max-params": ["warn", 6],
+ "max-statements": ["warn", 55],
+ "multiline-comment-style": "off",
+ "no-continue": "off",
+ "no-inline-comments": "off",
+ "no-invalid-this": "off",
+ "no-magic-numbers": "off",
+ "no-negated-condition": "off",
+ "no-plusplus": "off",
+ "no-ternary": "off",
+ "no-unused-vars": ["error", {caughtErrors: "none"}],
+ "object-shorthand": "off",
+ "one-var": ["error", {initialized: "never"}],
+ "prefer-named-capture-group": "off",
+ "prefer-object-has-own": "off",
+ "prefer-spread": "off",
+ "prefer-template": "off",
+ "require-unicode-regexp": "off",
+ "sort-keys": "off",
+ },
+ },
+ {
+ files: ["**/*.mjs"],
+ languageOptions: {ecmaVersion: 2020, sourceType: "module"},
+ rules: {
+ "sort-keys": "error",
+ },
+ },
+];