Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
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
46 changes: 44 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'],
settings: {
'import/resolver': {
typescript: {
Expand Down Expand Up @@ -62,7 +63,48 @@ 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 (excluding const variables)
{
selector: 'default',
format: ['camelCase'],
leadingUnderscore: 'allow',
trailingUnderscore: 'allow',
filter: {
regex: '^[A-Z_]+$',
match: false
}
},
// 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'],
types: ['string', 'number', 'boolean'],
format: ['UPPER_CASE'],
filter: {
regex: '^[A-Z_]+$',
match: false
}
}
],
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