Skip to content

Commit 4da9420

Browse files
committed
Add eslint to pre-commit
1 parent 0bc1fa4 commit 4da9420

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

.pre-commit-config.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,18 @@ repos:
4545
hooks:
4646
- id: black
4747

48+
- repo: https://github.com/pre-commit/mirrors-eslint
49+
rev: v9.39.1
50+
hooks:
51+
- id: eslint
52+
args: ["--fix"]
53+
exclude: '(^djangoproject\/static\/js\/lib\/.*$)'
54+
require_serial: true
55+
additional_dependencies:
56+
- "@eslint/js@9.39.2"
57+
- "eslint@9.39.2"
58+
- "globals@17.0.0"
59+
4860
- repo: https://github.com/rbubley/mirrors-prettier
4961
rev: v3.7.4
5062
hooks:

eslint.config.cjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const js = require("@eslint/js");
2+
const globals = require("globals");
3+
const defineConfig = require("eslint/config").defineConfig;
4+
5+
module.exports = defineConfig([
6+
{
7+
files: ["**/*.{js,mjs,cjs}"],
8+
plugins: { js },
9+
extends: ["js/recommended"],
10+
languageOptions: { globals: globals.browser },
11+
},
12+
]);

0 commit comments

Comments
 (0)