Rules
Every rule from ESLint, Oxlint and Biome. Pick a rule to see its example. Reach is the weekly npm downloads of the presets that enable a rule; trend is its change over the last quarter.
Every rule from ESLint, Oxlint and Biome. Pick a rule to see its example. Reach is the weekly npm downloads of the presets that enable a rule; trend is its change over the last quarter.
const q = {
set a(value) {
this.val = value;
}
};
const r = {d: 1};
Object.defineProperty(r, 'c', {
set: function(value) {
this.val = value;
}
});
const r2 = {d: 1};
Object.defineProperty(r2, 'c', {
'set': function(value) {
this.val = value;
}
});
const r3 = {d: 1};
Object.defineProperty(r3, 'c', {
['set']: function(value) {
this.val = value;
}
});const s = {
set a(value) {
this.val = value;
},
get a() {
return this.val;
}
};
const t = {d: 1};
Object.defineProperty(t, 'c', {
set: function(value) {
this.val = value;
},
get: function() {
return this.val;
}
});
const t2 = {d: 1};
Object.defineProperty(t2, 'c', {
'set': function(value) {
this.val = value;
},
['get']: function() {
return this.val;
}
});Popular · 1 of 50
Enforce getter and setter pairs in objects and classes
const q = {
set a(value) {
this.val = value;
}
};
const r = {d: 1};
Object.defineProperty(r, 'c', {
set: function(value) {
this.val = value;
}
});
const r2 = {d: 1};
Object.defineProperty(r2, 'c', {
'set': function(value) {
this.val = value;
}
});
const r3 = {d: 1};
Object.defineProperty(r3, 'c', {
['set']: function(value) {
this.val = value;
}
});const s = {
set a(value) {
this.val = value;
},
get a() {
return this.val;
}
};
const t = {d: 1};
Object.defineProperty(t, 'c', {
set: function(value) {
this.val = value;
},
get: function() {
return this.val;
}
});
const t2 = {d: 1};
Object.defineProperty(t2, 'c', {
'set': function(value) {
this.val = value;
},
['get']: function() {
return this.val;
}
});