sonarjs/no-associative-arrays
eslint-plugin-sonarjs
No autofixRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/no-associative-arrays": "error",
},
},
];let arr = [];
arr[0] = 'a';
arr['name'] = 'bob'; // Noncompliant
arr[1] = 'foo';let obj = {
name: 'bob',
arr: ['a', 'foo']
};Examples from the ESLint documentation.
sonarjs/no-associative-arrays
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/no-associative-arrays": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Constructors should not contain asynchronous operations
Angular built-in sanitization should not be disabled
"switch" statements should not contain non-case labels
"Array.prototype.sort()" and "Array.prototype.toSorted()" should use a compare function