Skip to content

Commit 341c1e8

Browse files
committed
update eslint in pre-commit, make it a dev dependency
remove old jshint eslint doesn't really work anymore from pre-commit, use local install
1 parent 15ad316 commit 341c1e8

File tree

6 files changed

+2351
-2310
lines changed

6 files changed

+2351
-2310
lines changed

.eslintrc.js

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

.jshintrc

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

.pre-commit-config.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,14 @@ repos:
2525
- "--print-width=100"
2626

2727
# Lint
28-
- repo: https://github.com/pre-commit/mirrors-eslint
29-
rev: v9.26.0
28+
- repo: local
3029
hooks:
3130
- id: eslint
31+
name: eslint
32+
entry: npm run eslint
33+
language: node
34+
types_or:
35+
- javascript
3236

3337
# pre-commit.ci config reference: https://pre-commit.ci/#configuration
3438
ci:

eslint.config.mjs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import globals from "globals";
2+
import { defineConfig } from "eslint/config";
3+
import js from "@eslint/js";
4+
5+
export default defineConfig([
6+
js.configs.recommended,
7+
{
8+
files: ["**/*.js"],
9+
languageOptions: {
10+
sourceType: "commonjs",
11+
globals: {
12+
...globals.node,
13+
},
14+
},
15+
rules: {
16+
"no-unused-vars": "off",
17+
},
18+
},
19+
{
20+
files: ["test/**/*.js"],
21+
languageOptions: {
22+
sourceType: "commonjs",
23+
globals: {
24+
...globals.node,
25+
...globals.jasmine,
26+
},
27+
},
28+
rules: {
29+
"no-unused-vars": "off",
30+
},
31+
},
32+
]);

0 commit comments

Comments
 (0)