Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 39 additions & 2 deletions workers/main/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import tseslint from '@typescript-eslint/eslint-plugin';
import tsparser from '@typescript-eslint/parser';
import prettier from 'eslint-plugin-prettier';
import eslintImport from 'eslint-plugin-import';
import prettier from 'eslint-plugin-prettier';
import simpleImportSort from 'eslint-plugin-simple-import-sort';

export default [
{
files: ['**/*.ts', '**/*.tsx'],
Comment thread
anatolyshipitz marked this conversation as resolved.
Outdated
settings: {
'import/resolver': {
typescript: {
Expand Down Expand Up @@ -62,7 +63,43 @@ export default [
],
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',


// Naming conventions based on naming-cheatsheet: https://github.com/kettanaito/naming-cheatsheet
'@typescript-eslint/naming-convention': [
'warn',
// Default rule for all identifiers
{
selector: 'default',
format: ['camelCase'],
leadingUnderscore: 'allow',
trailingUnderscore: 'allow',
},
// Prevent interfaces starting with 'I'
{
selector: 'interface',
format: ['PascalCase'],
custom: {
regex: '^I[A-Z]',
match: false
}
},
// Enforce PascalCase for classes and types
{
selector: ['class', 'typeLike'],
format: ['PascalCase']
},
// Enforce UPPER_CASE for constants (only for true constants)
{
selector: 'variable',
modifiers: ['const'],
format: ['UPPER_CASE'],
filter: {
regex: '^[A-Z_]+$',
match: true
}
}
],
Comment thread
anatolyshipitz marked this conversation as resolved.

Comment thread
coderabbitai[bot] marked this conversation as resolved.
// Code complexity and size rules
'max-depth': ['error', 4],
'max-lines': ['error', 300],
Expand Down
Loading