Skip to content

Commit

Permalink
Disable no-curly-component-invocation and no-implicit-this rules …
Browse files Browse the repository at this point in the history
…for `gjs` / `gts` files (#2844)Co-authored-by: Bryan Mishkin <698306+bmish@users.noreply.github.com>

* Start adding gjs/gts overrides to the recommended config, per: #2830

Normally this would be a breaking change under any other circumstances, but gjs/gts folks need to disable these rules anyway, so this is more a bugfix.

* Update recommended.js

* Remove trailing invisible characters

---------

Co-authored-by: Bryan Mishkin <698306+bmish@users.noreply.github.com>
  • Loading branch information
NullVoxPopuli and bmish committed Mar 15, 2023
1 parent d5225ce commit f49d3e5
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib/config/recommended.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,25 @@ export default {
'style-concatenation': 'error',
'table-groups': 'error',
},
overrides: [
{
files: ['**/*.gjs', '**/*.gts'],
rules: {
// in gjs/gts, curly-component-invocation, and no-implicit-this were incorrectly triggered,
// because {{foo}}, which is ambiguous in loose-mode templates could have "foo" defined in JS scope.
// For example:
//
// const foo = "hello there";
// <template>{{foo}}</template>
//
// template-lint *only* looks at what is between the <template> tags, and doesn't know about the surrounding context.
// so these two rules are regularly false-negatives.
// additionally, because eslint-plugin-ember looks at the intermediate/transformed code of <template>,
// eslint is responsible for reporting when "foo" would be undefined (which is the only thing it can be (other than defined)
// in strict mode -- there is no implicit this ever)
'no-curly-component-invocation': 'off',
'no-implicit-this': 'off',
},
},
],
};

0 comments on commit f49d3e5

Please sign in to comment.