Skip to content

Commit 1100ce5

Browse files
committed
Add ESLint
1 parent 2b1261a commit 1100ce5

File tree

6 files changed

+856
-5
lines changed

6 files changed

+856
-5
lines changed

eslint.config.js

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 js from '@eslint/js';
3+
4+
const browserScripts = [
5+
'src/**/*.js',
6+
];
7+
8+
export default [
9+
js.configs.recommended,
10+
11+
{
12+
ignores: ['dist/**/*.js'],
13+
},
14+
15+
{
16+
ignores: browserScripts,
17+
languageOptions: {
18+
globals: {
19+
...globals.node,
20+
},
21+
},
22+
},
23+
24+
{
25+
files: browserScripts,
26+
languageOptions: {
27+
globals: {
28+
...globals.browser,
29+
},
30+
},
31+
},
32+
];

lefthook.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ pre-commit:
66
- name: Stylelint
77
glob: '**/*.css'
88
run: npx stylelint {staged_files}
9+
- name: ESLint
10+
glob: '**/*.js'
11+
run: npx eslint {staged_files}

0 commit comments

Comments
 (0)