-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
62 lines (58 loc) · 1.58 KB
/
eslint.config.js
File metadata and controls
62 lines (58 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import globals from 'globals';
import js from '@eslint/js';
import importPlugin from 'eslint-plugin-import';
import unusedImports from 'eslint-plugin-unused-imports';
import prettierConfig from 'eslint-config-prettier';
export default [
// Global ignores
{
ignores: ['dist/**', 'hexlife-wasm/src/core/wasm-engine/**'],
},
// Base configuration for JavaScript files
js.configs.recommended,
// Configuration to disable ESLint rules that conflict with Prettier
prettierConfig,
// Main project configuration
{
plugins: {
import: importPlugin,
'unused-imports': unusedImports,
},
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.browser,
...globals.node,
},
},
rules: {
// Disables the base rule to avoid conflicts with the plugin
'no-unused-vars': 'off',
// Enforces the unused-imports rule for dead code detection
'unused-imports/no-unused-imports': 'warn',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
},
],
// Rules for the import plugin
'import/no-unresolved': ['error', { commonjs: true, amd: true }],
'import/named': 'error',
'import/namespace': 'error',
'import/default': 'error',
'import/export': 'error',
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.mjs'],
},
},
},
},
];