diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f376ce3..3c6a2a1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,26 +14,27 @@ repos: - id: mixed-line-ending - id: trailing-whitespace - repo: https://github.com/adamchainz/django-upgrade - rev: 1.18.0 + rev: 1.21.0 hooks: - id: django-upgrade - args: [--target-version, "3.2"] + args: [--target-version, "4.2"] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.4.9" + rev: "v0.6.4" hooks: - id: ruff + args: [--unsafe-fixes] - id: ruff-format - repo: https://github.com/biomejs/pre-commit rev: "v0.4.0" hooks: - id: biome-check - additional_dependencies: ["@biomejs/biome@1.8.1"] + additional_dependencies: ["@biomejs/biome@1.8.3"] args: [--unsafe] - repo: https://github.com/tox-dev/pyproject-fmt - rev: 2.1.3 + rev: 2.2.3 hooks: - id: pyproject-fmt - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.18 + rev: v0.19 hooks: - id: validate-pyproject diff --git a/biome.json b/biome.json index 46a123b..84ecffe 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/1.8.1/schema.json", + "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", "organizeImports": { "enabled": false }, @@ -8,34 +8,50 @@ "indentStyle": "space", "indentWidth": 2 }, + "linter": { + "enabled": true, + "rules": { + "recommended": true, + "a11y": { + "noSvgWithoutTitle": "off" + }, + "correctness": { + "noUndeclaredVariables": "error", + "noUnusedImports": "error", + "noUnusedVariables": "error", + "useArrayLiterals": "error", + "useHookAtTopLevel": "error" + }, + "security": { + "noDangerouslySetInnerHtml": "warn" + }, + "style": { + "noParameterAssign": "off", + "useForOf": "warn" + }, + "suspicious": { + "noArrayIndexKey": "warn", + "noAssignInExpressions": "off" + } + } + }, "javascript": { "formatter": { "semicolons": "asNeeded" - } + }, + "globals": ["django", "JSONEditor", "DjangoProseEditor"] }, "css": { "formatter": { - "enabled": true, - "indentStyle": "space", - "indentWidth": 2 + "enabled": true }, "linter": { "enabled": true } }, - "linter": { - "enabled": true, - "rules": { - "complexity": { - "noForEach": "off", - "useOptionalChain": "off" - }, - "style": { - "noParameterAssign": "off" - }, - "suspicious": { - "noAssignInExpressions": "off" - } + "json": { + "formatter": { + "enabled": false } } } diff --git a/src/typographic.js b/src/typographic.js index 0b99de5..ed18d16 100644 --- a/src/typographic.js +++ b/src/typographic.js @@ -36,7 +36,6 @@ const typographicDecorationsForNode = (node, position) => { const decorations = [] if (node.text) { for (const match of node.text.matchAll(/(\u00A0|\u00AD)/g)) { - const array = Array.from(match) const from = position + (match.index || 0) decorations.push( Decoration.inline(from, from + 1, {