{"record":{"id":"c06a48b905b933e9","repo":"balderdashy/sails","slug":"filepath","errorCode":null,"errorMessage":"- ${filePath}","messagePattern":"- \\$\\{filePath\\}","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"lib/app/private/controller/load-action-modules.js","lineNumber":185,"sourceCode":"        // Otherwise give up on this file, it's GARBAGE.\n        // No, no, it's probably a very nice file but it's\n        // no controller as far as we're concerned.\n        else {\n          garbage.push(filePath);\n        } // </ it is garbage>\n\n      }); // </each(file from includeAll)>\n\n\n      // Complain about garbage.\n      if (garbage.length) {\n        sails.log.warn('---------------------------------------------------------------------------');\n        sails.log.warn('Files in the `controllers` directory may be traditional controllers or \\n' +\n                     'action files.  Traditional controllers are dictionaries of actions, with \\n' +\n                     'pascal-cased filenames ending in \"Controller\" (e.g. MyGreatController.js).\\n' +\n                     'Action files are kebab-cased (e.g. do-stuff.js) and contain a single action.\\n'+\n                     'The following file'+(garbage.length > 1 ? 's were' : ' was')+' ignored for not meeting those criteria:');\n        _.each(garbage, function(filePath){sails.log.warn('- '+filePath);});\n        sails.log.warn('----------------------------------------------------------------------------\\n');\n      }\n\n      // (Shallow) merge stuff from sails.config.controllers.moduleDefinitions on top of any loaded files.\n      // Note that the third argument (force) to `helpRegisterAction` is `true`, so there's no danger\n      // of identity conflicts.  Actions defined in `moduleDefinitions` will override anything else.\n      _.each(_.get(sails, 'config.controllers.moduleDefinitions') || {}, function(action, actionIdentity) {\n        helpRegisterAction(sails, action, actionIdentity, true);\n      });\n\n    } catch (e) { return cb(e); }\n\n    // Get a list of the action identities.\n    var actionIdentities = _.keys(sails._actions);\n\n    // Flag indicating that warnings were raised (for formatting purposes).\n    var raisedWarnings = false;\n","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/balderdashy/sails/blob/7b76422cc27823df033572bdda5c4910a68b697f/lib/app/private/controller/load-action-modules.js#L167-L203","documentation":"This warning line is one entry ('- <filePath>') of the per-file list printed after the controllers naming-convention warning. Each ignored 'garbage' file in api/controllers gets its own line so the developer can see exactly which files were skipped during loading.","triggerScenarios":"Iterates over the garbage array produced while loading api/controllers — one line per file that did not match the controller or action-file naming conventions.","commonSituations":"Same as the header warning: misnamed files in api/controllers such as underscored names, camelCase names, spaces, or stray non-conforming files.","solutions":["Rename the file printed on this line to the kebab-case action convention or the PascalCase Controller convention.","Delete it if it is a leftover/backup file.","Relocate genuine shared code out of api/controllers."],"exampleFix":"// before (warning line)\n- api/controllers/MyController.old.js\n// after (rename or delete)\napi/controllers/my-controller.js","handlingStrategy":"validation","validationCode":"const bad = fs.readdirSync('api/controllers').filter(f => !/^(^[A-Z][A-Za-z0-9]*Controller|[a-z0-9]+(-[a-z0-9]+)*)\\.js$/.test(f));\nbad.forEach(f => console.warn(`Rename or remove api/controllers/${f}`));","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Fix each '- <file>' line the warning prints — those files are silently ignored at runtime.","Delete backup/old files rather than leaving them in api/controllers.","Add filename-convention checks to code review or CI."],"tags":["controllers","file-naming","ignored-files"],"backgroundTag":"invalid-filename-convention","analyzedSha":"7b76422cc27823df033572bdda5c4910a68b697f","analyzedAt":"2026-09-01T04:01:57.104Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}