Mock-Signal-Server/eslint.config.mjs
Jamie Kyle 870624186f
Make eslint/typescript more strict and fix getGroup type mismatch
Co-authored-by: Scott Nonnenberg <scott@signal.org>
2025-09-25 10:57:57 -07:00

61 lines
1.7 KiB
JavaScript

// @ts-check
import eslint from '@eslint/js';
import { defineConfig } from 'eslint/config';
import tseslint from 'typescript-eslint';
export default defineConfig(
eslint.configs.recommended,
tseslint.configs.strictTypeChecked,
tseslint.configs.stylisticTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
'@typescript-eslint/array-type': ['error', { default: 'generic' }],
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/prefer-literal-enum-member': 'off',
'@typescript-eslint/no-invalid-void-type': 'off',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/no-confusing-void-expression': [
'error',
{ ignoreArrowShorthand: true },
],
'@typescript-eslint/restrict-template-expressions': [
'error',
{ allowNumber: true, allowNullish: true },
],
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
'@typescript-eslint/method-signature-style': ['error', 'property'],
'@typescript-eslint/explicit-module-boundary-types': 'error',
'@typescript-eslint/strict-boolean-expressions': [
'error',
{
allowNullableBoolean: true,
allowNullableNumber: true,
allowNullableString: true,
},
],
},
},
{
ignores: [
// ignore config files
'eslint.config.mjs',
'.prettierrc.js',
// ignore scripts
'certs/generate-trust-root.js',
'certs/generate-zk-params.js',
// ignore tsc compiled files
'{src,test}/**/*.js',
'{src,test}/**/*.d.ts',
// ignore compiled protobuf files
'protos/**',
],
},
);