The following specific rules are enforced to maintain code quality and consistency across the codebase.
// TypeScript Rules
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
'@typescript-eslint/consistent-type-imports': [
'error',
{
prefer: 'type-imports',
fixStyle: 'separate-type-imports',
disallowTypeAnnotations: true,
},
],
'@typescript-eslint/no-misused-promises': [
'error',
{ checksVoidReturn: { attributes: false } },
],
'@typescript-eslint/only-throw-error': [
'error',
{
allow: [
{ from: 'file', name: 'DataWithResponseInit' },
{ from: 'file', name: 'ErrorResponse' },
{ from: 'lib', name: 'Response' },
],
},
],
// Unicorn Rules
'unicorn/better-regex': 'warn',
'unicorn/no-process-exit': 'off',
'unicorn/no-array-reduce': 'off',
'unicorn/no-array-callback-reference': 'off',
'unicorn/prevent-abbreviations': [
'error',
{
replacements: { args: false, params: false, props: false, utils: false },
},
],
'unicorn/filename-case': [
'error',
{
case: 'kebabCase',
ignore: [
/.*\._index\.(tsx|ts)$/,
/.*\$[A-Za-z]+Slug(\.[A-Za-z]+)*\.(tsx,ts)$/,
/.*_\.[A-Za-z]+\.(tsx|ts)$/,
],
},
],
// Import Sorting
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',