summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Carrick <tom@carrick.eu>2026-04-18 14:12:44 +0300
committerJacob Walls <jacobtylerwalls@gmail.com>2026-04-18 15:46:37 +0300
commit4a6f797e480ff918cad7a93a331e48b45df091dc (patch)
tree285098aa2ade74af8631cf0dd3a529ce74f91707
parented79c5959add54b6e8ea589ec601e0d2e801517e (diff)
Refs #35007 -- Added biome to lint and format CSS files.
-rw-r--r--.editorconfig8
-rw-r--r--.github/workflows/linters.yml17
-rw-r--r--.pre-commit-config.yaml5
-rw-r--r--biome.json37
-rw-r--r--package.json4
5 files changed, 66 insertions, 5 deletions
diff --git a/.editorconfig b/.editorconfig
index f5a029187c..e25596d077 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -19,13 +19,13 @@ max_line_length = 88
indent_size = 2
[**/admin/js/vendor/**]
-indent_style = ignore
-indent_size = ignore
+indent_style = unset
+indent_size = unset
# Minified JavaScript files shouldn't be changed
[**.min.js]
-indent_style = ignore
-insert_final_newline = ignore
+indent_style = unset
+insert_final_newline = unset
# Makefiles always use tabs for indentation
[Makefile]
diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml
index e37d7b5ee2..ccee1adde0 100644
--- a/.github/workflows/linters.yml
+++ b/.github/workflows/linters.yml
@@ -83,3 +83,20 @@ jobs:
with:
advanced-security: false
annotations: true
+
+ biome:
+ runs-on: ubuntu-latest
+ timeout-minutes: 60
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+ - name: Set up Node.js
+ uses: actions/setup-node@v5
+ with:
+ node-version: '20'
+ cache: 'npm'
+ cache-dependency-path: '**/package.json'
+ - run: npm install
+ - run: npx biome ci
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index dbe92a2bdc..bc7a5c279a 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -24,6 +24,11 @@ repos:
rev: v9.39.1
hooks:
- id: eslint
+ - repo: https://github.com/biomejs/pre-commit
+ rev: v2.4.12
+ hooks:
+ - id: biome-check
+ additional_dependencies: ["@biomejs/biome@2.4.12"]
- repo: https://github.com/zizmorcore/zizmor-pre-commit
rev: v1.19.0
hooks:
diff --git a/biome.json b/biome.json
new file mode 100644
index 0000000000..cc95757f3e
--- /dev/null
+++ b/biome.json
@@ -0,0 +1,37 @@
+{
+ "$schema": "https://biomejs.dev/schemas/2.4.12/schema.json",
+ "files": {
+ "includes": [
+ "django/contrib/admin/static/admin/css/**/*.css",
+ "!django/contrib/admin/static/admin/css/vendor/**",
+ "django/contrib/gis/static/gis/css/**/*.css",
+ "docs/_theme/**/*.css",
+ "!docs/_theme/djangodocs/static/fontawesome/**",
+ "!docs/_theme/djangodocs/static/reset-fonts-grids.css",
+ "!**/*.min.css"
+ ]
+ },
+ "formatter": {
+ "enabled": true,
+ "useEditorconfig": true
+ },
+ "linter": {
+ "enabled": true,
+ "rules": {
+ "complexity": {
+ "noImportantStyles": "off"
+ },
+ "style": {
+ "noDescendingSpecificity": "off"
+ }
+ }
+ },
+ "javascript": {
+ "linter": { "enabled": false },
+ "formatter": { "enabled": false }
+ },
+ "json": {
+ "linter": { "enabled": false },
+ "formatter": { "enabled": false }
+ }
+}
diff --git a/package.json b/package.json
index a0ae4ad873..e1d22cda11 100644
--- a/package.json
+++ b/package.json
@@ -3,12 +3,14 @@
"private": true,
"scripts": {
"pretest": "eslint .",
- "test": "grunt test --verbose"
+ "test": "grunt test --verbose",
+ "biome": "biome check"
},
"engines": {
"npm": ">=1.3.0"
},
"devDependencies": {
+ "@biomejs/biome": "^2.4.12",
"eslint": "^9.39.1",
"puppeteer": "^24.22.0",
"grunt": "^1.6.1",