@@ -16,8 +16,7 @@ const TRACKED_BUILT_INS_MAPPING = {
1616const TRACKED_BUILT_INS_MODULE = 'tracked-built-ins' ;
1717const EMBER_REACTIVE_MODULE = '@ember/reactive' ;
1818
19- const ERROR_MESSAGE_IMPORT =
20- 'Use imports from `@ember/reactive` instead of `tracked-built-ins`.' ;
19+ const ERROR_MESSAGE_IMPORT = 'Use imports from `@ember/reactive` instead of `tracked-built-ins`.' ;
2120
2221//------------------------------------------------------------------------------
2322// Rule Definition
@@ -28,8 +27,7 @@ module.exports = {
2827 meta : {
2928 type : 'suggestion' ,
3029 docs : {
31- description :
32- 'enforce usage of `@ember/reactive` imports instead of `tracked-built-ins`' ,
30+ description : 'enforce usage of `@ember/reactive` imports instead of `tracked-built-ins`' ,
3331 category : 'Ember Octane' ,
3432 recommended : false ,
3533 url : 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-tracked-built-ins.md' ,
@@ -64,19 +62,13 @@ module.exports = {
6462
6563 // Only autofix named imports we know how to map
6664 const namedSpecifiers = specifiers . filter (
67- ( s ) =>
68- s . type === 'ImportSpecifier' &&
69- s . imported . name in TRACKED_BUILT_INS_MAPPING
65+ ( s ) => s . type === 'ImportSpecifier' && s . imported . name in TRACKED_BUILT_INS_MAPPING
7066 ) ;
7167
7268 // If there's a default import or unknown named imports, we can't fully autofix
73- const hasDefault = specifiers . some (
74- ( s ) => s . type === 'ImportDefaultSpecifier'
75- ) ;
69+ const hasDefault = specifiers . some ( ( s ) => s . type === 'ImportDefaultSpecifier' ) ;
7670 const unknownNamed = specifiers . filter (
77- ( s ) =>
78- s . type === 'ImportSpecifier' &&
79- ! ( s . imported . name in TRACKED_BUILT_INS_MAPPING )
71+ ( s ) => s . type === 'ImportSpecifier' && ! ( s . imported . name in TRACKED_BUILT_INS_MAPPING )
8072 ) ;
8173
8274 if ( hasDefault || unknownNamed . length > 0 || namedSpecifiers . length === 0 ) {
@@ -113,10 +105,7 @@ module.exports = {
113105 } ,
114106
115107 NewExpression ( node ) {
116- if (
117- node . callee . type === 'Identifier' &&
118- trackedIdentifiers . has ( node . callee . name )
119- ) {
108+ if ( node . callee . type === 'Identifier' && trackedIdentifiers . has ( node . callee . name ) ) {
120109 const oldName = node . callee . name ;
121110 const { newName, isAliased } = trackedIdentifiers . get ( oldName ) ;
122111
0 commit comments