diff --git a/packages/vkui/.eslintrc.js b/packages/vkui/.eslintrc.js index 4b4d091b4c..0afa7e764f 100644 --- a/packages/vkui/.eslintrc.js +++ b/packages/vkui/.eslintrc.js @@ -117,7 +117,7 @@ module.exports = { 'react/react-in-jsx-scope': 'off', 'react/no-unknown-property': ['error'], - '@project-tools/vkui/no-object-expression-in-arguments': [ + '@vkontakte/no-object-expression-in-arguments': [ 'error', { onlyForFunctionsWithNames: ['classNames'], diff --git a/tools/eslint-plugin-vkui/index.js b/tools/eslint-plugin-vkui/index.js index f5963c9198..f8c3771eda 100644 --- a/tools/eslint-plugin-vkui/index.js +++ b/tools/eslint-plugin-vkui/index.js @@ -1,61 +1,3 @@ -/** @type {import('eslint').Rule.RuleModule} */ -const noObjectExpressionInArguments = { - meta: { - schema: [ - { - type: 'object', - properties: { - onlyForFunctionsWithNames: { - oneOf: [ - { - type: 'array', - items: { - type: 'string', - }, - }, - { - type: 'string', - }, - ], - }, - }, - }, - ], - }, - create(context) { - const options = context.options; - let onlyForFunctionsWithNames = null; - - options.forEach((option) => { - if ('onlyForFunctionsWithNames' in option) { - onlyForFunctionsWithNames = option.onlyForFunctionsWithNames; - } - }); - - return { - /** @param node {import('estree').CallExpression} */ - CallExpression(node) { - if (onlyForFunctionsWithNames && !onlyForFunctionsWithNames.includes(node.callee.name)) { - return; - } - const args = node.arguments; - for (let i = 0; i < args.length; i += 1) { - const arg = args[i]; - if (arg.type === 'ObjectExpression') { - context.report({ - node, - message: 'Do not use object expression in arguments.', - }); - break; - } - } - }, - }; - }, -}; - module.exports = { - rules: { - 'no-object-expression-in-arguments': noObjectExpressionInArguments, - }, + rules: {}, };