summaryrefslogtreecommitdiff
path: root/eslint.config.js
blob: 2ba7fbbb78a86448fb6beeb5ea903d80bcb9f38a (plain)
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
import js from '@eslint/js';
import tseslint from '@typescript-eslint/eslint-plugin';
import tseslintParser from '@typescript-eslint/parser';
import prettier from 'eslint-config-prettier';

export default [
  // Global ignores (apply first)
  {
    ignores: [
      'dist/**',
      'node_modules/**',
      'examples/verify-callback-example.ts',
      'examples/verify-callback.ts', // Ignore this file too
      'examples/generate-uri.ts' // Ignore this file too
    ]
  },
  // Default JS rules for all JS/TS files
  js.configs.recommended,
  {
    // Apply TS rules specifically to .ts files within src and tests
    files: ['src/**/*.ts'], // Adjusted to include tests
    languageOptions: {
      parser: tseslintParser,
      parserOptions: {
        project: ['./tsconfig.json'], // Apply project-based parsing only here
        tsconfigRootDir: '.',
      },
      globals: { // Define Node.js globals if needed
        NodeJS: true
      }
    },
    plugins: {
      '@typescript-eslint': tseslint,
    },
    rules: {
      ...tseslint.configs.recommended.rules, // Apply TS recommended rules
      '@typescript-eslint/no-explicit-any': 'error', // Make this an error now
    },
  },
  // Prettier rules (apply last)
  prettier,
];