Skip to content

[naming-convention] How to broaden the format after using the "default" selector #1453

@doberkofler

Description

@doberkofler

I love the new naming-convention rule but struggle in understanding how to use it:

'@typescript-eslint/naming-convention': [
	'warn',
	{
		selector: 'default',
		format: ['camelCase']
	},
	{
		selector: 'property',
	},
]

In the above snipped I defined camelCase as the default format and would (for example) like to relax the rule for properties and allow any type of identifier.
The documentation suggests that it is allowed to omit the format property or use an empty array but all options report a error. How would I solve this problem?

Versions

package version
@typescript-eslint/eslint-plugin 2.16.0
@typescript-eslint/parser 2.16.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement: plugin rule optionNew rule option for an existing eslint-plugin rulehas prthere is a PR raised to close thispackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions