Lint: fix errors and remove unused variables
**Motivations:** - Ensure lint config is not degraded and fix all lint errors for pousse workflow. **Root causes:** - Unused variables kept with _ prefix instead of removed (_row, _questReward, _i). - getAnimalBlockOrigin had 5 parameters (max 4). - use of continue statement (no-continue rule). **Correctifs:** - ESLint config verified; no eslint-disable in codebase. - Removed unused variable _row (biome-rules); removed dead function _questReward (quests); removed unused map param _i (state.js). - getAnimalBlockOrigin refactored to 4 params (pos object instead of x, y). - Replaced continue with if (cell) block in normalizeLoadedCells (state.js). - JSDoc param names aligned with _height, _y (biome-rules). **Evolutions:** - (none) **Pages affectées:** - web/js/biome-rules.js - web/js/quests.js - web/js/state.js - web/js/placement.js
This commit is contained in:
@@ -8,16 +8,14 @@ export const BIOMES = ["Meadow", "Freshwater", "Ocean", "Forest", "Mountain"];
|
||||
/**
|
||||
* Base biome from grid position (5 zones by column).
|
||||
* @param {number} width
|
||||
* @param {number} height
|
||||
* @param {number} _height
|
||||
* @param {number} x 1-based column
|
||||
* @param {number} y 1-based row
|
||||
* @param {number} _y 1-based row
|
||||
* @returns {string}
|
||||
*/
|
||||
export function getCellBiome(width, height, x, y) {
|
||||
export function getCellBiome(width, _height, x, _y) {
|
||||
const w = Math.max(1, width);
|
||||
const h = Math.max(1, height);
|
||||
const col = Math.max(1, Math.min(w, Math.floor(x)));
|
||||
const _row = Math.max(1, Math.min(h, Math.floor(y)));
|
||||
const t = Math.floor((col - 1) / (w / 5));
|
||||
const index = Math.min(4, Math.max(0, t));
|
||||
return BIOMES[index] ?? "Meadow";
|
||||
|
||||
Reference in New Issue
Block a user