-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Labels
Description
Which @ngrx/* package(s) are the source of the bug?
eslint-plugin
Minimal reproduction of the bug/regression with instructions
After upgrading NgRx packages (including @ngrx/eslint-plugin) to the latest version, the rule @ngrx/prefix-selectors-with-select started reporting false positives for variables that are NOT NgRx selectors.
Example (spec file):
// Not a selector – just a plain data wrapper object typed with a generic containing 'Selector'
type RowSelector<T> = { row: T };
interface ItemData {
id: number;
name: string;
active: boolean;
}
// Variable is just a data container, not created via createSelector
const item: RowSelector<ItemData> = {
row: {
id: 1,
name: 'Test',
active: false,
},
};
// Lint error:
// Selector should start with 'select'
The variable isn’t produced by createSelector / createFeatureSelector / createSignalSelector. The rule appears to treat any identifier or type whose text includes Selector as an NgRx selector.
Expected behavior
Only actual NgRx selectors (returned from NgRx selector factory functions) should be enforced.
Versions of NgRx, Angular, Node, affected browser(s) and operating system(s)
NgRx: 20.1.0
Angular: 20.3.7
eslint: 9.38.0
Other information
No response
I would be willing to submit a PR to fix this issue
- Yes
- No
Copilot