Skip to content

func-style ignores function expressions not starting with var keyword #7941

@kiranjholla

Description

@kiranjholla

The func-style rule has been set to enforce use of function declarations.

var eslintConfig = {
	'root': true,
	'env': {
		'browser': true
	},
	'extends': 'eslint:recommended',
	'rules': {
		/** Coding Style Standards **/
		'func-style': ['error', 'declaration', { 'allowArrowFunctions': true }]
	}
}

module.exports = eslintConfig;

I would expect that with this configuration, code such as the one below would lead to an error. But it doesn't.

var fnVariable;

fnVariable = function() {
      return true;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    archived due to ageThis issue has been archived; please open a new issue for any further discussionevaluatingThe team will evaluate this issue to decide whether it meets the criteria for inclusionruleRelates to ESLint's core rules

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions