Skip to content

Commit

Permalink
linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jyoung4242 committed Jun 16, 2024
1 parent beaad40 commit dc9f390
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/CA.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function applyCellularAutomataRules(map: number[], width: number, height: number): number[] {
let newMap = new Array(width * height).fill(0);
const newMap = new Array(width * height).fill(0);

for (let i = 0; i < height * width; i++) {
for (let x = 0; x < width; x++) {
Expand Down
5 changes: 3 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import "./style.css";
import { UI } from "@peasy-lib/peasy-ui";
import { Engine, DisplayMode, TileMap, Rectangle, Color, Vector } from "excalibur";
import { Engine, DisplayMode, TileMap, Vector } from "excalibur";
import { bluey, model, template, whitey } from "./ui";
//@ts-expect-error

Check failure on line 5 in src/main.ts

View workflow job for this annotation

GitHub Actions / lint

Include a description after the "@ts-expect-error" directive to explain why the @ts-expect-error is necessary. The description must be 3 characters or longer

Check failure on line 5 in src/main.ts

View workflow job for this annotation

GitHub Actions / lint / lint

Include a description after the "@ts-expect-error" directive to explain why the @ts-expect-error is necessary. The description must be 3 characters or longer
import { PerlinGenerator } from "@excaliburjs/plugin-perlin";

export let generator: PerlinGenerator;
Expand Down Expand Up @@ -33,7 +34,7 @@ export function drawTilemap() {
//loop through tiles in tmap and grab noise value
game.remove(game.currentScene.tileMaps[0]);
let tileIndex = 0;
for (let tile of tmap.tiles) {
for (const tile of tmap.tiles) {
const noise = generator.noise(tile.x / tmap.columns, tile.y / tmap.rows);
if (noise > 0.5) {
model.tiles[tileIndex] = 1;
Expand Down
4 changes: 3 additions & 1 deletion src/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ export const bluey = new Rectangle({ width: 16, height: 16, color: Color.fromRGB
export const whitey = new Rectangle({ width: 16, height: 16, color: Color.fromRGB(255, 255, 255, 1) });

export const model = {
//eslint-disable-next-line @typescript-eslint/no-empty-function
resetSim: (_e: any, m: any) => {

Check failure on line 10 in src/ui.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type

Check failure on line 10 in src/ui.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type

Check failure on line 10 in src/ui.ts

View workflow job for this annotation

GitHub Actions / lint / lint

Unexpected any. Specify a different type

Check failure on line 10 in src/ui.ts

View workflow job for this annotation

GitHub Actions / lint / lint

Unexpected any. Specify a different type
m.tiles = Array(1296).fill(0);
getNewNoiseField();
drawTilemap();
},
//eslint-disable-next-line @typescript-eslint/no-empty-function
runSim: (_e: any, m: any) => {

Check failure on line 16 in src/ui.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type

Check failure on line 16 in src/ui.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type

Check failure on line 16 in src/ui.ts

View workflow job for this annotation

GitHub Actions / lint / lint

Unexpected any. Specify a different type

Check failure on line 16 in src/ui.ts

View workflow job for this annotation

GitHub Actions / lint / lint

Unexpected any. Specify a different type
m.tiles = applyCellularAutomataRules(m.tiles, 36, 36);
redrawTilemap(m.tiles, tmap, game);
Expand Down Expand Up @@ -46,7 +48,7 @@ export const template = `
function redrawTilemap(map: number[], tilemap: TileMap, game: Engine) {
game.remove(game.currentScene.tileMaps[0]);
let tileIndex = 0;
for (let tile of tilemap.tiles) {
for (const tile of tilemap.tiles) {
const value = map[tileIndex];
if (value == 1) {
tile.addGraphic(bluey);
Expand Down

0 comments on commit dc9f390

Please sign in to comment.