Skip to content

Commit

Permalink
#1870 fix pre commit errors (#1884)
Browse files Browse the repository at this point in the history
* fix: fix for precommit errors
* fix: migrated .eslintrc.js to eslint.config.js flat config
* fix: added dependencies and added support for globals in eslint.config.js
* fix: set ecmaVersion to latest
  • Loading branch information
elijah0kello committed Feb 14, 2024
1 parent 14fbaa8 commit 38d2eea
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 24 deletions.
22 changes: 0 additions & 22 deletions .eslintrc.js

This file was deleted.

8 changes: 6 additions & 2 deletions .pre-commit-config.yaml
Expand Up @@ -14,7 +14,7 @@ repos:
hooks:
- id: doc8
- repo: https://github.com/adamchainz/django-upgrade
rev: 1.15.0
rev: 1.16.0
hooks:
- id: django-upgrade
args: [--target-version, "3.2"]
Expand All @@ -32,9 +32,13 @@ repos:
args:
- --trailing-comma=es5
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.56.0
rev: v9.0.0-beta.0
hooks:
- id: eslint
additional_dependencies:
- "eslint@v9.0.0-beta.0"
- "@eslint/js@v9.0.0-beta.0"
- "globals"
files: \.js?$
types: [file]
args:
Expand Down
28 changes: 28 additions & 0 deletions eslint.config.js
@@ -0,0 +1,28 @@
const js = require("@eslint/js");
const globals = require("globals");

module.exports = [
js.configs.recommended,
{
files: ["**/*.js"],
languageOptions:{
ecmaVersion: "latest",
sourceType: "module",
globals: {
...globals.browser,
...globals.node
}
}
},
{
rules: {
"curly": ["error", "all"],
"dot-notation": "error",
"eqeqeq": "error",
"no-eval": "error",
"no-var": "error",
"prefer-const": "error",
"semi": "error"
}
}
];

0 comments on commit 38d2eea

Please sign in to comment.