diff --git a/packages/eslint-config/index.js b/packages/eslint-config/index.js index 41d71c9..169629e 100644 --- a/packages/eslint-config/index.js +++ b/packages/eslint-config/index.js @@ -43,6 +43,17 @@ module.exports = { }, ], + 'no-restricted-syntax': ["error", + { + "selector": "CallExpression[callee.name = useMemo] :matches(ArrowFunctionExpression, ArrowFunctionExpression ReturnStatement, FunctionExpression ReturnStatement) :matches(TemplateLiteral[expressions.length = 0], TemplateLiteral > Identifier, TemplateLiteral > Literal)", + "message": "Do not memorize primitives https://wiki.sberdevices.ru/doc/react-dos-and-donts-dhLkEiVMHJ#h-ne-ispolьzujte-usememo-dlya-memoizacii-primitivov" + }, + { + "selector": "CallExpression[callee.name = useMemo] :matches(ArrowFunctionExpression, ArrowFunctionExpression ReturnStatement, FunctionExpression ReturnStatement) > Literal", + "message": "Do not memorize primitives https://wiki.sberdevices.ru/doc/react-dos-and-donts-dhLkEiVMHJ#h-ne-ispolьzujte-usememo-dlya-memoizacii-primitivov" + }, + ], + 'default-param-last': 'warn', '@typescript-eslint/member-ordering': [