@@ -175,24 +175,30 @@ module.exports = {
175175 } ,
176176
177177 create ( context ) {
178+ const filename = context . filename ?? context . getFilename ( ) ;
179+ const isStrictMode = filename . endsWith ( '.gjs' ) || filename . endsWith ( '.gts' ) ;
180+
178181 const rawConfig = context . options [ 0 ] ;
179182 let config ;
180183
184+ // In strict mode (gjs/gts), Input/Textarea could be custom components —
185+ // prefer false negatives over false positives, matching ember-template-lint.
186+ const defaultElementAttributes = isStrictMode
187+ ? DEFAULT_ELEMENT_ATTRIBUTES
188+ : mergeObjects ( DEFAULT_ELEMENT_ATTRIBUTES , BUILTIN_COMPONENT_ATTRIBUTES ) ;
189+
181190 if ( Array . isArray ( rawConfig ) ) {
182191 config = {
183192 allowlist : sanitizeConfigArray ( [ ...rawConfig , ...DEFAULT_ALLOWLIST ] ) ,
184193 globalAttributes : [ ...DEFAULT_GLOBAL_ATTRIBUTES ] ,
185- elementAttributes : mergeObjects ( DEFAULT_ELEMENT_ATTRIBUTES , BUILTIN_COMPONENT_ATTRIBUTES ) ,
194+ elementAttributes : defaultElementAttributes ,
186195 ignoredElements : [ ...IGNORED_ELEMENTS ] ,
187196 } ;
188197 } else if ( rawConfig && typeof rawConfig === 'object' ) {
189198 config = {
190199 allowlist : sanitizeConfigArray ( [ ...( rawConfig . allowlist || [ ] ) , ...DEFAULT_ALLOWLIST ] ) ,
191200 globalAttributes : [ ...( rawConfig . globalAttributes || [ ] ) , ...DEFAULT_GLOBAL_ATTRIBUTES ] ,
192- elementAttributes : mergeObjects (
193- rawConfig . elementAttributes ,
194- mergeObjects ( DEFAULT_ELEMENT_ATTRIBUTES , BUILTIN_COMPONENT_ATTRIBUTES )
195- ) ,
201+ elementAttributes : mergeObjects ( rawConfig . elementAttributes , defaultElementAttributes ) ,
196202 ignoredElements : [
197203 ...sanitizeConfigArray ( rawConfig . ignoredElements || [ ] ) ,
198204 ...IGNORED_ELEMENTS ,
@@ -202,7 +208,7 @@ module.exports = {
202208 config = {
203209 allowlist : [ ...DEFAULT_ALLOWLIST ] ,
204210 globalAttributes : [ ...DEFAULT_GLOBAL_ATTRIBUTES ] ,
205- elementAttributes : mergeObjects ( DEFAULT_ELEMENT_ATTRIBUTES , BUILTIN_COMPONENT_ATTRIBUTES ) ,
211+ elementAttributes : defaultElementAttributes ,
206212 ignoredElements : [ ...IGNORED_ELEMENTS ] ,
207213 } ;
208214 }
0 commit comments