Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
xShadowBlade committed Jan 27, 2024
1 parent 8b825f9 commit cf4bba3
Show file tree
Hide file tree
Showing 10 changed files with 6,291 additions and 1,369 deletions.
62 changes: 55 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,61 @@
* @file ESLint configuration file.
*/


// eslint-disable-next-line
const fs = require("fs");

/**
* @type {import("eslint").Linter.Config.rules}
*/
// eslint-disable-next-line
const rules = require("../../template-defaults/eslintrules.json");
let rules = {};
// Check if rules file exists
if (fs.existsSync("../../template-defaults/eslintrules.json")) {
rules = require("../../template-defaults/eslintrules.json");
} else {
rules = {
"arrow-spacing": ["warn", { "before": true, "after": true }],
"comma-dangle": ["warn", "always-multiline"],
"comma-spacing": "warn",
"comma-style": "warn",
"curly": ["warn", "multi-line"],
"dot-location": ["warn", "property"],
"handle-callback-err": "off",
"indent": ["warn", 4],
"keyword-spacing": "warn",
"max-nested-callbacks": ["warn", { "max": 4 }],
"max-statements-per-line": ["warn", { "max": 2 }],
"no-console": "off",
"no-dupe-class-members": "off",
"no-empty-function": "warn",
"no-floating-decimal": "warn",
"no-lonely-if": "warn",
"no-multi-spaces": "warn",
"no-multiple-empty-lines": ["warn", { "max": 2, "maxEOF": 1, "maxBOF": 0 }],
"no-shadow": ["warn", { "allow": ["err", "resolve", "reject"] }],
"no-trailing-spaces": ["warn"],
"no-var": "warn",
"no-unused-vars": "off",
"prefer-const": "warn",
"quotes": ["warn", "double", { "allowTemplateLiterals": true }],
"semi": ["warn", "always"],
"space-before-blocks": "warn",
"space-before-function-paren": ["warn", "always"],
"space-in-parens": "warn",
"space-infix-ops": "warn",
"space-unary-ops": "warn",
"spaced-comment": "warn",
"yoda": "warn",

"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/ban-ts-comment": "warn",

"jsdoc/require-param-type": "off",
"jsdoc/require-returns-type": "off",
"jsdoc/require-file-overview": 1,
};
}

/**
* @type {import("eslint").Linter.Config}
Expand All @@ -15,6 +65,8 @@ const options = {
"extends": [
"eslint:recommended",
"prettier",
"plugin:react/recommended",
"react-app",
"plugin:jsdoc/recommended-typescript",
"plugin:@typescript-eslint/recommended",
],
Expand All @@ -24,13 +76,9 @@ const options = {
"es6": true,
},
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"ecmaVersion": "latest",
},
"plugins": [
"@typescript-eslint",
"jsdoc",
],
"parser": "@typescript-eslint/parser",
"rules": rules,
};
Expand Down
1 change: 1 addition & 0 deletions bin/build/build.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const esbuild = require("esbuild");
const { umdWrapper } = require("./umdPlugin.js");
/*
Expand Down
4 changes: 4 additions & 0 deletions dist/types/pixiGame/react/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* @fileoverview React component for PixiJS game.
*/
export {};
2 changes: 1 addition & 1 deletion dist/types/pixiGame/sprite.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ declare class sprite {
y: number;
collisionShape: "Circle" | "Polygon" | "Rectangle" | "Shape" | "Line";
intersects: typeof Intersects.Shape | typeof Intersects.Circle | typeof Intersects.Polygon | typeof Intersects.Rectangle;
private gameRef;
protected gameRef: pixiGame;
/**
* Constructs a new game sprite.
* @param gameRef - The game reference.
Expand Down
Loading

0 comments on commit cf4bba3

Please sign in to comment.