Skip to content

Parser error: angular/file-name #453

@tpeiffer

Description

@tpeiffer

Hello,

Given this file - app.module.js
`(function () {

var mod = 'shared.sales';

angular.module(mod + '.core.angular', ['ngCookies', 'ngRoute', 'ngLocale', 'ngResource', 'ngAnimate', 'ngSanitize', 'ngMessages', 'ngIOS9UIWebViewPatch']);

angular.module(mod + '.thirdparty', ['tmh.dynamicLocale', 'gettext', 'ngMaterial', 'md.data.table', 'fixed.table.header', 'as.sortable', 'ngCsv', 'telemetry']);

angular.module(mod, [mod + '.core.angular', mod + '.thirdparty']);

})();`

And these settings in my .eslintrc
'angular/file-name': [Warn, { 'typeSeparator': 'dot', ignorePrefix: 'fs', 'ignoreTypeSuffix': true }],

I get the following error
TypeError: Cannot read property 'length' of undefined at Object.removeTypeSuffix (c:\tfs\FieldSales\Connex\trunk\UI.Shared\node_modules\eslint-plugin-angular\rules\file-name.js:66:46) at Object.createExpectedName (c:\tfs\FieldSales\Connex\trunk\UI.Shared\node_modules\eslint-plugin-angular\rules\file-name.js:97:41) at EventEmitter.CallExpression (c:\tfs\FieldSales\Connex\trunk\UI.Shared\node_modules\eslint-plugin-angular\rules\file-name.js:130:53) at emitOne (events.js:101:20) at EventEmitter.emit (events.js:188:7) at NodeEventGenerator.enterNode (c:\tfs\FieldSales\Connex\trunk\UI.Shared\node_modules\eslint\lib\util\node-event-generator.js:39:22) at CodePathAnalyzer.enterNode (c:\tfs\FieldSales\Connex\trunk\UI.Shared\node_modules\eslint\lib\code-path-analysis\code-path-analyzer.js:607:23) at CommentEventGenerator.enterNode (c:\tfs\FieldSales\Connex\trunk\UI.Shared\node_modules\eslint\lib\util\comment-event-generator.js:98:23) at Controller.enter (c:\tfs\FieldSales\Connex\trunk\UI.Shared\node_modules\eslint\lib\eslint.js:928:36) at Controller.__execute (c:\tfs\FieldSales\Connex\trunk\UI.Shared\node_modules\eslint\node_modules\estraverse\estraverse.js:397:31)

I haven't fully tracked down the piece of code that is parsing the file incorrectly, but I will do that and update this ticket.

Thanks!

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions