Skip to content

Commit

Permalink
Enable more biome rules
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Sep 12, 2024
1 parent b42f151 commit 926b0aa
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 25 deletions.
13 changes: 7 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected].1"]
additional_dependencies: ["@biomejs/[email protected].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
52 changes: 34 additions & 18 deletions biome.json
Original file line number Diff line number Diff line change
@@ -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
},
Expand All @@ -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
}
}
}
1 change: 0 additions & 1 deletion src/typographic.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down

0 comments on commit 926b0aa

Please sign in to comment.