diff --git a/UI/css/system/ledgersmb-common.css b/UI/css/system/ledgersmb-common.css index 934b7eb1a2..8d0947a48b 100644 --- a/UI/css/system/ledgersmb-common.css +++ b/UI/css/system/ledgersmb-common.css @@ -257,10 +257,7 @@ body.menu, color: var(--listtop-clr); font-size: var(--listtop-font-size); font-weight: bold; - padding-bottom: 0.1em; - padding-left: 1ex; - padding-right: 1ex; - padding-top: 0.1em; + padding: 0.1em 1ex; } .listheading, @@ -269,10 +266,7 @@ thead th { color: var(--listheading-clr); font-size: var(--listheading-font-size); font-weight: bold; - padding-bottom: 0.1em; - padding-left: 1ex; - padding-right: 1ex; - padding-top: 0.1em; + padding: 0.1em 1ex; } thead a:link { diff --git a/UI/eslint.config.mjs b/UI/eslint.config.mjs new file mode 100644 index 0000000000..99a3b9e1a4 --- /dev/null +++ b/UI/eslint.config.mjs @@ -0,0 +1,255 @@ +/** @format */ + +import globals from "globals"; +import babelParser from "@babel/eslint-parser"; +import compatPlugin from "eslint-plugin-compat"; +import eslintConfigESLint from "eslint-config-eslint"; +import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended"; +import eslintImportX from "eslint-plugin-import-x"; +import js from "@eslint/js"; +import jest from "eslint-plugin-jest"; +import packageJson from "eslint-plugin-package-json/configs/recommended"; +import pluginVue from "eslint-plugin-vue"; + +export default [ + // Global config + { + ignores: ["{js/**/*,node_modules/**/*,__mocks__/**/*}"] + }, + + js.configs.recommended, + eslintPluginPrettierRecommended, + ...pluginVue.configs["flat/recommended"], + compatPlugin.configs["flat/recommended"], + + // Config files + { + ...eslintConfigESLint, + files: ["**/*.config.m?js"] + }, + // JavaScript files + { + files: ["**/*.js"], + ignores: ["**/*.spec.js", "**/*.config.m?js"], + languageOptions: { + globals: { + ...globals.amd, + ...globals.node + }, + ecmaVersion: 6, + sourceType: "module", + parser: babelParser, + parserOptions: { + requireConfigFile: false, + babelOptions: { + babelrc: false, + configFile: false, + presets: ["@babel/preset-env"] + }, + templateSettings: { + evaluate: ["[%", "%]"], + interpolate: ["[%", "%]"], + escape: ["[%", "%]"] + } + } + }, + plugins: { + "import-x": eslintImportX + }, + settings: { + "import-x/resolver": "webpack", + "import-x/parsers": { + "@babel/eslint-parser": [".js"] + } + }, + rules: { + ...js.configs.recommended.rules, + camelcase: "error", + "compat/compat": "warn", + "consistent-return": "error", + curly: ["error", "all"], + "dot-notation": "error", + eqeqeq: "error", + "func-names": 0, + "global-require": "error", + "guard-for-in": "error", + "import-x/export": "error", + "import-x/no-unresolved": "error", + "import-x/named": "error", + "import-x/namespace": "error", + "import-x/default": "error", + "import-x/no-absolute-path": "error", + "import-x/no-dynamic-require": "error", + "import-x/no-named-as-default": "warn", + "import-x/no-named-as-default-member": "warn", + "import-x/no-duplicates": "warn", + "new-cap": 0, + "no-alert": "error", + "no-continue": 0, + "no-else-return": "error", + "no-eval": "error", + "no-lonely-if": "error", + "no-multi-assign": "error", + "no-multi-spaces": "off", + "no-new-object": "error", + "no-param-reassign": "error", + "no-plusplus": 0, + "no-restricted-globals": "error", + "no-shadow": "error", + "no-template-curly-in-string": "error", + "no-undef": "error", + "no-underscore-dangle": 0, + "no-unused-expressions": "error", + "no-unused-vars": "error", + "no-use-before-define": "error", + "no-useless-escape": "error", + "no-useless-return": "error", + "one-var": [ + "error", + { + initialized: "never", + uninitialized: "consecutive" + } + ], + radix: "error", + "spaced-comment": [ + "error", + "always", + { + block: { + balanced: true + } + } + ], + "vars-on-top": "off", + yoda: "error", + "no-restricted-syntax": ["error", "SequenceExpression"] + } + }, + // Package.json + { + files: ["package.json"], + ...packageJson, + rules: { + ...packageJson.rules, + "package-json/order-properties": [ + "error", + { + order: [ + "name", + "version", + "lockfileVersion", + "private", + "publishConfig", + "description", + "keywords", + "author", + "license", + "maintainers", + "contributors", + "bundlesize", + "main", + "browser", + "_browserslist-comment", + "browserslist", + "bugs", + "repository", + "files", + "bin", + "directories", + "man", + "config", + "dependencies", + "devDependencies", + "peerDependencies", + "optionalDependencies", + "bundledDependencies", + "homepage", + "scripts", + "engines", + "os", + "cpu", + "babel", + "eslintConfig", + "prettier", + "stylelint", + "lint-staged" + ] + } + ], + "package-json/sort-collections": [ + "error", + ["scripts", "devDependencies", "dependencies", "config"] + ], + "prettier/prettier": [ + "error", + { + tabWidth: 2 + } + ] + } + }, + // Test files + { + files: [ + "**/__tests__/**/*.[jt]s?(x)", + "**/?(*.)+(spec|test).[tj]s?(x)" + ], + ...jest.configs["flat/recommended"], + rules: { + ...jest.configs["flat/recommended"].rules, + "jest/prefer-expect-assertions": "off", + "jest/no-commented-out-tests": "off", + "jest/no-disabled-tests": "warn", + "jest/no-focused-tests": "error", + "jest/no-identical-title": "error", + "jest/prefer-to-have-length": "warn", + "jest/valid-expect": "error", + "no-console": "off", + camelcase: "off" + } + }, + // Vue files + { + files: ["src/**/*.vue"], + rules: { + "vue/attribute-hyphenation": "off", + "vue/block-order": [ + "error", + { + order: [ + "script:not([setup])", + "script[setup]", + "template", + "style:not([scoped])", + "style[scoped]" + ] + } + ], + "vue/first-attribute-linebreak": "off", + "vue/html-closing-bracket-newline": "off", + "vue/html-indent": ["error", 4], + "vue/max-attributes-per-line": [ + "error", + { + singleline: 3, + multiline: 3 + } + ], + "vue/multi-word-component-names": "off", + "vue/multiline-html-element-content-newline": "off", + "vue/no-setup-props-reactivity-loss": "off", + "vue/require-prop-types": "off", + "vue/singleline-html-element-content-newline": [ + "error", + { + ignoreWhenNoAttributes: true, + ignoreWhenEmpty: true, + ignores: ["pre", "textarea", "template"], + externalIgnores: [] + } + ], + "vue/v-on-event-hyphenation": "off" + } + } +]; diff --git a/UI/jest.config.js b/UI/jest.config.js index 8cf271da73..79671eb32a 100644 --- a/UI/jest.config.js +++ b/UI/jest.config.js @@ -23,10 +23,7 @@ module.exports = { collectCoverage: false, // An array of glob patterns indicating a set of files for which coverage information should be collected - collectCoverageFrom: [ - "{src,js-src}/**/*.{js,vue}", - "!**/webpack*.js" - ], + collectCoverageFrom: ["{src,js-src}/**/*.{js,vue}", "!**/webpack*.js"], // The directory where Jest should output its coverage files coverageDirectory: "coverage", @@ -109,11 +106,7 @@ module.exports = { moduleDirectories: ["node_modules"], // An array of file extensions your modules use - moduleFileExtensions: [ - "js", - "json", - "vue" - ], + moduleFileExtensions: ["js", "json", "vue"], // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module moduleNameMapper: { diff --git a/UI/js-src/lsmb/DateTextBox.js b/UI/js-src/lsmb/DateTextBox.js index 9c0b21e0b7..00b1e4752b 100644 --- a/UI/js-src/lsmb/DateTextBox.js +++ b/UI/js-src/lsmb/DateTextBox.js @@ -22,7 +22,6 @@ define([ this._formattedValue = ""; } - /* eslint no-param-reassign:0 */ /* Provide default 'old code' doesn't include in its templates */ if (!params.constraints) { params.constraints = {}; diff --git a/UI/js-src/lsmb/Form.js b/UI/js-src/lsmb/Form.js index 58619cabd7..4a871ad763 100644 --- a/UI/js-src/lsmb/Form.js +++ b/UI/js-src/lsmb/Form.js @@ -13,7 +13,8 @@ define([ clickedAction: null, onSubmit: function (evt) { event.stop(evt); - this.clickedAction = evt.submitter; /* ought to be the same as this.domNode.__action */ + this.clickedAction = + evt.submitter; /* ought to be the same as this.domNode.__action */ this.submit(); }, submit: function () { @@ -25,7 +26,8 @@ define([ const options = { handleAs: "text" }; const method = typeof this.method === "undefined" ? "GET" : this.method; - let url = this.action; /* relative; this.domNode.action is absolute */ + let url = + this.action; /* relative; this.domNode.action is absolute */ options.doing = widget["data-lsmb-doing"]; options.done = widget["data-lsmb-done"]; diff --git a/UI/js-src/lsmb/JumpScreenButton.js b/UI/js-src/lsmb/JumpScreenButton.js index 0b0936ed4f..cc1c14b9f3 100644 --- a/UI/js-src/lsmb/JumpScreenButton.js +++ b/UI/js-src/lsmb/JumpScreenButton.js @@ -1,9 +1,6 @@ /** @format */ -define(["dojo/_base/declare", "dijit/form/Button"], function ( - declare, - button -) { +define(["dojo/_base/declare", "dijit/form/Button"], function (declare, button) { return declare("lsmb/payments/JumpScreenButton", [button], { url: null, onClick: function () { diff --git a/UI/js-src/lsmb/PrintButton.js b/UI/js-src/lsmb/PrintButton.js index 2ee7db69bc..26694b5e85 100644 --- a/UI/js-src/lsmb/PrintButton.js +++ b/UI/js-src/lsmb/PrintButton.js @@ -31,8 +31,10 @@ define([ __action: this.get("value"), type: f.type.value, id: f.id.value, + // eslint-disable-next-line camelcase workflow_id: f.workflow_id ? f.workflow_id.value : "", formname: f.formname.value, + // eslint-disable-next-line camelcase language_code: f.language_code.value, media: "screen", format: f.format.value @@ -86,10 +88,9 @@ define([ } } else { window.__lsmbReportError(r); - }; + } }); - } - else { + } else { this.inherited(arguments); } } diff --git a/UI/js-src/lsmb/SetupLoginButton.js b/UI/js-src/lsmb/SetupLoginButton.js index 6fc7e3683a..d7ad1d0fec 100644 --- a/UI/js-src/lsmb/SetupLoginButton.js +++ b/UI/js-src/lsmb/SetupLoginButton.js @@ -30,7 +30,8 @@ define([ "&database=" + company + "&csrf_token=" + - token); + token + ); }, function (err) { var status = err.response.status; diff --git a/UI/js-src/lsmb/ToggleIncludeButton.js b/UI/js-src/lsmb/ToggleIncludeButton.js index f237c18810..7d7dff7f26 100644 --- a/UI/js-src/lsmb/ToggleIncludeButton.js +++ b/UI/js-src/lsmb/ToggleIncludeButton.js @@ -5,12 +5,12 @@ define(["dojo/_base/declare", "dijit/form/Button"], function (declare, button) { return declare("lsmb/payments/ToggleIncludeButton", [button], { query: null, onClick: function () { - dojo.query(this.query, this.valueNode.form).forEach(function ( - node - ) { - var n = dijit.getEnclosingWidget(node); - n.set("checked", !n.get("checked")); - }); + dojo.query(this.query, this.valueNode.form).forEach( + function (node) { + var n = dijit.getEnclosingWidget(node); + n.set("checked", !n.get("checked")); + } + ); } }); }); diff --git a/UI/js-src/lsmb/parts/PartDescription.js b/UI/js-src/lsmb/parts/PartDescription.js index 8c1f555189..4ab69c56ab 100644 --- a/UI/js-src/lsmb/parts/PartDescription.js +++ b/UI/js-src/lsmb/parts/PartDescription.js @@ -1,7 +1,5 @@ /** @format */ -/* eslint no-template-curly-in-string:0 */ - define([ "dijit/form/TextBox", "dijit/_HasDropDown", @@ -30,6 +28,7 @@ define([ channel: null, height: null, store: partRestStore, + // eslint-disable-next-line no-template-curly-in-string queryExpr: "*${0}*", autoComplete: false, highlightMatch: "all", diff --git a/UI/js-src/lsmb/payments/PostPrintButton.js b/UI/js-src/lsmb/payments/PostPrintButton.js index e97ccf710b..9084c77d53 100644 --- a/UI/js-src/lsmb/payments/PostPrintButton.js +++ b/UI/js-src/lsmb/payments/PostPrintButton.js @@ -15,7 +15,7 @@ define([ let base = window.location.pathname.replace(/[^/]*$/, ""); let r = await fetch(base + domattr.get(f, "action"), { method: "POST", - body: domform.toQuery(f), + body: domform.toQuery(f) }); if (r.ok) { diff --git a/UI/js-src/lsmb/reports/ComparisonSelector.js b/UI/js-src/lsmb/reports/ComparisonSelector.js index 842ea8eca1..f5598b30fe 100644 --- a/UI/js-src/lsmb/reports/ComparisonSelector.js +++ b/UI/js-src/lsmb/reports/ComparisonSelector.js @@ -35,26 +35,26 @@ define([ this.mode = value; if (value === "by-dates") { - display = this._comparison_periods.get("value"); + display = this.comparisonPeriods.get("value"); } } - this._update_display(display); + this._updateDisplay(display); }) ); }, startup: function () { this.inherited(arguments); - this._comparison_periods = registry.byId("comparison-periods"); + this.comparisonPeriods = registry.byId("comparison-periods"); this.own( - on(this._comparison_periods, "change", () => { - this._update_display( - this._comparison_periods.get("value") + on(this.comparisonPeriods, "change", () => { + this._updateDisplay( + this.comparisonPeriods.get("value") ); }) ); - this._update_display(""); + this._updateDisplay(""); }, - _update_display: function (count) { + _updateDisplay: function (count) { if (count === "" || this.mode === "by-periods") { domStyle.set( dom.byId("comparison_dates"), diff --git a/UI/js-src/lsmb/reports/PeriodSelector.js b/UI/js-src/lsmb/reports/PeriodSelector.js index 50bc5975b6..6ec4c3a853 100644 --- a/UI/js-src/lsmb/reports/PeriodSelector.js +++ b/UI/js-src/lsmb/reports/PeriodSelector.js @@ -25,12 +25,12 @@ define([ var self = this; this.inherited(arguments); - this._by_dates = registry.byId("comparison_by_dates"); - this._by_periods = registry.byId("comparison_by_periods"); + this.byDates = registry.byId("comparison_by_dates"); + this.byPeriods = registry.byId("comparison_by_periods"); this.own( - on(this._by_dates, "change", function (newvalue) { + on(this.byDates, "change", function (newvalue) { if (newvalue) { - self._update_display(); + self._updateDisplay(); topic.publish( self.channel, "changed-period-type", @@ -40,9 +40,9 @@ define([ }) ); this.own( - on(this._by_periods, "change", function (newvalue) { + on(this.byPeriods, "change", function (newvalue) { if (newvalue) { - self._update_display(); + self._updateDisplay(); topic.publish( self.channel, "changed-period-type", @@ -51,18 +51,18 @@ define([ } }) ); - this._update_display(); + this._updateDisplay(); }, - _update_display: function () { + _updateDisplay: function () { domStyle.set( dom.byId("date_dates_id"), "display", - this._by_dates.get("checked") ? "" : "none" + this.byDates.get("checked") ? "" : "none" ); domStyle.set( dom.byId("date_period_id"), "display", - this._by_periods.get("checked") ? "" : "none" + this.byPeriods.get("checked") ? "" : "none" ); } }); diff --git a/UI/js-src/lsmb/users/ChangePassword.js b/UI/js-src/lsmb/users/ChangePassword.js index f1741761da..4c00e66055 100644 --- a/UI/js-src/lsmb/users/ChangePassword.js +++ b/UI/js-src/lsmb/users/ChangePassword.js @@ -1,4 +1,5 @@ /** @format */ +/* eslint-disable camelcase */ define([ "dojo/_base/declare", @@ -105,6 +106,7 @@ define([ nonWords: /\W/.test(pass) }; var variationCount = 0; + // eslint-disable-next-line guard-for-in for (var check in variations) { variationCount += variations[check] === true ? 1 : 0; } @@ -135,7 +137,10 @@ define([ return; } if (newPassword !== confirmedPassword) { - this.setFeedback(false, this.text("Confirmation did not match")); + this.setFeedback( + false, + this.text("Confirmation did not match") + ); return; } r("user.pl", { diff --git a/UI/js-src/lsmb/webpack.loaderConfig.js b/UI/js-src/lsmb/webpack.loaderConfig.js index a6e7f5a8e5..1607b38579 100644 --- a/UI/js-src/lsmb/webpack.loaderConfig.js +++ b/UI/js-src/lsmb/webpack.loaderConfig.js @@ -17,7 +17,7 @@ */ const path = require("path"); -function getConfig( /* env */ ) { +function getConfig(/* env */) { // env is set by the 'buildEnvironment' and/or 'environment' plugin options // (see webpack.config.js), // or by the code at the end of this file if using without webpack @@ -84,5 +84,5 @@ if (typeof module !== "undefined") { module.exports = getConfig; } else { // No webpack. This script was loaded by page via script tag, so load Dojo from CDN - getConfig({ dojoRoot: "//ajax.googleapis.com/ajax/libs/dojo/1.16.0" }); + getConfig(/* { dojoRoot: "//ajax.googleapis.com/ajax/libs/dojo/1.16.0" } */); } diff --git a/UI/js-src/webpack-compile-markdown.js b/UI/js-src/webpack-compile-markdown.js index 4e309eea13..b4fb610f4a 100644 --- a/UI/js-src/webpack-compile-markdown.js +++ b/UI/js-src/webpack-compile-markdown.js @@ -1,7 +1,6 @@ /** @format */ const MarkdownInclude = require("markdown-include"); - const browserslist = require("browserslist"); const lite = require("caniuse-lite"); const packageJson = require("../package.json"); @@ -65,8 +64,7 @@ MarkdownInclude.registerPlugin({ month.substr(month.length - 2); earliest[category][browser].year = year; earliest[category][browser].time = time; - } - else { + } else { earliest[category][browser].year = ""; } } @@ -77,22 +75,13 @@ MarkdownInclude.registerPlugin({ /* eslint guard-for-in:0 */ for (const c of ["Desktop", "Mobile"]) { markdown += "\n### " + c + "\n\n"; - markdown += - "| " + - "Browser Name".padEnd(20, " ") + - "| " + - "Earliest".padEnd(9, " ") + - "| " + - "Versions".padEnd(44, " ") + - "|\n"; - markdown += - "| " + - "---".padEnd(19, "-") + - " |:" + - "---".padEnd(8, "-") + - ":|:" + - "---".padEnd(43, "-") + - " |\n"; + markdown += "| " + "Browser Name".padEnd(20, " "); + markdown += "| " + "Earliest".padEnd(9, " "); + markdown += "| " + "Versions".padEnd(44, " ") + "|\n"; + markdown += "| " + "---".padEnd(19, "-"); + markdown += "| " + "---".padEnd(8, "-"); + markdown += "| " + "---".padEnd(43, "-") + "|\n"; + for (var browser in earliest[c]) { var entry = earliest[c][browser]; let versions = []; @@ -102,6 +91,7 @@ MarkdownInclude.registerPlugin({ let vs = entry.versions.sort((a, b) => a.localeCompare(b, undefined, { numeric: true }) ); + var v; /* eslint no-cond-assign:0 */ while ((v = vs.shift()) || v1) { @@ -138,7 +128,7 @@ MarkdownInclude.registerPlugin({ v2 = ""; } var l = ""; - let line = + var line = "| " + entry.name.padEnd(19, " ") + " | " + @@ -155,12 +145,8 @@ MarkdownInclude.registerPlugin({ } } markdown += line + l.padEnd(43, " ") + " |\n"; - line = - "| " + - "".padEnd(20, " ") + - "| " + - "".padEnd(9, " ") + - "| "; + line = "| " + "".padEnd(20, " "); + line += "| " + "".padEnd(9, " ") + "| "; l = ""; } } @@ -177,21 +163,26 @@ MarkdownInclude.registerPlugin({ }); // do something with compiled files -var tmp = require('tmp'); -var fs = require('fs'); +var tmp = require("tmp"); +var fs = require("fs"); tmp.file( { - prefix: 'markdown-', - postfix: '.json', + prefix: "markdown-", + postfix: ".json", keep: false }, function (err, path) { - if (err) {throw err;} - fs.writeFileSync(path, `{ - "build" : "../README.md", - "files" : ["../doc/sources/_README.md"] - }`); + if (err) { + throw err; + } + fs.writeFileSync( + path, + `{ + "build" : "../README.md", + "files" : ["../doc/sources/_README.md"] + }` + ); MarkdownInclude.compileFiles(path); } ); diff --git a/UI/package.json b/UI/package.json index 21c894ff96..74927b7e19 100644 --- a/UI/package.json +++ b/UI/package.json @@ -38,7 +38,10 @@ "supports es6-module and supports async-functions and supports xhr2 and supports bloburls and supports css-variables and supports css3-boxsizing and supports border-radius and supports fetch and supports classlist and supports multicolumn and not edge <= 18 and supports css-display-contents and supports same-site-cookie-attribute" ], "bugs": "https://github.com/ledgersmb/LedgerSMB/issues", - "repository": "ledgersmb/LedgerSMB", + "repository": { + "type": "git", + "url": "https://github.com/ledgersmb/LedgerSMB" + }, "dependencies": { "content-disposition": "0.5.4", "dijit": "1.17.3", @@ -49,13 +52,14 @@ "tapable": "2.2.1", "vue": "3.4.27", "vue-i18n": "9.13.1", - "vue-router": "^4.3.2" + "vue-router": "4.3.2" }, "devDependencies": { "@babel/core": "7.24.6", "@babel/eslint-parser": "7.24.6", "@babel/plugin-proposal-object-rest-spread": "7.20.7", "@babel/preset-env": "7.24.6", + "@eslint/js": "9.4.0", "@pinia/testing": "0.1.3", "@redocly/cli": "1.14.0", "@vue/test-utils": "2.4.6", @@ -76,25 +80,21 @@ "dojo-util": "1.17.3", "dojo-webpack-plugin": "3.0.6", "ejs-loader": "0.5.0", - "eslint": "8.57.0", + "eslint": "9.4.0", "eslint-config-eslint": "10.0.0", "eslint-config-prettier": "9.1.0", "eslint-import-resolver-webpack": "0.13.8", - "eslint-plugin-amd": "1.1.0", - "eslint-plugin-compat": "4.2.0", - "eslint-plugin-import": "2.29.1", + "eslint-plugin-compat": "5.0.0-2", + "eslint-plugin-import-x": "0.5.1", "eslint-plugin-jest": "28.5.0", - "eslint-plugin-jsdoc": "48.2.7", "eslint-plugin-json": "4.0.0", "eslint-plugin-n": "17.7.0", "eslint-plugin-package-json": "0.14.0", "eslint-plugin-prettier": "5.1.3", - "eslint-plugin-promise": "6.2.0", - "eslint-plugin-snakecasejs": "2.2.0", - "eslint-plugin-sort-dojo-dependency": "0.0.1", "eslint-plugin-vue": "9.26.0", "eslint-webpack-plugin": "4.2.0", "flush-promises": "1.0.2", + "globals": "15.3.0", "html-webpack-plugin": "5.6.0", "http-status-codes": "2.3.0", "i18next-conv": "15.0.0", @@ -110,7 +110,7 @@ "mini-css-extract-plugin": "2.9.0", "msw": "2.3.0", "npm-run-all2": "6.2.0", - "openapi-merge-cli": "^1.3.1", + "openapi-merge-cli": "1.3.1", "path-browserify": "1.0.1", "postcss": "8.4.38", "prettier": "3.2.5", @@ -145,12 +145,12 @@ "build": "webpack --mode=production --stats errors-warnings", "build:dev": "webpack --progress --mode=development --stats errors-warnings", "lint": "yarn run lint:css && yarn run lint:js && yarn run lint:markdown && yarn run lint:vue", - "lint:css": "stylelint css/*.css", - "lint:js": "eslint --ext .js ./", - "lint:js:fix": "eslint --fix --ext .js ./", + "lint:css": "stylelint css/**/*.css", + "lint:js": "eslint {src,js-src,tests}/**/*.js", + "lint:js:fix": "eslint --fix {src,js-src,tests}/**/*.js", "lint:markdown": "markdownlint --config ../.markdownlint.json --ignore ./node_modules --ignore ./js .", - "lint:vue": "eslint --ext .vue ./", - "lint:vue:fix": "eslint --fix --ext .vue ./", + "lint:vue": "eslint src/**/*.vue", + "lint:vue:fix": "eslint --fix src/**/*.vue", "profile": "webpack --progress=profile --json > logs/stats.json", "readme": "webpack --mode production --stats errors-warnings", "serve": "webpack serve --mode development", @@ -164,238 +164,6 @@ ] ] }, - "eslintConfig": { - "settings": { - "import/resolver": "webpack" - }, - "overrides": [ - { - "extends": [ - "plugin:package-json/recommended" - ], - "files": [ - "package.json" - ], - "parser": "jsonc-eslint-parser", - "plugins": [ - "package-json" - ], - "rules": { - "package-json/sort-collections": "error", - "indent": [ - "error", - 2 - ] - } - }, - { - "files": [ - "**/__tests__/**/*.[jt]s?(x)", - "**/?(*.)+(spec|test).[tj]s?(x)" - ], - "plugins": [ - "jest" - ], - "extends": [ - "plugin:jest/recommended" - ], - "rules": { - "jest/prefer-expect-assertions": "off", - "jest/no-commented-out-tests": "off", - "no-console": "off" - } - }, - { - "files": [ - "**/*.vue" - ], - "rules": { - "vue/no-setup-props-destructure": "off" - } - } - ], - "plugins": [ - "amd", - "compat", - "import", - "jest", - "package-json", - "sort-dojo-dependency", - "vue", - "prettier" - ], - "parserOptions": { - "parser": "@babel/eslint-parser", - "ecmaVersion": 6, - "sourceType": "module", - "requireConfigFile": false, - "templateSettings": { - "evaluate": [ - "[%", - "%]" - ], - "interpolate": [ - "[%", - "%]" - ], - "escape": [ - "[%", - "%]" - ] - } - }, - "env": { - "browser": true, - "node": true, - "amd": true, - "es6": true - }, - "extends": [ - "eslint:recommended", - "plugin:import/errors", - "plugin:import/warnings", - "plugin:vue/vue3-recommended", - "prettier" - ], - "ignorePatterns": [ - "dojo/", - "dijit/", - "node_modules/", - "js/", - "**/*.po*", - "pod/**", - "!__mocks__/**" - ], - "rules": { - "compat/compat": "warn", - "consistent-return": "error", - "curly": [ - "error", - "all" - ], - "dot-notation": "error", - "eqeqeq": "error", - "func-names": 0, - "new-cap": 0, - "no-continue": 0, - "no-else-return": "error", - "no-lonely-if": "error", - "no-multi-assign": "error", - "no-multi-spaces": "off", - "no-new-object": "error", - "no-param-reassign": "error", - "no-plusplus": 0, - "no-restricted-globals": "error", - "no-shadow": "error", - "no-template-curly-in-string": "error", - "no-undef": "error", - "no-underscore-dangle": 0, - "no-unused-expressions": "error", - "no-unused-vars": "error", - "no-use-before-define": "error", - "no-useless-escape": "error", - "no-useless-return": "error", - "one-var": [ - "error", - "never" - ], - "radix": "error", - "spaced-comment": [ - "error", - "always", - { - "block": { - "balanced": true - } - } - ], - "vars-on-top": 0, - "yoda": "error", - "amd/no-unused-dependencies": "error", - "amd/obsolete-dependencies": "error", - "amd/sane-dependency-names": "error", - "jest/no-disabled-tests": "warn", - "jest/no-focused-tests": "error", - "jest/no-identical-title": "error", - "jest/prefer-to-have-length": "warn", - "jest/valid-expect": "error", - "package-json/order-properties": [ - "error", - { - "order": [ - "name", - "version", - "lockfileVersion", - "private", - "publishConfig", - "description", - "keywords", - "author", - "license", - "maintainers", - "contributors", - "bundlesize", - "main", - "browser", - "_browserslist-comment", - "browserslist", - "bugs", - "repository", - "files", - "bin", - "directories", - "man", - "config", - "dependencies", - "devDependencies", - "peerDependencies", - "optionalDependencies", - "bundledDependencies", - "homepage", - "scripts", - "engines", - "os", - "cpu", - "babel", - "eslintConfig", - "prettier", - "stylelint", - "lint-staged" - ] - } - ], - "package-json/sort-collections": [ - "error", - [ - "scripts", - "devDependencies", - "dependencies", - "config" - ] - ], - "package-json/valid-package-def": "error", - "no-restricted-syntax": [ - "error", - "SequenceExpression" - ], - "vue/attribute-hyphenation": "off", - "vue/first-attribute-linebreak": "off", - "vue/multi-word-component-names": "off", - "vue/require-prop-types": "off", - "vue/component-tags-order": [ - "error", - { - "order": [ - "script:not([setup])", - "script[setup]", - "template", - "style:not([scoped])", - "style[scoped]" - ] - } - ] - } - }, "stylelint": { "defaultSeverity": "warning", "extends": "stylelint-config-standard", diff --git a/UI/src/components/ConfigTable.machines.js b/UI/src/components/ConfigTable.machines.js index c164e520b3..31670b7a5b 100644 --- a/UI/src/components/ConfigTable.machines.js +++ b/UI/src/components/ConfigTable.machines.js @@ -11,10 +11,7 @@ import { state, transition } from "@/robot-vue"; -import { - progressNotify, - notify -} from "@/machine-helpers.js"; +import { progressNotify, notify } from "@/machine-helpers.js"; function handleError(ctx, error) { return { ...ctx, error }; diff --git a/UI/src/components/ConfigTable.vue b/UI/src/components/ConfigTable.vue index 6d5973ffa7..bb06cf9be1 100644 --- a/UI/src/components/ConfigTable.vue +++ b/UI/src/components/ConfigTable.vue @@ -1,5 +1,6 @@ -