-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.mjs
More file actions
53 lines (49 loc) · 1.52 KB
/
eslint.config.mjs
File metadata and controls
53 lines (49 loc) · 1.52 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
// eslint.config.mjs
import globals from 'globals';
import eslintJs from '@eslint/js';
import tseslint from 'typescript-eslint';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
export default tseslint.config(
// Global ignores apply to all configurations
{
ignores: [
'node_modules/',
'dist/',
'webpack.config.js',
'eslint.config.mjs', // Ignore self
'.prettierrc.js', // Ignore Prettier config file
'*.user.js',
],
},
// Base ESLint recommended rules
eslintJs.configs.recommended,
// TypeScript configurations
{
// Apply to all .ts files
files: ['**/*.ts'],
// This extends recommendedTypeChecked and sets up languageOptions for type-aware linting
extends: [...tseslint.configs.recommendedTypeChecked],
languageOptions: {
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: import.meta.dirname, // For ES Modules
},
globals: {
...globals.browser,
...globals.node,
},
},
rules: {
// Your specific rule overrides and additions for TypeScript files
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^', varsIgnorePattern: '^' },
],
// Add other custom rules here
},
},
// Prettier integration - should be last to override other styling rules
eslintPluginPrettierRecommended
);