diff --git a/.eslintrc.js b/.eslintrc.js index 3f87c08f42..a10efd703c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -97,7 +97,6 @@ module.exports = { // eslint-plugin rules: 'eslint-plugin/consistent-output': ['error', 'always'], - 'eslint-plugin/no-deprecated-report-api': 'off', 'eslint-plugin/require-meta-docs-url': [ 'error', { diff --git a/lib/rules/alias-model-in-controller.js b/lib/rules/alias-model-in-controller.js index dbe26ab2ed..7bcbf5e3c7 100644 --- a/lib/rules/alias-model-in-controller.js +++ b/lib/rules/alias-model-in-controller.js @@ -24,7 +24,7 @@ module.exports = { const message = 'Alias your model'; const report = function (node) { - context.report(node, message); + context.report({ node, message }); }; const sourceCode = context.getSourceCode(); diff --git a/lib/rules/avoid-leaking-state-in-ember-objects.js b/lib/rules/avoid-leaking-state-in-ember-objects.js index 54ed05e1bb..ce7e69c7f8 100644 --- a/lib/rules/avoid-leaking-state-in-ember-objects.js +++ b/lib/rules/avoid-leaking-state-in-ember-objects.js @@ -76,7 +76,7 @@ module.exports = { const report = function (node) { const message = 'Only string, number, symbol, boolean, null, undefined, and function are allowed as default properties'; - context.report(node, message); + context.report({ node, message }); }; const sourceCode = context.getSourceCode(); diff --git a/lib/rules/avoid-using-needs-in-controllers.js b/lib/rules/avoid-using-needs-in-controllers.js index b814b365a2..a4742ceeba 100644 --- a/lib/rules/avoid-using-needs-in-controllers.js +++ b/lib/rules/avoid-using-needs-in-controllers.js @@ -23,7 +23,7 @@ module.exports = { const report = function (node) { const message = '`needs` API has been deprecated, `Ember.inject.controller` should be used instead'; - context.report(node, message); + context.report({ node, message }); }; const sourceCode = context.getSourceCode(); diff --git a/lib/rules/closure-actions.js b/lib/rules/closure-actions.js index e6a5c5973b..679148b1f9 100644 --- a/lib/rules/closure-actions.js +++ b/lib/rules/closure-actions.js @@ -25,7 +25,7 @@ module.exports = { create(context) { const report = function (node) { - context.report(node, ERROR_MESSAGE); + context.report({ node, message: ERROR_MESSAGE }); }; return { diff --git a/lib/rules/computed-property-getters.js b/lib/rules/computed-property-getters.js index 95f5455cc9..594af4381c 100644 --- a/lib/rules/computed-property-getters.js +++ b/lib/rules/computed-property-getters.js @@ -38,7 +38,7 @@ module.exports = { const requireGetters = context.options[0] || 'always-with-setter'; const report = function (node, message) { - context.report(node, message); + context.report({ node, message }); }; const requireGetterOnlyWithASetterInComputedProperty = function (node) { diff --git a/lib/rules/jquery-ember-run.js b/lib/rules/jquery-ember-run.js index 9aec21fa23..fb7af0ee08 100644 --- a/lib/rules/jquery-ember-run.js +++ b/lib/rules/jquery-ember-run.js @@ -46,7 +46,7 @@ module.exports = { create(context) { const report = function (node) { - context.report(node, ERROR_MESSAGE); + context.report({ node, message: ERROR_MESSAGE }); }; let importedEmberName; diff --git a/lib/rules/named-functions-in-promises.js b/lib/rules/named-functions-in-promises.js index 2d389f2a40..e49ec157e8 100644 --- a/lib/rules/named-functions-in-promises.js +++ b/lib/rules/named-functions-in-promises.js @@ -37,7 +37,7 @@ module.exports = { const message = 'Use named functions defined on objects to handle promises'; const report = function (node) { - context.report(node, message); + context.report({ node, message }); }; return { diff --git a/lib/rules/new-module-imports.js b/lib/rules/new-module-imports.js index 76f29ed644..9a8fe56d53 100644 --- a/lib/rules/new-module-imports.js +++ b/lib/rules/new-module-imports.js @@ -48,7 +48,7 @@ module.exports = { type: item.type, }); - context.report(item, message); + context.report({ node: item, message }); } } } @@ -83,7 +83,7 @@ module.exports = { type: item.type, }); - context.report(item, message); + context.report({ node: item, message }); } } } @@ -111,7 +111,7 @@ module.exports = { // JS module import for it, so do not report the error if (match) { const message = buildMessage({ node, fullName, key, match }); - context.report(node, message); + context.report({ node, message }); break; } } diff --git a/lib/rules/no-actions-hash.js b/lib/rules/no-actions-hash.js index c3ae0a1d58..e99fc9cbe0 100644 --- a/lib/rules/no-actions-hash.js +++ b/lib/rules/no-actions-hash.js @@ -24,7 +24,7 @@ module.exports = { function reportActionsProp(properties) { const actionsProp = properties.find((property) => ember.isActionsProp(property)); if (actionsProp) { - context.report(actionsProp, ERROR_MESSAGE); + context.report({ node: actionsProp, message: ERROR_MESSAGE }); } } diff --git a/lib/rules/no-arrow-function-computed-properties.js b/lib/rules/no-arrow-function-computed-properties.js index 1cc3afb3fa..8a2ba49b10 100644 --- a/lib/rules/no-arrow-function-computed-properties.js +++ b/lib/rules/no-arrow-function-computed-properties.js @@ -71,10 +71,16 @@ module.exports = { if (onlyThisContexts) { if (isThisPresent) { - context.report(node.arguments[node.arguments.length - 1], ERROR_MESSAGE); + context.report({ + node: node.arguments[node.arguments.length - 1], + message: ERROR_MESSAGE, + }); } } else { - context.report(node.arguments[node.arguments.length - 1], ERROR_MESSAGE); + context.report({ + node: node.arguments[node.arguments.length - 1], + message: ERROR_MESSAGE, + }); } }, }; diff --git a/lib/rules/no-attrs-in-components.js b/lib/rules/no-attrs-in-components.js index a2cac71583..6f2ce49b60 100644 --- a/lib/rules/no-attrs-in-components.js +++ b/lib/rules/no-attrs-in-components.js @@ -54,7 +54,7 @@ module.exports = { MemberExpression(node) { if (currentEmberComponent && isThisAttrsExpression(node)) { - context.report(node.property, ERROR_MESSAGE); + context.report({ node: node.property, message: ERROR_MESSAGE }); } }, }; diff --git a/lib/rules/no-attrs-snapshot.js b/lib/rules/no-attrs-snapshot.js index 99cd6c1bdc..44e9f5892b 100644 --- a/lib/rules/no-attrs-snapshot.js +++ b/lib/rules/no-attrs-snapshot.js @@ -35,7 +35,7 @@ module.exports = { create(context) { const report = function (node) { - context.report(node, ERROR_MESSAGE); + context.report({ node, message: ERROR_MESSAGE }); }; return { diff --git a/lib/rules/no-classic-classes.js b/lib/rules/no-classic-classes.js index 526bc96081..ceac28e5f0 100644 --- a/lib/rules/no-classic-classes.js +++ b/lib/rules/no-classic-classes.js @@ -72,7 +72,7 @@ module.exports = { const additionalClassImports = options.additionalClassImports || []; function reportNode(node) { - context.report(node, ERROR_MESSAGE_NO_CLASSIC_CLASSES); + context.report({ node, message: ERROR_MESSAGE_NO_CLASSIC_CLASSES }); } return { diff --git a/lib/rules/no-classic-components.js b/lib/rules/no-classic-components.js index 1c982768bf..f3c7b8643d 100644 --- a/lib/rules/no-classic-components.js +++ b/lib/rules/no-classic-components.js @@ -23,7 +23,7 @@ module.exports = { create(context) { const report = function (node) { - context.report(node, ERROR_MESSAGE); + context.report({ node, message: ERROR_MESSAGE }); }; return { diff --git a/lib/rules/no-computed-properties-in-native-classes.js b/lib/rules/no-computed-properties-in-native-classes.js index 68d1bd4751..eee3a123bd 100644 --- a/lib/rules/no-computed-properties-in-native-classes.js +++ b/lib/rules/no-computed-properties-in-native-classes.js @@ -55,7 +55,7 @@ module.exports = { let computedNodes = []; const report = function (node) { - context.report(node, ERROR_MESSAGE); + context.report({ node, message: ERROR_MESSAGE }); }; return { diff --git a/lib/rules/no-controller-access-in-routes.js b/lib/rules/no-controller-access-in-routes.js index 5dbf2f4bbf..20b6a24ccc 100644 --- a/lib/rules/no-controller-access-in-routes.js +++ b/lib/rules/no-controller-access-in-routes.js @@ -77,7 +77,7 @@ module.exports = { node.property.name === 'controller' ) { // Example: this.controller; - context.report(node, ERROR_MESSAGE); + context.report({ node, message: ERROR_MESSAGE }); } }, @@ -99,7 +99,7 @@ module.exports = { node.callee.property.name === 'controllerFor' ) { // Example this.controllerFor(...); - context.report(node, ERROR_MESSAGE); + context.report({ node, message: ERROR_MESSAGE }); } if ( @@ -112,7 +112,7 @@ module.exports = { node.arguments[0].value === 'controller' ) { // Example: this.get('controller'); - context.report(node, ERROR_MESSAGE); + context.report({ node, message: ERROR_MESSAGE }); } if ( @@ -124,7 +124,7 @@ module.exports = { node.arguments[1].value === 'controller' ) { // Example: get(this, 'controller'); - context.report(node, ERROR_MESSAGE); + context.report({ node, message: ERROR_MESSAGE }); } if ( @@ -135,7 +135,7 @@ module.exports = { getPropertiesArgumentsIncludeController(node.arguments) ) { // Example: this.getProperties('controller'); - context.report(node, ERROR_MESSAGE); + context.report({ node, message: ERROR_MESSAGE }); } if ( @@ -145,7 +145,7 @@ module.exports = { getPropertiesArgumentsIncludeController(node.arguments.slice(1)) ) { // Example: getProperties(this, 'controller'); - context.report(node, ERROR_MESSAGE); + context.report({ node, message: ERROR_MESSAGE }); } }, diff --git a/lib/rules/no-controllers.js b/lib/rules/no-controllers.js index c9b36cbecb..d828c4b431 100644 --- a/lib/rules/no-controllers.js +++ b/lib/rules/no-controllers.js @@ -29,7 +29,7 @@ module.exports = { ember.isEmberController(context, node) && (node.body.body.length === 0 || !classDeclarationHasProperty(node, 'queryParams')) ) { - context.report(node, ERROR_MESSAGE); + context.report({ node, message: ERROR_MESSAGE }); } }, @@ -39,7 +39,7 @@ module.exports = { (node.arguments.length === 0 || !callExpressionClassHasProperty(node, 'queryParams', scopeManager)) ) { - context.report(node, ERROR_MESSAGE); + context.report({ node, message: ERROR_MESSAGE }); } }, }; diff --git a/lib/rules/no-current-route-name.js b/lib/rules/no-current-route-name.js index 2a7c7e8da0..d6035e461c 100644 --- a/lib/rules/no-current-route-name.js +++ b/lib/rules/no-current-route-name.js @@ -35,7 +35,7 @@ module.exports = { CallExpression(node) { const { callee } = node; if (callee.type === 'Identifier' && importAliases.includes(callee.name)) { - context.report(node, ERROR_MESSAGE); + context.report({ node, message: ERROR_MESSAGE }); } }, }; diff --git a/lib/rules/no-ember-testing-in-module-scope.js b/lib/rules/no-ember-testing-in-module-scope.js index 5eca088c1a..2c6659f4a5 100644 --- a/lib/rules/no-ember-testing-in-module-scope.js +++ b/lib/rules/no-ember-testing-in-module-scope.js @@ -45,14 +45,14 @@ module.exports = { node.parent.object.name === emberImportAliasName ) { if (context.getScope().variableScope.type === 'module') { - context.report(node.parent, ERROR_MESSAGES[0]); + context.report({ node: node.parent, message: ERROR_MESSAGES[0] }); } const nodeGrandParent = utils.getPropertyValue(node, 'parent.parent.type'); if ( nodeGrandParent === 'AssignmentExpression' || nodeGrandParent === 'VariableDeclarator' ) { - context.report(node.parent.parent, ERROR_MESSAGES[1]); + context.report({ node: node.parent.parent, message: ERROR_MESSAGES[1] }); } } }, @@ -66,7 +66,7 @@ module.exports = { ancestorNode.init.name === emberImportAliasName ) ) { - context.report(node.parent.parent.parent, ERROR_MESSAGES[2]); + context.report({ node: node.parent.parent.parent, message: ERROR_MESSAGES[2] }); } }, }; diff --git a/lib/rules/no-empty-attrs.js b/lib/rules/no-empty-attrs.js index 5321ba4902..57440e0a92 100644 --- a/lib/rules/no-empty-attrs.js +++ b/lib/rules/no-empty-attrs.js @@ -24,7 +24,7 @@ module.exports = { const filePath = context.getFilename(); const report = function (node) { - context.report(node, message); + context.report({ node, message }); }; const sourceCode = context.getSourceCode(); diff --git a/lib/rules/no-empty-glimmer-component-classes.js b/lib/rules/no-empty-glimmer-component-classes.js index 0eb00600d2..e38f41c527 100644 --- a/lib/rules/no-empty-glimmer-component-classes.js +++ b/lib/rules/no-empty-glimmer-component-classes.js @@ -27,7 +27,7 @@ module.exports = { return { ClassDeclaration(node) { if (isGlimmerComponent(context, node) && node.body.body.length === 0) { - context.report(node, ERROR_MESSAGE); + context.report({ node, message: ERROR_MESSAGE }); } }, }; diff --git a/lib/rules/no-function-prototype-extensions.js b/lib/rules/no-function-prototype-extensions.js index 7539483077..be85d9804e 100644 --- a/lib/rules/no-function-prototype-extensions.js +++ b/lib/rules/no-function-prototype-extensions.js @@ -34,7 +34,7 @@ module.exports = { }; const report = function (node) { - context.report(node, message); + context.report({ node, message }); }; return { diff --git a/lib/rules/no-get.js b/lib/rules/no-get.js index 4f7dc4e961..23278a3ffa 100644 --- a/lib/rules/no-get.js +++ b/lib/rules/no-get.js @@ -264,7 +264,7 @@ module.exports = { validateGetPropertiesArguments(node.arguments, ignoreNestedPaths) ) { // Example: this.getProperties('foo', 'bar'); - context.report(node, ERROR_MESSAGE_GET_PROPERTIES); + context.report({ node, message: ERROR_MESSAGE_GET_PROPERTIES }); } if ( @@ -274,7 +274,7 @@ module.exports = { validateGetPropertiesArguments(node.arguments.slice(1), ignoreNestedPaths) ) { // Example: getProperties(this, 'foo', 'bar'); - context.report(node, ERROR_MESSAGE_GET_PROPERTIES); + context.report({ node, message: ERROR_MESSAGE_GET_PROPERTIES }); } }, }; diff --git a/lib/rules/no-global-jquery.js b/lib/rules/no-global-jquery.js index 56749d9167..c43d68c7ca 100644 --- a/lib/rules/no-global-jquery.js +++ b/lib/rules/no-global-jquery.js @@ -30,7 +30,7 @@ module.exports = { const tracker = new ReferenceTracker(context.getScope()); for (const { node } of tracker.iterateGlobalReferences(globalMap)) { - context.report(node, ERROR_MESSAGE); + context.report({ node, message: ERROR_MESSAGE }); } }, }; diff --git a/lib/rules/no-incorrect-calls-with-inline-anonymous-functions.js b/lib/rules/no-incorrect-calls-with-inline-anonymous-functions.js index f2fd0934f8..7a0af09064 100644 --- a/lib/rules/no-incorrect-calls-with-inline-anonymous-functions.js +++ b/lib/rules/no-incorrect-calls-with-inline-anonymous-functions.js @@ -36,7 +36,7 @@ module.exports = { function checkArgumentsForInlineFunction(node) { for (const [index, argument] of node.arguments.entries()) { if (types.isAnyFunctionExpression(argument)) { - context.report(node.arguments[index], ERROR_MESSAGE); + context.report({ node: node.arguments[index], message: ERROR_MESSAGE }); } } } diff --git a/lib/rules/no-incorrect-computed-macros.js b/lib/rules/no-incorrect-computed-macros.js index ee6ee3e099..11db8bbd59 100644 --- a/lib/rules/no-incorrect-computed-macros.js +++ b/lib/rules/no-incorrect-computed-macros.js @@ -66,7 +66,7 @@ module.exports = { }, }); } else if (node.arguments.length === 0) { - context.report(node, ERROR_MESSAGE_AND_OR); + context.report({ node, message: ERROR_MESSAGE_AND_OR }); } } }, diff --git a/lib/rules/no-jquery.js b/lib/rules/no-jquery.js index 282d5671a0..c09d8361a7 100644 --- a/lib/rules/no-jquery.js +++ b/lib/rules/no-jquery.js @@ -27,7 +27,7 @@ module.exports = { create(context) { const report = function (node) { - context.report(node, ERROR_MESSAGE); + context.report({ node, message: ERROR_MESSAGE }); }; return { diff --git a/lib/rules/no-legacy-test-waiters.js b/lib/rules/no-legacy-test-waiters.js index bea59a49a5..e6d6fe3b30 100644 --- a/lib/rules/no-legacy-test-waiters.js +++ b/lib/rules/no-legacy-test-waiters.js @@ -39,7 +39,7 @@ module.exports = { node.callee.type === 'Identifier' && testWaitersIdentifiers.includes(node.callee.name) ) { - context.report(node, ERROR_MESSAGE); + context.report({ node, message: ERROR_MESSAGE }); } }, }; diff --git a/lib/rules/no-mixins.js b/lib/rules/no-mixins.js index 93d0630e9d..dd7f1b4225 100644 --- a/lib/rules/no-mixins.js +++ b/lib/rules/no-mixins.js @@ -27,7 +27,7 @@ module.exports = { ImportDeclaration(node) { const importPath = node.source.value; if (mixinPathRegex.test(importPath)) { - context.report(node, ERROR_MESSAGE); + context.report({ node, message: ERROR_MESSAGE }); } }, }; diff --git a/lib/rules/no-new-mixins.js b/lib/rules/no-new-mixins.js index 951da7deae..6b12f55dcd 100644 --- a/lib/rules/no-new-mixins.js +++ b/lib/rules/no-new-mixins.js @@ -27,13 +27,13 @@ module.exports = { return { CallExpression(node) { if (ember.isEmberMixin(context, node)) { - context.report(node, ERROR_MESSAGE); + context.report({ node, message: ERROR_MESSAGE }); } }, ClassDeclaration(node) { if (ember.isEmberMixin(context, node)) { - context.report(node, ERROR_MESSAGE); + context.report({ node, message: ERROR_MESSAGE }); } }, }; diff --git a/lib/rules/no-observers.js b/lib/rules/no-observers.js index 85df96fdc1..b8dae23685 100644 --- a/lib/rules/no-observers.js +++ b/lib/rules/no-observers.js @@ -27,7 +27,7 @@ module.exports = { create(context) { const report = function (node) { - context.report(node, ERROR_MESSAGE); + context.report({ node, message: ERROR_MESSAGE }); }; let importedEmberName = undefined; diff --git a/lib/rules/no-on-calls-in-components.js b/lib/rules/no-on-calls-in-components.js index 94de178124..ceec24cc6c 100644 --- a/lib/rules/no-on-calls-in-components.js +++ b/lib/rules/no-on-calls-in-components.js @@ -58,7 +58,7 @@ module.exports = { }; const report = function (node) { - context.report(node, message); + context.report({ node, message }); }; const sourceCode = context.getSourceCode(); diff --git a/lib/rules/no-proxies.js b/lib/rules/no-proxies.js index 56ec0080f5..fa13028727 100644 --- a/lib/rules/no-proxies.js +++ b/lib/rules/no-proxies.js @@ -28,7 +28,7 @@ module.exports = { node.source.value === '@ember/object/proxy' || node.source.value === '@ember/array/proxy' ) { - context.report(node, ERROR_MESSAGE); + context.report({ node, message: ERROR_MESSAGE }); } }, }; diff --git a/lib/rules/no-restricted-resolver-tests.js b/lib/rules/no-restricted-resolver-tests.js index f61ad51411..2ac6030466 100644 --- a/lib/rules/no-restricted-resolver-tests.js +++ b/lib/rules/no-restricted-resolver-tests.js @@ -119,7 +119,7 @@ module.exports = { } if (hasOnlyStringArgument(node)) { - context.report(node, getSingleStringArgumentMessage(fn)); + context.report({ node, message: getSingleStringArgumentMessage(fn) }); return; } @@ -127,17 +127,20 @@ module.exports = { const lastArgumentIsObject = types.isObjectExpression(lastArgument); if (lastArgumentIsObject && hasUnitTrue(lastArgument)) { - context.report(lastArgument, getNoUnitTrueMessage(fn)); + context.report({ node: lastArgument, message: getNoUnitTrueMessage(fn) }); return; } if (lastArgumentIsObject && hasNeeds(lastArgument)) { - context.report(lastArgument, getNoNeedsMessage(fn)); + context.report({ node: lastArgument, message: getNoNeedsMessage(fn) }); return; } if (lastArgumentIsObject && !hasIntegrationTrue(lastArgument)) { - context.report(lastArgument, getNoPOJOWithoutIntegrationTrueMessage(fn)); + context.report({ + node: lastArgument, + message: getNoPOJOWithoutIntegrationTrueMessage(fn), + }); } }; } diff --git a/lib/rules/no-side-effects.js b/lib/rules/no-side-effects.js index 936f8e6fbe..dd4292d5fe 100644 --- a/lib/rules/no-side-effects.js +++ b/lib/rules/no-side-effects.js @@ -178,7 +178,7 @@ module.exports = { let currentEmberClass; const report = function (node) { - context.report(node, ERROR_MESSAGE); + context.report({ node, message: ERROR_MESSAGE }); }; return { diff --git a/lib/rules/no-volatile-computed-properties.js b/lib/rules/no-volatile-computed-properties.js index e5e01f1a64..dd3fc13dec 100644 --- a/lib/rules/no-volatile-computed-properties.js +++ b/lib/rules/no-volatile-computed-properties.js @@ -43,7 +43,7 @@ module.exports = { types.isIdentifier(node.callee.property) && node.callee.property.name === 'volatile' ) { - context.report(node.callee.property, ERROR_MESSAGE); + context.report({ node: node.callee.property, message: ERROR_MESSAGE }); } }, }; diff --git a/lib/rules/require-fetch-import.js b/lib/rules/require-fetch-import.js index 58b5c882cd..aa1fe14cba 100644 --- a/lib/rules/require-fetch-import.js +++ b/lib/rules/require-fetch-import.js @@ -29,7 +29,7 @@ module.exports = { }; for (const { node } of tracker.iterateGlobalReferences(traceMap)) { - context.report(node, ERROR_MESSAGE); + context.report({ node, message: ERROR_MESSAGE }); } }, }; diff --git a/lib/rules/require-return-from-computed.js b/lib/rules/require-return-from-computed.js index 74f1558c1d..605f34329b 100644 --- a/lib/rules/require-return-from-computed.js +++ b/lib/rules/require-return-from-computed.js @@ -30,7 +30,7 @@ module.exports = { create(context) { const report = function (node) { - context.report(node, ERROR_MESSAGE); + context.report({ node, message: ERROR_MESSAGE }); }; let funcInfo = { diff --git a/lib/rules/require-tagless-components.js b/lib/rules/require-tagless-components.js index 24783f7555..0b55041d33 100644 --- a/lib/rules/require-tagless-components.js +++ b/lib/rules/require-tagless-components.js @@ -130,7 +130,10 @@ module.exports = { // Handle `.extend` being called with no arguments if (callExpression.arguments.length === 0) { - context.report(callExpression, ERROR_MESSAGE_REQUIRE_TAGLESS_COMPONENTS); + context.report({ + node: callExpression, + message: ERROR_MESSAGE_REQUIRE_TAGLESS_COMPONENTS, + }); } for (const arg of callExpression.arguments) { @@ -144,9 +147,15 @@ module.exports = { let tagNameNode; if ((tagNameNode = getNonEmptyTagNameInObjectExpression(resultingNode))) { - context.report(tagNameNode, ERROR_MESSAGE_REQUIRE_TAGLESS_COMPONENTS); + context.report({ + node: tagNameNode, + message: ERROR_MESSAGE_REQUIRE_TAGLESS_COMPONENTS, + }); } else if (hasNoTagNameInObjectExpression(resultingNode)) { - context.report(callExpression, ERROR_MESSAGE_REQUIRE_TAGLESS_COMPONENTS); + context.report({ + node: callExpression, + message: ERROR_MESSAGE_REQUIRE_TAGLESS_COMPONENTS, + }); } } }, @@ -161,15 +170,21 @@ module.exports = { let decorator; if ((tagNameNode = getNonEmptyTagNameInClassBody(node.body))) { - context.report(tagNameNode, ERROR_MESSAGE_REQUIRE_TAGLESS_COMPONENTS); + context.report({ + node: tagNameNode, + message: ERROR_MESSAGE_REQUIRE_TAGLESS_COMPONENTS, + }); } else if ((decorator = getDecoratorCallExpressionWithName(node, 'tagName'))) { const tagNameArg = decorator.expression.arguments[0]; if (isStringLiteral(tagNameArg) && tagNameArg.value !== '') { - context.report(decorator, ERROR_MESSAGE_REQUIRE_TAGLESS_COMPONENTS); + context.report({ + node: decorator, + message: ERROR_MESSAGE_REQUIRE_TAGLESS_COMPONENTS, + }); } } else if (hasNoTagNameInClassBody(node.body)) { - context.report(node.body, ERROR_MESSAGE_REQUIRE_TAGLESS_COMPONENTS); + context.report({ node: node.body, message: ERROR_MESSAGE_REQUIRE_TAGLESS_COMPONENTS }); } } }, diff --git a/lib/rules/routes-segments-snake-case.js b/lib/rules/routes-segments-snake-case.js index 2db5fd38bd..0950e46f96 100644 --- a/lib/rules/routes-segments-snake-case.js +++ b/lib/rules/routes-segments-snake-case.js @@ -31,7 +31,7 @@ module.exports = { const routeSegmentRegex = /:([\w-]+)/g; const report = function (node) { - context.report(node, message); + context.report({ node, message }); }; const isSegment = function (property) { diff --git a/lib/rules/use-ember-data-rfc-395-imports.js b/lib/rules/use-ember-data-rfc-395-imports.js index afb9516787..48629c62d7 100644 --- a/lib/rules/use-ember-data-rfc-395-imports.js +++ b/lib/rules/use-ember-data-rfc-395-imports.js @@ -102,7 +102,7 @@ module.exports = { } if (node.source.value === 'ember-data' || node.source.value.startsWith('ember-data/')) { - context.report(node, message); + context.report({ node, message }); } }, @@ -132,7 +132,7 @@ module.exports = { match, type: item.type, }); - context.report(item, message); + context.report({ node: item, message }); } } }, @@ -165,7 +165,7 @@ module.exports = { // JS module import for it, so do not report the error if (match) { const message = buildMessage({ node, fullName, key, match }); - context.report(node, message); + context.report({ node, message }); break; } }