moisseev 5 months ago
parent
commit
6e93ef9586
4 changed files with 37 additions and 30 deletions
  1. 33
    27
      .eslintrc.json
  2. 1
    1
      interface/js/app/selectors.js
  3. 2
    2
      interface/js/main.js
  4. 1
    0
      package.json

+ 33
- 27
.eslintrc.json View File

"browser": true, "browser": true,
"es6": true "es6": true
}, },
"extends": "eslint:all",
"extends": [
"eslint:all",
"plugin:@stylistic/all-extends"
],
"globals": { "globals": {
"define": false "define": false
}, },
"plugins": [
"@stylistic"
],
"rules": { "rules": {
"array-bracket-newline": ["error", "consistent"],
"array-element-newline": "off",
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"camelcase": "off", "camelcase": "off",
"capitalized-comments": "off", "capitalized-comments": "off",
"comma-dangle": ["error", "only-multiline"],
"curly": ["error", "multi-line"], "curly": ["error", "multi-line"],
"dot-location": ["error", "property"],
"func-names": "off", "func-names": "off",
// "func-style": ["error", "declaration"], // "func-style": ["error", "declaration"],
"function-call-argument-newline": "off",
"id-length": ["error", { "min": 1 }], "id-length": ["error", { "min": 1 }],
"indent": ["error", 4, { "SwitchCase": 1 }],
// "max-len": ["error", { "code": 120 }],
// "key-spacing": ["error", {
// "@stylistic/key-spacing": ["error", {
// "singleLine": { "afterColon": false } // "singleLine": { "afterColon": false }
// }], // }],
"line-comment-position": "off", "line-comment-position": "off",
"logical-assignment-operators": ["error", "never"], "logical-assignment-operators": ["error", "never"],
"max-params": ["warn", 6], "max-params": ["warn", 6],
"max-statements": ["warn", 55], "max-statements": ["warn", 55],
"max-statements-per-line": ["error", { "max": 2 }],
"multiline-comment-style": "off", "multiline-comment-style": "off",
"multiline-ternary": ["error", "always-multiline"],
"newline-per-chained-call": ["error", { "ignoreChainWithDepth": 5 }],
"no-continue": "off", "no-continue": "off",
"no-extra-parens": ["error", "functions"],
"no-implicit-globals": "off",
"no-inline-comments": "off", "no-inline-comments": "off",
"no-magic-numbers": "off", "no-magic-numbers": "off",
"no-negated-condition": "off", "no-negated-condition": "off",
"no-plusplus": "off", "no-plusplus": "off",
"no-ternary": "off", "no-ternary": "off",
"object-curly-newline": ["error", { "consistent": true }],
"object-property-newline": ["error", { "allowAllPropertiesOnSameLine": true }],
"object-shorthand": "off", "object-shorthand": "off",
"one-var": "off", "one-var": "off",
"padded-blocks": "off",
"prefer-arrow-callback": "off", "prefer-arrow-callback": "off",
"prefer-destructuring": "off", "prefer-destructuring": "off",
"prefer-named-capture-group": "off", "prefer-named-capture-group": "off",
"prefer-object-has-own": "off", "prefer-object-has-own": "off",
"prefer-spread": "off", "prefer-spread": "off",
"prefer-template": "off", "prefer-template": "off",
"quote-props" : ["error", "consistent-as-needed"],
"quotes": ["error", "double", { "avoidEscape": true }],
"require-jsdoc": "off",
"require-unicode-regexp": "off", "require-unicode-regexp": "off",
"space-before-function-paren": ["error", {

"@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/indent": ["error", 4, { "SwitchCase": 1 }],
"@stylistic/max-len": ["error", { "code": 120 }],
"@stylistic/max-statements-per-line": ["error", { "max": 2 }],
"@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": "off",
"@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", "anonymous": "always",
"named": "never" "named": "never"
}], }],
"vars-on-top": "off",




// Temporarily disabled rules // Temporarily disabled rules
"func-style": "off", "func-style": "off",
"function-paren-newline": "off",
"key-spacing": "off",
"max-len": "off",
"max-lines": "off", "max-lines": "off",
"max-lines-per-function": "off", "max-lines-per-function": "off",
"no-invalid-this": "off", "no-invalid-this": "off",
"prefer-exponentiation-operator": "off", "prefer-exponentiation-operator": "off",
"sort-keys": "off", "sort-keys": "off",
"sort-vars": "off"
"sort-vars": "off",

"@stylistic/function-paren-newline": "off",
"@stylistic/key-spacing": "off",
"@stylistic/max-len": "off",
"@stylistic/one-var-declaration-per-line": "off"
} }
} }

+ 1
- 1
interface/js/app/selectors.js View File

enable_disable_check_btn(); enable_disable_check_btn();
} }
const selector = $("#selectorsSelArea").val(); const selector = $("#selectorsSelArea").val();
if (selector.length && !rspamd.read_only ) {
if (selector.length && !rspamd.read_only) {
rspamd.query("plugins/selectors/check_selector?selector=" + encodeURIComponent(selector), { rspamd.query("plugins/selectors/check_selector?selector=" + encodeURIComponent(selector), {
method: "GET", method: "GET",
success: function (json) { success: function (json) {

+ 2
- 2
interface/js/main.js View File

shim: { shim: {
app: {deps:["jquery"]}, app: {deps:["jquery"]},
codejar: {exports: "CodeJar", deps:["linenumbers"]}, codejar: {exports: "CodeJar", deps:["linenumbers"]},
bootstrap: {exports:"bootstrap", deps:["jquery"]}, // Popovers require jQuery
bootstrap: {exports:"bootstrap", deps:["jquery"]}, // Popovers require jQuery
d3: {exports:"d3"}, d3: {exports:"d3"},
d3evolution: {exports:"D3Evolution", deps:["d3.global", "jquery"]}, d3evolution: {exports:"D3Evolution", deps:["d3.global", "jquery"]},
d3pie: {exports:"D3Pie", deps:["d3.global", "jquery"]}, d3pie: {exports:"D3Pie", deps:["d3.global", "jquery"]},
// Load main UI // Load main UI
require(["app/rspamd"], (rspamd) => { require(["app/rspamd"], (rspamd) => {
"use strict"; "use strict";
rspamd.connect()
rspamd.connect();
}); });

+ 1
- 0
package.json View File

{ {
"devDependencies": { "devDependencies": {
"eslint": "*", "eslint": "*",
"@stylistic/eslint-plugin": "*",
"stylelint": ">=13.6.0", "stylelint": ">=13.6.0",
"stylelint-config-standard": "*", "stylelint-config-standard": "*",
"postcss-html": "*" "postcss-html": "*"

Loading…
Cancel
Save