Add more ESLint rules and change the formatting scripts (#626)
* Add curly rule in ESLint for consistency * Fix rules * More rules * REturn * Push * no else return * prefer const * destructing
This commit is contained in:
@ -75,8 +75,9 @@ export const shapesShortcutKeys = SHAPES.map((shape, index) => [
|
||||
export function findShapeByKey(key: string) {
|
||||
const defaultElement = "selection";
|
||||
return SHAPES.reduce((element, shape, index) => {
|
||||
if (shape.value[0] !== key && key !== (index + 1).toString())
|
||||
if (shape.value[0] !== key && key !== (index + 1).toString()) {
|
||||
return element;
|
||||
}
|
||||
|
||||
return shape.value;
|
||||
}, defaultElement);
|
||||
|
Reference in New Issue
Block a user