routie dev init since i didn't adhere to any proper guidance up until now

This commit is contained in:
2026-04-29 22:27:29 -06:00
commit e1dabb71e2
15301 changed files with 3562618 additions and 0 deletions
@@ -0,0 +1,34 @@
import simpleArraySearchRule from './shared/simple-array-search-rule.js';
const indexOfOverFindIndexRule = simpleArraySearchRule({
method: 'findIndex',
replacement: 'indexOf',
});
const lastIndexOfOverFindLastIndexRule = simpleArraySearchRule({
method: 'findLastIndex',
replacement: 'lastIndexOf',
});
/** @type {import('eslint').Rule.RuleModule} */
const config = {
create(context) {
indexOfOverFindIndexRule.listen(context);
lastIndexOfOverFindLastIndexRule.listen(context);
},
meta: {
type: 'suggestion',
docs: {
description: 'Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.',
recommended: 'unopinionated',
},
fixable: 'code',
hasSuggestions: true,
messages: {
...indexOfOverFindIndexRule.messages,
...lastIndexOfOverFindLastIndexRule.messages,
},
},
};
export default config;