Skip to content

Commit 290fefe

Browse files
knyghtyjacobtylerwalls
authored andcommitted
Fixed #35007 -- Replaced ESLint with Biome for JavaScript linting and formatting.
1 parent 3af5cb1 commit 290fefe

8 files changed

Lines changed: 27 additions & 1378 deletions

File tree

.pre-commit-config.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ repos:
2020
rev: 7.3.0
2121
hooks:
2222
- id: flake8
23-
- repo: https://github.com/pre-commit/mirrors-eslint
24-
rev: v9.39.1
25-
hooks:
26-
- id: eslint
2723
- repo: https://github.com/biomejs/pre-commit
2824
rev: v2.4.12
2925
hooks:

biome.json

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88
"docs/_theme/**/*.css",
99
"!docs/_theme/djangodocs/static/fontawesome/**",
1010
"!docs/_theme/djangodocs/static/reset-fonts-grids.css",
11-
"!**/*.min.css"
11+
"!**/*.min.css",
12+
"django/contrib/admin/static/admin/js/**/*.js",
13+
"!django/contrib/admin/static/admin/js/vendor/**",
14+
"django/contrib/gis/static/gis/js/**/*.js",
15+
"js_tests/**/*.js",
16+
"!**/*.min.js"
1217
]
1318
},
1419
"formatter": {
@@ -19,17 +24,27 @@
1924
"enabled": true,
2025
"rules": {
2126
"complexity": {
22-
"noImportantStyles": "off"
27+
"noArguments": "off",
28+
"noImportantStyles": "off",
29+
"noUselessLoneBlockStatements": "off",
30+
"useArrowFunction": "off",
31+
"useIndexOf": "off",
32+
"useOptionalChain": "off"
33+
},
34+
"correctness": {
35+
"noUnusedFunctionParameters": "off",
36+
"noUnusedVariables": "off",
37+
"useParseIntRadix": "off"
2338
},
2439
"style": {
25-
"noDescendingSpecificity": "off"
40+
"noDescendingSpecificity": "off",
41+
"useTemplate": "off"
42+
},
43+
"suspicious": {
44+
"noRedundantUseStrict": "off"
2645
}
2746
}
2847
},
29-
"javascript": {
30-
"linter": { "enabled": false },
31-
"formatter": { "enabled": false }
32-
},
3348
"json": {
3449
"linter": { "enabled": false },
3550
"formatter": { "enabled": false }

docs/internals/contributing/writing-code/javascript.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ Code style
2020
Different JavaScript files sometimes use a different code style. Please try
2121
to conform to the code style of each file.
2222

23-
* Use the `ESLint`_ code linter to check your code for bugs and style errors.
24-
ESLint will be run when you run the JavaScript tests. We also recommended
25-
installing a ESLint plugin in your text editor.
23+
* Use the `Biome`_ code linter to check your code for bugs and style errors.
24+
Biome will be run by the pre-commit hooks. We also recommended installing
25+
a Biome plugin in your text editor.
2626

2727
* Where possible, write code that will work even if the page structure is later
2828
changed with JavaScript. For instance, when binding a click handler, use
@@ -117,8 +117,8 @@ Then run the tests with:
117117

118118
$ npm test
119119

120+
.. _Biome: https://biomejs.dev/
120121
.. _EditorConfig: https://editorconfig.org/
121122
.. _Java: https://www.java.com
122-
.. _eslint: https://eslint.org/
123123
.. _node.js: https://nodejs.org/
124124
.. _qunit: https://qunitjs.com/

docs/spelling_wordlist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ benchmarking
5252
Benoit
5353
Berners
5454
Biggs
55+
Biome
5556
bitwise
5657
Bjørn
5758
blazingly

eslint-recommended.js

Lines changed: 0 additions & 107 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)