2
2
3
3
/* eslint-env node */
4
4
5
+ const { TEMPLATE_TAG_PLACEHOLDER } = require ( 'ember-template-imports/src/util' ) ;
6
+
5
7
module . exports = {
6
8
root : true ,
7
9
parser : "@babel/eslint-parser" ,
@@ -84,6 +86,7 @@ module.exports = {
84
86
2 ,
85
87
{
86
88
order : [
89
+ "[template-tag]" ,
87
90
"[static-properties]" ,
88
91
"[static-methods]" ,
89
92
"[injected-services]" ,
@@ -95,6 +98,16 @@ module.exports = {
95
98
"[everything-else]" ,
96
99
] ,
97
100
groups : {
101
+ // https://github.com/ember-cli/eslint-plugin-ember/issues/1896
102
+ // This only sort of works: in addition to the issues mentioned
103
+ // above, it doesn't seem to reliably enforce the order, e.g.
104
+ // [injected-services] -> <template> -> [injected-services]
105
+ // doesn't seem to trigger the error. That being said, it does
106
+ // work sometimes and this is needed to avoid emitting errors
107
+ // in the limited cases where it does work.
108
+ "template-tag" : [
109
+ { type : "property" , name : `/${ TEMPLATE_TAG_PLACEHOLDER } /` } ,
110
+ ] ,
98
111
"injected-services" : [
99
112
{ groupByDecorator : "service" , type : "property" } ,
100
113
] ,
@@ -114,4 +127,17 @@ module.exports = {
114
127
} ,
115
128
] ,
116
129
} ,
130
+
131
+ // https://github.com/ember-cli/eslint-plugin-ember/issues/1895
132
+ // We may eventually be able to drop this by extending the base
133
+ // config from eslint-plugin-ember. In the meantime, this
134
+ overrides : [
135
+ {
136
+ files : [ '**/*.gjs' , '**/*.gts' ] ,
137
+ processor : 'ember/<template>' ,
138
+ globals : {
139
+ [ TEMPLATE_TAG_PLACEHOLDER ] : 'readonly' ,
140
+ } ,
141
+ } ,
142
+ ] ,
117
143
} ;
0 commit comments