diff --git a/projects/igniteui-angular/eslint.config.mjs b/projects/igniteui-angular/eslint.config.mjs index e3dadf05130..6305a85c5ca 100644 --- a/projects/igniteui-angular/eslint.config.mjs +++ b/projects/igniteui-angular/eslint.config.mjs @@ -25,10 +25,21 @@ export default [ style: "kebab-case", }], - "@angular-eslint/directive-selector": ["error", { - type: ["attribute", "element"], - prefix: ["igx", "igc"], - }], + // Separate configs for element (kebab-case) and attribute (camelCase) selectors. + // 'ig' prefix only used for attribute selectors (e.g., [igSize]). + // 'excel', 'csv', 'pdf' prefixes used for toolbar export directives. + "@angular-eslint/directive-selector": ["error", [ + { + type: "element", + prefix: ["igx", "igc", "excel", "csv", "pdf"], + style: "kebab-case", + }, + { + type: "attribute", + prefix: ["igx", "igc", "ig", "excel", "csv", "pdf"], + style: "camelCase", + } + ]], "@angular-eslint/no-input-rename": "off", "@typescript-eslint/consistent-type-definitions": "error", @@ -50,6 +61,24 @@ export default [ "no-debugger": "error", }, }, + // Override for files with compound selectors (element[attribute]) that confuse the selector rule + { + files: [ + "**/columns/validators.directive.ts", + "**/form-control/form-control.directive.ts", + ], + rules: { + "@angular-eslint/directive-selector": "off", + }, + }, + // Override for test files with non-standard selectors + { + files: ["**/*.spec.ts"], + rules: { + "@angular-eslint/component-selector": "off", + "@angular-eslint/directive-selector": "off", + }, + }, ...compat.extends( "plugin:@angular-eslint/template/recommended", ).map(config => ({