File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,6 +18,11 @@ function isFile(loc) {
1818}
1919
2020module . exports = class Prettier extends Rule {
21+ constructor ( options ) {
22+ super ( options ) ;
23+ this . filePath = options . moduleName + ".hbs" ;
24+ }
25+
2126 visitor ( ) {
2227 return {
2328 Program : {
@@ -33,7 +38,15 @@ module.exports = class Prettier extends Rule {
3338 }
3439
3540 const source = this . sourceForNode ( node ) ;
36- const filepath = this . templateEnvironmentData . moduleName + ".hbs" ;
41+ // Following
42+ // https://github.com/ember-template-lint/ember-template-lint/commit/a7bf55cf36ee90d0460e7cb94e7ca4731aaa4be7
43+ // `templateEnvironmentData` is deprecated (in v1.8.0).
44+ // This code aims at remaining compatible with
45+ // ember-template-lint@>=1.3.0. The ternary might be removed when
46+ // upgrading the peerDependency to ember-template-lint@2.
47+ let filepath = this . filePath
48+ ? this . filePath
49+ : this . templateEnvironmentData . moduleName + ".hbs" ;
3750
3851 if ( ! prettier ) {
3952 // Prettier is expensive to load, so only load it if needed.
You can’t perform that action at this time.
0 commit comments