-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.js
More file actions
37 lines (33 loc) · 1.15 KB
/
eslint.config.js
File metadata and controls
37 lines (33 loc) · 1.15 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
// eslint.config.js
const unusedImports = require('eslint-plugin-unused-imports');
const importPlugin = require('eslint-plugin-import');
module.exports = [
{
files: ['src/**/*.js'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: {
'unused-imports': unusedImports,
'import': importPlugin
},
rules: {
// Identify unused imports
'unused-imports/no-unused-imports': 'warn',
'unused-imports/no-unused-vars': [
'warn',
{ vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' }
],
// Find unused variables and functions
'no-unused-vars': 'off', // Turned off in favor of unused-imports/no-unused-vars
// Identify console statements (potential debug code to clean up)
'no-console': ['warn', { allow: ['warn', 'error'] }], // Warn about console.log but allow console.warn and console.error
// Make sure imports are properly ordered
'import/order': ['warn', {
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
'newlines-between': 'always'
}]
}
}
];