1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-02 12:47:41 +02:00

Tools: Add linter rules for a few TypeScript naming conventions

This commit is contained in:
Laurent Cozic 2021-08-18 16:21:48 +01:00
parent 06ed58b809
commit 11d35711c1
2 changed files with 30 additions and 2 deletions

View File

@ -171,6 +171,34 @@ module.exports = {
},
}],
'@typescript-eslint/no-floating-promises': ['error'],
'@typescript-eslint/naming-convention': ['error',
// Naming conventions over the codebase is very inconsistent
// unfortunately and fixing it would be way too much work.
// In general, we use "strictCamelCase" for variable names.
// {
// selector: 'default',
// format: ['StrictPascalCase', 'strictCamelCase', 'snake_case', 'UPPER_CASE'],
// leadingUnderscore: 'allow',
// trailingUnderscore: 'allow',
// },
{
selector: 'enumMember',
format: ['StrictPascalCase'],
},
{
selector: 'enumMember',
format: null,
'filter': {
'regex': '^(GET|POST|PUT|DELETE|PATCH|HEAD|SQLite|PostgreSQL|ASC|DESC|E2EE|OR|AND|UNION|INTERSECT|EXCLUSION|INCLUSION|EUR|GBP|USD)$',
'match': true,
},
},
{
selector: 'interface',
format: ['StrictPascalCase'],
},
],
},
},
],

View File

@ -11,13 +11,13 @@ import { StyledWrapperRoot, StyledMoveOverlay, MoveModeRootWrapper, MoveModeRoot
import { Resizable } from 're-resizable';
const EventEmitter = require('events');
interface onResizeEvent {
interface OnResizeEvent {
layout: LayoutItem;
}
interface Props {
layout: LayoutItem;
onResize(event: onResizeEvent): void;
onResize(event: OnResizeEvent): void;
width?: number;
height?: number;
renderItem: Function;