From 255770199e9fba5087f4bdc6b1b4595cb6093812 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Fri, 29 Dec 2023 14:59:17 -0500 Subject: [PATCH] fix lint:fix eh --- ...no-deprecated-router-transition-methods.js | 4 +++ package.json | 3 +- ...no-deprecated-router-transition-methods.js | 2 +- yarn.lock | 34 +++++++++++++++++++ 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/lib/rules/no-deprecated-router-transition-methods.js b/lib/rules/no-deprecated-router-transition-methods.js index a2df455b86..b4a47e7e2c 100644 --- a/lib/rules/no-deprecated-router-transition-methods.js +++ b/lib/rules/no-deprecated-router-transition-methods.js @@ -187,6 +187,10 @@ module.exports = { const currentClass = classStack.peek(); + if (!currentClass) { + return; + } + if (types.isThisExpression(node.object) && types.isIdentifier(node.property)) { // Routes should not call transitionTo or replaceWith const propertyName = node.property.name; diff --git a/package.json b/package.json index 870522220a..7379be1795 100644 --- a/package.json +++ b/package.json @@ -73,6 +73,7 @@ }, "dependencies": { "@ember-data/rfc395-data": "^0.0.4", + "@glimmer/syntax": "^0.86.0", "css-tree": "^2.3.1", "ember-eslint-parser": "^0.2.3", "ember-rfc176-data": "^0.3.18", @@ -162,4 +163,4 @@ "tokenRef": "GITHUB_AUTH" } } -} \ No newline at end of file +} diff --git a/tests/lib/rules/no-deprecated-router-transition-methods.js b/tests/lib/rules/no-deprecated-router-transition-methods.js index b5968b7cc5..ff51b524be 100644 --- a/tests/lib/rules/no-deprecated-router-transition-methods.js +++ b/tests/lib/rules/no-deprecated-router-transition-methods.js @@ -381,7 +381,7 @@ ruleTester.run('no-deprecated-router-transition-methods', rule, { }); `, - } + }, ], invalid: [ // Route Uses RouterService.transitionTo with different service injection types diff --git a/yarn.lock b/yarn.lock index dee6e7ffc1..34f2c50902 100644 --- a/yarn.lock +++ b/yarn.lock @@ -444,6 +444,13 @@ dependencies: "@simple-dom/interface" "^1.4.0" +"@glimmer/interfaces@^0.86.0": + version "0.86.0" + resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.86.0.tgz#3081ba6e4bae6f402aae0c27acb4743dec75ffb6" + integrity sha512-qKPb8ivmzQtgvBbFJn/rS3E/1wtiSJ9EG4WA+j3uxUSZqbR4oKTNR2IhwPnopLON1jASBHh+aonczvcvpGNLwA== + dependencies: + "@simple-dom/interface" "^1.4.0" + "@glimmer/syntax@^0.85.13": version "0.85.13" resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.85.13.tgz#841e6da0a555252f087145f83f92cf0d9cf76cb5" @@ -455,6 +462,17 @@ "@handlebars/parser" "~2.0.0" simple-html-tokenizer "^0.5.11" +"@glimmer/syntax@^0.86.0": + version "0.86.0" + resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.86.0.tgz#c3affed94c8e6c8d5a7b81228d62fbe261869c1a" + integrity sha512-ZjT59PEb69QMqE+EJSdeYoHCT5d1LElJjYOtu0q/+6h9zsaEZIUYsHdFJWNvTs3cLMcGIg2ae4KWfGwZtexn/g== + dependencies: + "@glimmer/interfaces" "^0.86.0" + "@glimmer/util" "^0.86.0" + "@glimmer/wire-format" "^0.86.0" + "@handlebars/parser" "~2.0.0" + simple-html-tokenizer "^0.5.11" + "@glimmer/util@^0.85.13": version "0.85.13" resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.85.13.tgz#a17824e5fd91e4e3f3847f38f600ecd3c1508dad" @@ -463,6 +481,14 @@ "@glimmer/env" "0.1.7" "@glimmer/interfaces" "^0.85.13" +"@glimmer/util@^0.86.0": + version "0.86.0" + resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.86.0.tgz#4adcdedac10941d7321511c414d85e6bcab22305" + integrity sha512-KXwGBaMvHhapWaITGMCMKuNaaNAH4DjezY1oAwfF/eRBO43sp1g93kO88e+aJ90waftN7IKAMymGrPrHg22ibw== + dependencies: + "@glimmer/env" "0.1.7" + "@glimmer/interfaces" "^0.86.0" + "@glimmer/wire-format@^0.85.13": version "0.85.13" resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.85.13.tgz#a8df8c44646b8f0d09dda187ac64f45c33904b63" @@ -471,6 +497,14 @@ "@glimmer/interfaces" "^0.85.13" "@glimmer/util" "^0.85.13" +"@glimmer/wire-format@^0.86.0": + version "0.86.0" + resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.86.0.tgz#f6023baba66f8f1772cbcb1c750a56ce1fc65f6e" + integrity sha512-nI37pUNlLrEPDtCR8fxc6aEZ1NqVG5A5FWmd04Qg5gSb41dziq97lYyXbkWsOojWmL6ciYFfacpz5FlPNxgnJw== + dependencies: + "@glimmer/interfaces" "^0.86.0" + "@glimmer/util" "^0.86.0" + "@handlebars/parser@~2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@handlebars/parser/-/parser-2.0.0.tgz#5e8b7298f31ff8f7b260e6b7363c7e9ceed7d9c5"