Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/rules/template-deprecated-inline-view-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ module.exports = {
},

create(context) {
const isStrictMode = context.filename.endsWith('.gjs') || context.filename.endsWith('.gts');
if (isStrictMode) {
return {};
}

const sourceCode = context.sourceCode;

// Track block param names to avoid false positives on locals like:
Expand Down
9 changes: 9 additions & 0 deletions tests/lib/rules/template-deprecated-inline-view-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ ruleTester.run('template-deprecated-inline-view-helper', rule, {
'<template>{{yield hash=view.foo}}</template>',
// hash pair with key "to" should not be flagged
'<template>{{some-component to=view.foo}}</template>',
// Rule is HBS-only: `view` in GJS/GTS may be a legitimate imported JS binding
{
filename: 'test.gjs',
code: "<template>{{view 'awful-fishsticks'}}</template>",
},
{
filename: 'test.gts',
code: '<template>{{view.bad-fishsticks}}</template>',
},
],
invalid: [
{
Expand Down
Loading