61 lines
1.7 KiB
JavaScript
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/**',
|
|
],
|
|
},
|
|
);
|