Update JS dependencies, add new eslint rules (#24597)

- Update all JS dependencies
- Enable new eslint rules, fix issue (some via autofix)
- Fix some missed eslint rule renames from [unicorn
v25](https://github.com/sindresorhus/eslint-plugin-unicorn/releases/tag/v25.0.0)
- Tested Monaco, Katex, Swagger UI

---------

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
silverwind 2023-05-09 04:35:49 +02:00 committed by GitHub
parent 1dd83dbb91
commit d5b2bf9044
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 667 additions and 528 deletions

View File

@ -113,9 +113,9 @@ rules:
import/namespace: [0]
import/newline-after-import: [0]
import/no-absolute-path: [0]
import/no-amd: [0]
import/no-amd: [2]
import/no-anonymous-default-export: [0]
import/no-commonjs: [0]
import/no-commonjs: [2]
import/no-cycle: [2, {ignoreExternal: true, maxDepth: 1}]
import/no-default-export: [0]
import/no-deprecated: [0]
@ -576,7 +576,7 @@ rules:
sonarjs/no-nested-template-literals: [0]
sonarjs/no-one-iteration-loop: [2]
sonarjs/no-redundant-boolean: [2]
sonarjs/no-redundant-jump: [0]
sonarjs/no-redundant-jump: [2]
sonarjs/no-same-line-conditional: [2]
sonarjs/no-small-switch: [0]
sonarjs/no-unused-collection: [2]
@ -616,17 +616,18 @@ rules:
unicorn/import-style: [0]
unicorn/new-for-builtins: [2]
unicorn/no-abusive-eslint-disable: [0]
unicorn/no-array-callback-reference: [0]
unicorn/no-array-for-each: [2]
unicorn/no-array-instanceof: [0]
unicorn/no-array-method-this-argument: [2]
unicorn/no-array-push-push: [2]
unicorn/no-array-reduce: [2]
unicorn/no-await-expression-member: [0]
unicorn/no-console-spaces: [0]
unicorn/no-document-cookie: [2]
unicorn/no-empty-file: [2]
unicorn/no-fn-reference-in-iterator: [0]
unicorn/no-for-loop: [0]
unicorn/no-hex-escape: [0]
unicorn/no-instanceof-array: [0]
unicorn/no-invalid-remove-event-listener: [2]
unicorn/no-keyword-prefix: [0]
unicorn/no-lonely-if: [2]
@ -637,7 +638,6 @@ rules:
unicorn/no-null: [0]
unicorn/no-object-as-default-parameter: [0]
unicorn/no-process-exit: [0]
unicorn/no-reduce: [2]
unicorn/no-static-only-class: [2]
unicorn/no-thenable: [2]
unicorn/no-this-assignment: [2]
@ -663,15 +663,19 @@ rules:
unicorn/prefer-array-index-of: [2]
unicorn/prefer-array-some: [2]
unicorn/prefer-at: [0]
unicorn/prefer-blob-reading-methods: [2]
unicorn/prefer-code-point: [0]
unicorn/prefer-dataset: [2]
unicorn/prefer-date-now: [2]
unicorn/prefer-default-parameters: [0]
unicorn/prefer-event-key: [2]
unicorn/prefer-dom-node-append: [2]
unicorn/prefer-dom-node-dataset: [0]
unicorn/prefer-dom-node-remove: [2]
unicorn/prefer-dom-node-text-content: [2]
unicorn/prefer-event-target: [2]
unicorn/prefer-export-from: [2, {ignoreUsedVariables: true}]
unicorn/prefer-includes: [2]
unicorn/prefer-json-parse-buffer: [0]
unicorn/prefer-keyboard-event-key: [2]
unicorn/prefer-logical-operator-over-ternary: [2]
unicorn/prefer-math-trunc: [2]
unicorn/prefer-modern-dom-apis: [0]
@ -679,9 +683,7 @@ rules:
unicorn/prefer-module: [2]
unicorn/prefer-native-coercion-functions: [2]
unicorn/prefer-negative-index: [2]
unicorn/prefer-node-append: [0]
unicorn/prefer-node-protocol: [2]
unicorn/prefer-node-remove: [0]
unicorn/prefer-number-properties: [0]
unicorn/prefer-object-from-entries: [2]
unicorn/prefer-object-has-own: [0]
@ -690,17 +692,17 @@ rules:
unicorn/prefer-query-selector: [0]
unicorn/prefer-reflect-apply: [0]
unicorn/prefer-regexp-test: [2]
unicorn/prefer-replace-all: [0]
unicorn/prefer-set-has: [0]
unicorn/prefer-set-size: [2]
unicorn/prefer-spread: [0]
unicorn/prefer-starts-ends-with: [2]
unicorn/prefer-string-replace-all: [0]
unicorn/prefer-string-slice: [0]
unicorn/prefer-string-starts-ends-with: [2]
unicorn/prefer-string-trim-start-end: [2]
unicorn/prefer-switch: [0]
unicorn/prefer-ternary: [0]
unicorn/prefer-text-content: [2]
unicorn/prefer-top-level-await: [0]
unicorn/prefer-trim-start-end: [2]
unicorn/prefer-type-error: [0]
unicorn/prevent-abbreviations: [0]
unicorn/relative-url-style: [2]

View File

@ -53,7 +53,7 @@ function doSearch() {
} else {
const para = document.createElement('P');
para.textContent = 'Please enter a word or phrase above';
document.getElementById('search-results').appendChild(para);
document.getElementById('search-results').append(para);
}
}
@ -85,7 +85,7 @@ function executeSearch(searchQuery) {
} else {
const para = document.createElement('P');
para.textContent = 'No matches found';
document.getElementById('search-results').appendChild(para);
document.getElementById('search-results').append(para);
}
});
}
@ -128,7 +128,7 @@ function populateResults(result) {
categories: value.item.categories,
snippet
});
document.getElementById('search-results').appendChild(htmlToElement(output));
document.getElementById('search-results').append(htmlToElement(output));
for (const snipvalue of snippetHighlights) {
new Mark(document.getElementById(`summary-${key}`)).mark(snipvalue);

1100
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -31,50 +31,50 @@
"fast-glob": "3.2.12",
"jquery": "3.6.4",
"jquery.are-you-sure": "1.9.0",
"katex": "0.16.6",
"katex": "0.16.7",
"license-checker-webpack-plugin": "0.2.1",
"mermaid": "10.1.0",
"mini-css-extract-plugin": "2.7.5",
"monaco-editor": "0.37.1",
"monaco-editor": "0.38.0",
"monaco-editor-webpack-plugin": "7.0.1",
"pretty-ms": "8.0.0",
"sortablejs": "1.15.0",
"swagger-ui-dist": "4.18.2",
"swagger-ui-dist": "4.18.3",
"throttle-debounce": "5.0.0",
"tippy.js": "6.3.7",
"tributejs": "5.1.3",
"uint8-to-base64": "0.2.0",
"vue": "3.2.47",
"vue-bar-graph": "2.0.0",
"vue-loader": "17.0.1",
"vue-loader": "17.1.0",
"vue3-calendar-heatmap": "2.0.5",
"webpack": "5.80.0",
"webpack-cli": "5.0.1",
"webpack": "5.82.0",
"webpack-cli": "5.1.0",
"workbox-routing": "6.5.4",
"workbox-strategies": "6.5.4",
"wrap-ansi": "8.1.0"
},
"devDependencies": {
"@playwright/test": "1.32.3",
"@playwright/test": "1.33.0",
"@rollup/pluginutils": "5.0.2",
"@stoplight/spectral-cli": "6.6.0",
"@vitejs/plugin-vue": "4.1.0",
"eslint": "8.38.0",
"@vitejs/plugin-vue": "4.2.1",
"eslint": "8.40.0",
"eslint-plugin-custom-elements": "0.0.8",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-jquery": "1.5.1",
"eslint-plugin-no-jquery": "2.7.0",
"eslint-plugin-regexp": "1.14.0",
"eslint-plugin-sonarjs": "0.19.0",
"eslint-plugin-unicorn": "46.0.0",
"eslint-plugin-vue": "9.11.0",
"jsdom": "21.1.1",
"markdownlint-cli": "0.33.0",
"stylelint": "15.5.0",
"eslint-plugin-unicorn": "47.0.0",
"eslint-plugin-vue": "9.11.1",
"jsdom": "22.0.0",
"markdownlint-cli": "0.34.0",
"stylelint": "15.6.1",
"stylelint-declaration-strict-value": "1.9.2",
"svgo": "3.0.2",
"updates": "14.0.1",
"vitest": "0.30.1"
"updates": "14.1.0",
"vitest": "0.31.0"
},
"browserslist": [
"defaults",

View File

@ -175,8 +175,8 @@ const sfc = {
const elJobLogList = document.createElement('div');
elJobLogList.classList.add('job-log-list');
elJobLogGroup.appendChild(elJobLogGroupSummary);
elJobLogGroup.appendChild(elJobLogList);
elJobLogGroup.append(elJobLogGroupSummary);
elJobLogGroup.append(elJobLogList);
el._stepLogsActiveContainer = elJobLogList;
},
// end a log group
@ -219,15 +219,15 @@ const sfc = {
const lineNumber = document.createElement('div');
lineNumber.className = 'line-num';
lineNumber.innerText = line.index;
div.appendChild(lineNumber);
lineNumber.textContent = line.index;
div.append(lineNumber);
// TODO: Support displaying time optionally
const logMessage = document.createElement('div');
logMessage.className = 'log-msg';
logMessage.innerHTML = ansiLogToHTML(line.message);
div.appendChild(logMessage);
div.append(logMessage);
return div;
},

View File

@ -66,7 +66,7 @@ export async function createMonaco(textarea, filename, editorOpts) {
const container = document.createElement('div');
container.className = 'monaco-editor-container';
textarea.parentNode.appendChild(container);
textarea.parentNode.append(container);
// https://github.com/microsoft/monaco-editor/issues/2427
const styles = window.getComputedStyle(document.documentElement);

View File

@ -172,7 +172,7 @@ export function initGlobalDropzone() {
}
navigator.clipboard.writeText(fileMarkdown);
});
file.previewTemplate.appendChild(copyLinkElement);
file.previewTemplate.append(copyLinkElement);
});
this.on('removedfile', (file) => {
$(`#${file.uuid}`).remove();

View File

@ -51,7 +51,7 @@ export function initViewedCheckboxListenerFor() {
// Update viewed-files summary and remove "has changed" label if present
refreshViewedFilesSummary();
const hasChangedLabel = form.parentNode.querySelector('.changed-since-last-review');
hasChangedLabel?.parentNode.removeChild(hasChangedLabel);
hasChangedLabel?.remove();
// Unfortunately, actual forms cause too many problems, hence another approach is needed
const files = {};

View File

@ -104,7 +104,7 @@ function showLineButton() {
td.prepend(btn);
// put a copy of the menu back into DOM for the next click
btn.closest('.code-view').appendChild(menu.cloneNode(true));
btn.closest('.code-view').append(menu.cloneNode(true));
createTippy(btn, {
trigger: 'click',

View File

@ -6,7 +6,7 @@ const {csrfToken} = window.config;
function updateIssueCount(cards) {
const parent = cards.parentElement;
const cnt = parent.getElementsByClassName('board-card').length;
parent.getElementsByClassName('board-card-cnt')[0].innerText = cnt;
parent.getElementsByClassName('board-card-cnt')[0].textContent = cnt;
}
function moveIssue({item, from, to, oldIndex}) {

View File

@ -32,17 +32,14 @@ function initTagNameEditor() {
document.getElementById('tag-name').addEventListener('keyup', (e) => {
const value = e.target.value;
const tagHelper = document.getElementById('tag-helper');
if (existingTags.includes(value)) {
// If the tag already exists, hide the target branch selector.
hideElem('#tag-target-selector');
document.getElementById('tag-helper').innerText = existingTagHelperText;
tagHelper.textContent = existingTagHelperText;
} else {
showElem('#tag-target-selector');
if (value) {
document.getElementById('tag-helper').innerText = newTagHelperText;
} else {
document.getElementById('tag-helper').innerText = defaultTagHelperText;
}
tagHelper.textContent = value ? newTagHelperText : defaultTagHelperText;
}
});
}