MCPcopy Index your code
hub / github.com/ember-cli/ember-cli / jshintAddonTree

Function jshintAddonTree

lib/models/addon.js:1164–1221  ·  view source on GitHub ↗

Returns a tree with JSHint output for all addon JS. @private @method jshintAddonTree @return {Tree} Tree with JShint output (tests)

()

Source from the content-addressed store, hash-verified

1162 @return {Tree} Tree with JShint output (tests)
1163 */
1164 jshintAddonTree() {
1165 let trees = [];
1166
1167 let addonPath = this._treePathFor('addon');
1168 if (fs.existsSync(addonPath)) {
1169 let addonJs = new Funnel(addonPath, {
1170 exclude: ['templates/**/*'],
1171 destDir: 'addon',
1172 allowEmpty: true,
1173 });
1174 let lintAddonJsTrees = this._eachProjectAddonInvoke('lintTree', ['addon', addonJs]);
1175
1176 let addonTemplates = new Funnel(this._addonTemplateFiles(addonPath), {
1177 srcDir: `${this.moduleName()}/templates`,
1178 destDir: 'addon/templates',
1179 allowEmpty: true,
1180 });
1181 let lintTemplateTrees = this._eachProjectAddonInvoke('lintTree', ['templates', addonTemplates]);
1182
1183 trees = trees.concat(lintAddonJsTrees, lintTemplateTrees);
1184 }
1185
1186 let addonTestSupportPath = this._treePathFor('addon-test-support');
1187 if (fs.existsSync(addonTestSupportPath)) {
1188 let addonTestSupportTree = new Funnel(addonTestSupportPath, { destDir: 'addon-test-support' });
1189 let lintAddonTestSupportJsTrees = this._eachProjectAddonInvoke('lintTree', [
1190 'addon-test-support',
1191 addonTestSupportTree,
1192 ]);
1193 trees = trees.concat(lintAddonTestSupportJsTrees);
1194 }
1195
1196 let appPath = this._treePathFor('app');
1197 if (fs.existsSync(appPath)) {
1198 let appTree = new Funnel(appPath, { destDir: 'app' });
1199 let lintAppJsTrees = this._eachProjectAddonInvoke('lintTree', ['app', appTree]);
1200 trees = trees.concat(lintAppJsTrees);
1201 }
1202
1203 let testSupportPath = this._treePathFor('test-support');
1204 if (fs.existsSync(testSupportPath)) {
1205 let testSupportTree = new Funnel(testSupportPath, { destDir: 'test-support' });
1206 let lintTestSupportJsTrees = this._eachProjectAddonInvoke('lintTree', ['test-support', testSupportTree]);
1207 trees = trees.concat(lintTestSupportJsTrees);
1208 }
1209
1210 let lintTrees = trees.filter(Boolean);
1211 let lintedAddon = mergeTrees(lintTrees, {
1212 overwrite: true,
1213 annotation: 'TreeMerger (addon-lint)',
1214 });
1215
1216 return new Funnel(lintedAddon, {
1217 srcDir: '/',
1218 destDir: `${this.name}/tests/`,
1219 annotation: `Funnel: Addon#jshintAddonTree(${this.name})`,
1220 });
1221 },

Callers

nothing calls this directly

Calls 1

filterMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…