File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,11 @@ function isFile(loc) {
18
18
}
19
19
20
20
module . exports = class Prettier extends Rule {
21
+ constructor ( options ) {
22
+ super ( options ) ;
23
+ this . filePath = options . moduleName + ".hbs" ;
24
+ }
25
+
21
26
visitor ( ) {
22
27
return {
23
28
Program : {
@@ -33,7 +38,15 @@ module.exports = class Prettier extends Rule {
33
38
}
34
39
35
40
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" ;
37
50
38
51
if ( ! prettier ) {
39
52
// Prettier is expensive to load, so only load it if needed.
You can’t perform that action at this time.
0 commit comments