diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4558842f4..031b228e4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -45,6 +45,18 @@ repos: hooks: - id: black + - repo: https://github.com/pre-commit/mirrors-eslint + rev: v9.39.1 + hooks: + - id: eslint + args: ["--fix"] + exclude: '(^djangoproject\/static\/js\/lib\/.*$)' + require_serial: true + additional_dependencies: + - "@eslint/js@9.39.2" + - "eslint@9.39.2" + - "globals@17.0.0" + - repo: https://github.com/rbubley/mirrors-prettier rev: v3.7.4 hooks: diff --git a/eslint.config.cjs b/eslint.config.cjs new file mode 100644 index 000000000..cd78d25b2 --- /dev/null +++ b/eslint.config.cjs @@ -0,0 +1,17 @@ +const js = require("@eslint/js"); +const globals = require("globals"); +const defineConfig = require("eslint/config").defineConfig; + +module.exports = defineConfig([ + { + files: ["**/*.{js,mjs,cjs}"], + plugins: { js }, + extends: ["js/recommended"], + languageOptions: { + globals: { + ...globals.browser, + ...globals.jquery, + }, + }, + }, +]);