Skip to content

Commit 92cfd3f

Browse files
authored
chore: migrate to eslint 9 (#241)
1 parent e7790e0 commit 92cfd3f

File tree

4 files changed

+461
-612
lines changed

4 files changed

+461
-612
lines changed

eslint.config.mjs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { defineConfig } from 'eslint/config';
2+
import globals from 'globals';
3+
import path from 'node:path';
4+
import { fileURLToPath } from 'node:url';
5+
import js from '@eslint/js';
6+
import { FlatCompat } from '@eslint/eslintrc';
7+
8+
const __filename = fileURLToPath(import.meta.url);
9+
const __dirname = path.dirname(__filename);
10+
const compat = new FlatCompat({
11+
baseDirectory: __dirname,
12+
recommendedConfig: js.configs.recommended,
13+
allConfig: js.configs.all
14+
});
15+
16+
export default defineConfig([{
17+
extends: compat.extends('eslint:recommended', 'prettier'),
18+
19+
languageOptions: {
20+
globals: {
21+
...globals.browser,
22+
...globals.mocha,
23+
...globals.node,
24+
},
25+
26+
ecmaVersion: 10,
27+
sourceType: 'module',
28+
},
29+
30+
rules: {
31+
'keyword-spacing': [2, {
32+
before: true,
33+
after: true,
34+
}],
35+
36+
'no-cond-assign': [0],
37+
},
38+
}]);

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ module.exports = function (options = {}) {
114114
);
115115
warned = true;
116116
}
117-
} catch (e) {
117+
} catch {
118118
// do nothing, this isn't a Svelte library
119119
}
120120
}

0 commit comments

Comments
 (0)