eslint.config.js•1.68 kB
import js from '@eslint/js';
import typescript from '@typescript-eslint/eslint-plugin';
import typescriptParser from '@typescript-eslint/parser';
import prettier from 'eslint-plugin-prettier';
export default [
// JavaScript files
{
files: ['**/*.js', '**/*.jsx'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
},
plugins: {
prettier,
},
rules: {
'prettier/prettier': 'error',
semi: ['warn', 'always'],
},
},
// TypeScript files
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
parser: typescriptParser,
parserOptions: {
project: './tsconfig.json',
},
},
plugins: {
'@typescript-eslint': typescript,
prettier,
},
rules: {
// Prettier integration
'prettier/prettier': 'error',
// Basic rules
semi: ['warn', 'always'],
// TypeScript specific rules
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-non-null-assertion': 'warn',
// Disable base rules that are covered by TypeScript equivalents
'no-unused-vars': 'off',
'no-undef': 'off',
},
},
// Global ignores
{
ignores: [
'dist/**/*',
'node_modules/**/*',
'coverage/**/*',
'.husky/**/*',
'*.config.js',
'version.config.json',
'package-lock.json',
],
},
];