Merge pull request 'Update dependency eslint-plugin-unicorn to v56 (forgejo)' (#5663) from renovate/forgejo-eslint-plugin-unicorn-56.x into forgejo
This commit is contained in:
commit
e4de08b258
7 changed files with 18 additions and 15 deletions
|
@ -656,6 +656,7 @@ rules:
|
|||
unicorn/catch-error-name: [0]
|
||||
unicorn/consistent-destructuring: [2]
|
||||
unicorn/consistent-empty-array-spread: [2]
|
||||
unicorn/consistent-existence-index-check: [2]
|
||||
unicorn/consistent-function-scoping: [2]
|
||||
unicorn/custom-error-definition: [0]
|
||||
unicorn/empty-brace-spaces: [2]
|
||||
|
@ -732,10 +733,12 @@ rules:
|
|||
unicorn/prefer-dom-node-text-content: [2]
|
||||
unicorn/prefer-event-target: [2]
|
||||
unicorn/prefer-export-from: [0]
|
||||
unicorn/prefer-global-this: [0]
|
||||
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-min-max: [2]
|
||||
unicorn/prefer-math-trunc: [2]
|
||||
unicorn/prefer-modern-dom-apis: [0]
|
||||
unicorn/prefer-modern-math-apis: [2]
|
||||
|
|
18
package-lock.json
generated
18
package-lock.json
generated
|
@ -79,7 +79,7 @@
|
|||
"eslint-plugin-playwright": "1.6.2",
|
||||
"eslint-plugin-regexp": "2.6.0",
|
||||
"eslint-plugin-sonarjs": "2.0.3",
|
||||
"eslint-plugin-unicorn": "55.0.0",
|
||||
"eslint-plugin-unicorn": "56.0.0",
|
||||
"eslint-plugin-vitest-globals": "1.5.0",
|
||||
"eslint-plugin-vue": "9.28.0",
|
||||
"eslint-plugin-vue-scoped-css": "2.8.1",
|
||||
|
@ -9174,19 +9174,19 @@
|
|||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-unicorn": {
|
||||
"version": "55.0.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-55.0.0.tgz",
|
||||
"integrity": "sha512-n3AKiVpY2/uDcGrS3+QsYDkjPfaOrNrsfQxU9nt5nitd9KuvVXrfAvgCO9DYPSfap+Gqjw9EOrXIsBp5tlHZjA==",
|
||||
"version": "56.0.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-56.0.0.tgz",
|
||||
"integrity": "sha512-aXpddVz/PQMmd69uxO98PA4iidiVNvA0xOtbpUoz1WhBd4RxOQQYqN618v68drY0hmy5uU2jy1bheKEVWBjlPw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/helper-validator-identifier": "^7.24.5",
|
||||
"@babel/helper-validator-identifier": "^7.24.7",
|
||||
"@eslint-community/eslint-utils": "^4.4.0",
|
||||
"ci-info": "^4.0.0",
|
||||
"clean-regexp": "^1.0.0",
|
||||
"core-js-compat": "^3.37.0",
|
||||
"esquery": "^1.5.0",
|
||||
"globals": "^15.7.0",
|
||||
"core-js-compat": "^3.38.1",
|
||||
"esquery": "^1.6.0",
|
||||
"globals": "^15.9.0",
|
||||
"indent-string": "^4.0.0",
|
||||
"is-builtin-module": "^3.2.1",
|
||||
"jsesc": "^3.0.2",
|
||||
|
@ -9194,7 +9194,7 @@
|
|||
"read-pkg-up": "^7.0.1",
|
||||
"regexp-tree": "^0.1.27",
|
||||
"regjsparser": "^0.10.0",
|
||||
"semver": "^7.6.1",
|
||||
"semver": "^7.6.3",
|
||||
"strip-indent": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
"eslint-plugin-playwright": "1.6.2",
|
||||
"eslint-plugin-regexp": "2.6.0",
|
||||
"eslint-plugin-sonarjs": "2.0.3",
|
||||
"eslint-plugin-unicorn": "55.0.0",
|
||||
"eslint-plugin-unicorn": "56.0.0",
|
||||
"eslint-plugin-vitest-globals": "1.5.0",
|
||||
"eslint-plugin-vue": "9.28.0",
|
||||
"eslint-plugin-vue-scoped-css": "2.8.1",
|
||||
|
|
|
@ -363,7 +363,7 @@ class ComboMarkdownEditor {
|
|||
const lineStart = Math.max(0, value.lastIndexOf('\n', start - 1) + 1);
|
||||
// Find the end and extract the line.
|
||||
const lineEnd = value.indexOf('\n', start);
|
||||
const line = value.slice(lineStart, lineEnd < 0 ? value.length : lineEnd);
|
||||
const line = value.slice(lineStart, lineEnd === -1 ? value.length : lineEnd);
|
||||
// Match any whitespace at the start + any repeatable prefix + exactly one space after.
|
||||
const prefix = line.match(/^\s*((\d+)[.)]\s|[-*+]\s+(\[[ x]\]\s?)?|(>\s+)+)?/);
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ class Source {
|
|||
|
||||
deregister(port) {
|
||||
const portIdx = this.clients.indexOf(port);
|
||||
if (portIdx < 0) {
|
||||
if (portIdx === -1) {
|
||||
return this.clients.length;
|
||||
}
|
||||
this.clients.splice(portIdx, 1);
|
||||
|
|
|
@ -3,13 +3,13 @@ import {encode, decode} from 'uint8-to-base64';
|
|||
// transform /path/to/file.ext to file.ext
|
||||
export function basename(path = '') {
|
||||
const lastSlashIndex = path.lastIndexOf('/');
|
||||
return lastSlashIndex < 0 ? path : path.substring(lastSlashIndex + 1);
|
||||
return lastSlashIndex === -1 ? path : path.substring(lastSlashIndex + 1);
|
||||
}
|
||||
|
||||
// transform /path/to/file.ext to .ext
|
||||
export function extname(path = '') {
|
||||
const lastPointIndex = path.lastIndexOf('.');
|
||||
return lastPointIndex < 0 ? '' : path.substring(lastPointIndex);
|
||||
return lastPointIndex === -1 ? '' : path.substring(lastPointIndex);
|
||||
}
|
||||
|
||||
// test whether a variable is an object
|
||||
|
|
|
@ -155,7 +155,7 @@ export function autosize(textarea, {viewportMarginBottom = 0} = {}) {
|
|||
const isBorderBox = computedStyle.boxSizing === 'border-box';
|
||||
const borderAddOn = isBorderBox ? topBorderWidth + bottomBorderWidth : 0;
|
||||
|
||||
const adjustedViewportMarginBottom = bottom < viewportMarginBottom ? bottom : viewportMarginBottom;
|
||||
const adjustedViewportMarginBottom = Math.min(bottom, viewportMarginBottom);
|
||||
const curHeight = parseFloat(computedStyle.height);
|
||||
const maxHeight = curHeight + bottom - adjustedViewportMarginBottom;
|
||||
|
||||
|
|
Loading…
Reference in a new issue