diff --git a/.eslintrc.json b/.eslintrc.json index 314daa40d8..f11f08e691 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -2,6 +2,9 @@ "extends": [ "@pixi/eslint-config" ], + "parserOptions": { + "project": ["./tsconfig.eslint.json"] + }, "rules": { "@typescript-eslint/no-parameter-properties": 1, "@typescript-eslint/type-annotation-spacing": 1 diff --git a/package-lock.json b/package-lock.json index 48edd0c51c..130876aa84 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "@istanbuljs/nyc-config-typescript": "^1.0.1", "@microsoft/api-extractor": "~7.20.1", "@pixi-build-tools/api-extractor-lerna-monorepo": "~1.1.0", - "@pixi/eslint-config": "^2.0.1", + "@pixi/eslint-config": "^4.0.1", "@pixi/webdoc-template": "^1.5.3", "@rollup/plugin-alias": "^3.1.1", "@rollup/plugin-buble": "^0.21.3", @@ -5003,12 +5003,13 @@ "link": true }, "node_modules/@pixi/eslint-config": { - "version": "2.0.1", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@pixi/eslint-config/-/eslint-config-4.0.1.tgz", + "integrity": "sha512-o75jXn96vBw37E/CCnwgfLOBVQAFf4Z7OyctLxcOmthQgr3iG4ILW2DbtZTh1+XuZ3eF2JqnLa9WjIgzZOAKMg==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "^4.0.0", - "@typescript-eslint/parser": "^4.0.0" + "@typescript-eslint/eslint-plugin": "^5.0.0", + "@typescript-eslint/parser": "^5.0.0" }, "peerDependencies": { "eslint": ">=7.0.0", @@ -5632,9 +5633,10 @@ } }, "node_modules/@types/json-schema": { - "version": "7.0.6", - "dev": true, - "license": "MIT" + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "dev": true }, "node_modules/@types/minimatch": { "version": "3.0.3", @@ -5685,28 +5687,31 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "4.12.0", + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.23.0.tgz", + "integrity": "sha512-hEcSmG4XodSLiAp1uxv/OQSGsDY6QN3TcRU32gANp+19wGE1QQZLRS8/GV58VRUoXhnkuJ3ZxNQ3T6Z6zM59DA==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/experimental-utils": "4.12.0", - "@typescript-eslint/scope-manager": "4.12.0", - "debug": "^4.1.1", + "@typescript-eslint/scope-manager": "5.23.0", + "@typescript-eslint/type-utils": "5.23.0", + "@typescript-eslint/utils": "5.23.0", + "debug": "^4.3.2", "functional-red-black-tree": "^1.0.1", - "regexpp": "^3.0.0", - "semver": "^7.3.2", - "tsutils": "^3.17.1" + "ignore": "^5.1.8", + "regexpp": "^3.2.0", + "semver": "^7.3.5", + "tsutils": "^3.21.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^4.0.0", - "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -5715,9 +5720,10 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/debug": { - "version": "4.3.1", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, - "license": "MIT", "dependencies": { "ms": "2.1.2" }, @@ -5732,8 +5738,9 @@ }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/lru-cache": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, - "license": "ISC", "dependencies": { "yallist": "^4.0.0" }, @@ -5743,13 +5750,15 @@ }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/ms": { "version": "2.1.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { - "version": "7.3.4", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, - "license": "ISC", "dependencies": { "lru-cache": "^6.0.0" }, @@ -5762,51 +5771,30 @@ }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/yallist": { "version": "4.0.0", - "dev": true, - "license": "ISC" - }, - "node_modules/@typescript-eslint/experimental-utils": { - "version": "4.12.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/scope-manager": "4.12.0", - "@typescript-eslint/types": "4.12.0", - "@typescript-eslint/typescript-estree": "4.12.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "*" - } + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true }, "node_modules/@typescript-eslint/parser": { - "version": "4.12.0", + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.23.0.tgz", + "integrity": "sha512-V06cYUkqcGqpFjb8ttVgzNF53tgbB/KoQT/iB++DOIExKmzI9vBJKjZKt/6FuV9c+zrDsvJKbJ2DOCYwX91cbw==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/scope-manager": "4.12.0", - "@typescript-eslint/types": "4.12.0", - "@typescript-eslint/typescript-estree": "4.12.0", - "debug": "^4.1.1" + "@typescript-eslint/scope-manager": "5.23.0", + "@typescript-eslint/types": "5.23.0", + "@typescript-eslint/typescript-estree": "5.23.0", + "debug": "^4.3.2" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -5815,9 +5803,10 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/debug": { - "version": "4.3.1", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, - "license": "MIT", "dependencies": { "ms": "2.1.2" }, @@ -5832,31 +5821,83 @@ }, "node_modules/@typescript-eslint/parser/node_modules/ms": { "version": "2.1.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true }, "node_modules/@typescript-eslint/scope-manager": { - "version": "4.12.0", + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.23.0.tgz", + "integrity": "sha512-EhjaFELQHCRb5wTwlGsNMvzK9b8Oco4aYNleeDlNuL6qXWDF47ch4EhVNPh8Rdhf9tmqbN4sWDk/8g+Z/J8JVw==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/types": "4.12.0", - "@typescript-eslint/visitor-keys": "4.12.0" + "@typescript-eslint/types": "5.23.0", + "@typescript-eslint/visitor-keys": "5.23.0" }, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@typescript-eslint/type-utils": { + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.23.0.tgz", + "integrity": "sha512-iuI05JsJl/SUnOTXA9f4oI+/4qS/Zcgk+s2ir+lRmXI+80D8GaGwoUqs4p+X+4AxDolPpEpVUdlEH4ADxFy4gw==", + "dev": true, + "dependencies": { + "@typescript-eslint/utils": "5.23.0", + "debug": "^4.3.2", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, "node_modules/@typescript-eslint/types": { - "version": "4.12.0", + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.23.0.tgz", + "integrity": "sha512-NfBsV/h4dir/8mJwdZz7JFibaKC3E/QdeMEDJhiAE3/eMkoniZ7MjbEMCGXw6MZnZDMN3G9S0mH/6WUIj91dmw==", "dev": true, - "license": "MIT", "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", @@ -5864,21 +5905,21 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "4.12.0", + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.23.0.tgz", + "integrity": "sha512-xE9e0lrHhI647SlGMl+m+3E3CKPF1wzvvOEWnuE3CCjjT7UiRnDGJxmAcVKJIlFgK6DY9RB98eLr1OPigPEOGg==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "4.12.0", - "@typescript-eslint/visitor-keys": "4.12.0", - "debug": "^4.1.1", - "globby": "^11.0.1", - "is-glob": "^4.0.1", - "lodash": "^4.17.15", - "semver": "^7.3.2", - "tsutils": "^3.17.1" + "@typescript-eslint/types": "5.23.0", + "@typescript-eslint/visitor-keys": "5.23.0", + "debug": "^4.3.2", + "globby": "^11.0.4", + "is-glob": "^4.0.3", + "semver": "^7.3.5", + "tsutils": "^3.21.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", @@ -5891,9 +5932,10 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/debug": { - "version": "4.3.1", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, - "license": "MIT", "dependencies": { "ms": "2.1.2" }, @@ -5907,9 +5949,10 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/is-glob": { - "version": "4.0.1", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, - "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" }, @@ -5919,8 +5962,9 @@ }, "node_modules/@typescript-eslint/typescript-estree/node_modules/lru-cache": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, - "license": "ISC", "dependencies": { "yallist": "^4.0.0" }, @@ -5930,13 +5974,15 @@ }, "node_modules/@typescript-eslint/typescript-estree/node_modules/ms": { "version": "2.1.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true }, "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.3.4", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, - "license": "ISC", "dependencies": { "lru-cache": "^6.0.0" }, @@ -5949,19 +5995,72 @@ }, "node_modules/@typescript-eslint/typescript-estree/node_modules/yallist": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/@typescript-eslint/utils": { + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.23.0.tgz", + "integrity": "sha512-dbgaKN21drqpkbbedGMNPCtRPZo1IOUr5EI9Jrrh99r5UW5Q0dz46RKXeSBoPV+56R6dFKpbrdhgUNSJsDDRZA==", "dev": true, - "license": "ISC" + "dependencies": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.23.0", + "@typescript-eslint/types": "5.23.0", + "@typescript-eslint/typescript-estree": "5.23.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + } }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "4.12.0", + "node_modules/@typescript-eslint/utils/node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/types": "4.12.0", "eslint-visitor-keys": "^2.0.0" }, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.23.0.tgz", + "integrity": "sha512-Vd4mFNchU62sJB8pX19ZSPog05B0Y0CE2UxAZPT5k4iqhRYjPnqyY3woMxCd0++t9OTqkgjST+1ydLBi7e2Fvg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.23.0", + "eslint-visitor-keys": "^3.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", @@ -5969,11 +6068,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { - "version": "2.0.0", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", "dev": true, - "license": "Apache-2.0", "engines": { - "node": ">=10" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/@ungap/promise-all-settled": { @@ -9246,11 +9346,12 @@ } }, "node_modules/eslint-scope": { - "version": "5.1.0", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { - "esrecurse": "^4.1.0", + "esrecurse": "^4.3.0", "estraverse": "^4.1.1" }, "engines": { @@ -9562,20 +9663,31 @@ } }, "node_modules/esrecurse": { - "version": "4.2.1", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { - "estraverse": "^4.1.0" + "estraverse": "^5.2.0" }, "engines": { "node": ">=4.0" } }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, "node_modules/estraverse": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true, - "license": "BSD-2-Clause", "engines": { "node": ">=4.0" } @@ -16678,9 +16790,10 @@ } }, "node_modules/regexpp": { - "version": "3.1.0", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" }, @@ -18431,9 +18544,10 @@ "license": "Apache-2.0" }, "node_modules/tsutils": { - "version": "3.18.0", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", "dev": true, - "license": "MIT", "dependencies": { "tslib": "^1.8.1" }, @@ -24012,11 +24126,13 @@ "requires": {} }, "@pixi/eslint-config": { - "version": "2.0.1", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@pixi/eslint-config/-/eslint-config-4.0.1.tgz", + "integrity": "sha512-o75jXn96vBw37E/CCnwgfLOBVQAFf4Z7OyctLxcOmthQgr3iG4ILW2DbtZTh1+XuZ3eF2JqnLa9WjIgzZOAKMg==", "dev": true, "requires": { - "@typescript-eslint/eslint-plugin": "^4.0.0", - "@typescript-eslint/parser": "^4.0.0" + "@typescript-eslint/eslint-plugin": "^5.0.0", + "@typescript-eslint/parser": "^5.0.0" } }, "@pixi/events": { @@ -24522,7 +24638,9 @@ } }, "@types/json-schema": { - "version": "7.0.6", + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", "dev": true }, "@types/minimatch": { @@ -24569,20 +24687,26 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "4.12.0", + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.23.0.tgz", + "integrity": "sha512-hEcSmG4XodSLiAp1uxv/OQSGsDY6QN3TcRU32gANp+19wGE1QQZLRS8/GV58VRUoXhnkuJ3ZxNQ3T6Z6zM59DA==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "4.12.0", - "@typescript-eslint/scope-manager": "4.12.0", - "debug": "^4.1.1", + "@typescript-eslint/scope-manager": "5.23.0", + "@typescript-eslint/type-utils": "5.23.0", + "@typescript-eslint/utils": "5.23.0", + "debug": "^4.3.2", "functional-red-black-tree": "^1.0.1", - "regexpp": "^3.0.0", - "semver": "^7.3.2", - "tsutils": "^3.17.1" + "ignore": "^5.1.8", + "regexpp": "^3.2.0", + "semver": "^7.3.5", + "tsutils": "^3.21.0" }, "dependencies": { "debug": { - "version": "4.3.1", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "requires": { "ms": "2.1.2" @@ -24590,6 +24714,8 @@ }, "lru-cache": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "requires": { "yallist": "^4.0.0" @@ -24597,10 +24723,14 @@ }, "ms": { "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, "semver": { - "version": "7.3.4", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -24608,34 +24738,28 @@ }, "yallist": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true } } }, - "@typescript-eslint/experimental-utils": { - "version": "4.12.0", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/scope-manager": "4.12.0", - "@typescript-eslint/types": "4.12.0", - "@typescript-eslint/typescript-estree": "4.12.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" - } - }, "@typescript-eslint/parser": { - "version": "4.12.0", + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.23.0.tgz", + "integrity": "sha512-V06cYUkqcGqpFjb8ttVgzNF53tgbB/KoQT/iB++DOIExKmzI9vBJKjZKt/6FuV9c+zrDsvJKbJ2DOCYwX91cbw==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "4.12.0", - "@typescript-eslint/types": "4.12.0", - "@typescript-eslint/typescript-estree": "4.12.0", - "debug": "^4.1.1" + "@typescript-eslint/scope-manager": "5.23.0", + "@typescript-eslint/types": "5.23.0", + "@typescript-eslint/typescript-estree": "5.23.0", + "debug": "^4.3.2" }, "dependencies": { "debug": { - "version": "4.3.1", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "requires": { "ms": "2.1.2" @@ -24643,45 +24767,84 @@ }, "ms": { "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true } } }, "@typescript-eslint/scope-manager": { - "version": "4.12.0", + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.23.0.tgz", + "integrity": "sha512-EhjaFELQHCRb5wTwlGsNMvzK9b8Oco4aYNleeDlNuL6qXWDF47ch4EhVNPh8Rdhf9tmqbN4sWDk/8g+Z/J8JVw==", "dev": true, "requires": { - "@typescript-eslint/types": "4.12.0", - "@typescript-eslint/visitor-keys": "4.12.0" + "@typescript-eslint/types": "5.23.0", + "@typescript-eslint/visitor-keys": "5.23.0" + } + }, + "@typescript-eslint/type-utils": { + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.23.0.tgz", + "integrity": "sha512-iuI05JsJl/SUnOTXA9f4oI+/4qS/Zcgk+s2ir+lRmXI+80D8GaGwoUqs4p+X+4AxDolPpEpVUdlEH4ADxFy4gw==", + "dev": true, + "requires": { + "@typescript-eslint/utils": "5.23.0", + "debug": "^4.3.2", + "tsutils": "^3.21.0" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } } }, "@typescript-eslint/types": { - "version": "4.12.0", + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.23.0.tgz", + "integrity": "sha512-NfBsV/h4dir/8mJwdZz7JFibaKC3E/QdeMEDJhiAE3/eMkoniZ7MjbEMCGXw6MZnZDMN3G9S0mH/6WUIj91dmw==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "4.12.0", + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.23.0.tgz", + "integrity": "sha512-xE9e0lrHhI647SlGMl+m+3E3CKPF1wzvvOEWnuE3CCjjT7UiRnDGJxmAcVKJIlFgK6DY9RB98eLr1OPigPEOGg==", "dev": true, "requires": { - "@typescript-eslint/types": "4.12.0", - "@typescript-eslint/visitor-keys": "4.12.0", - "debug": "^4.1.1", - "globby": "^11.0.1", - "is-glob": "^4.0.1", - "lodash": "^4.17.15", - "semver": "^7.3.2", - "tsutils": "^3.17.1" + "@typescript-eslint/types": "5.23.0", + "@typescript-eslint/visitor-keys": "5.23.0", + "debug": "^4.3.2", + "globby": "^11.0.4", + "is-glob": "^4.0.3", + "semver": "^7.3.5", + "tsutils": "^3.21.0" }, "dependencies": { "debug": { - "version": "4.3.1", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "requires": { "ms": "2.1.2" } }, "is-glob": { - "version": "4.0.1", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "requires": { "is-extglob": "^2.1.1" @@ -24689,6 +24852,8 @@ }, "lru-cache": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "requires": { "yallist": "^4.0.0" @@ -24696,10 +24861,14 @@ }, "ms": { "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, "semver": { - "version": "7.3.4", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -24707,20 +24876,57 @@ }, "yallist": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, + "@typescript-eslint/utils": { + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.23.0.tgz", + "integrity": "sha512-dbgaKN21drqpkbbedGMNPCtRPZo1IOUr5EI9Jrrh99r5UW5Q0dz46RKXeSBoPV+56R6dFKpbrdhgUNSJsDDRZA==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.23.0", + "@typescript-eslint/types": "5.23.0", + "@typescript-eslint/typescript-estree": "5.23.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + }, + "dependencies": { + "eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^2.0.0" + } + }, + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true } } }, "@typescript-eslint/visitor-keys": { - "version": "4.12.0", + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.23.0.tgz", + "integrity": "sha512-Vd4mFNchU62sJB8pX19ZSPog05B0Y0CE2UxAZPT5k4iqhRYjPnqyY3woMxCd0++t9OTqkgjST+1ydLBi7e2Fvg==", "dev": true, "requires": { - "@typescript-eslint/types": "4.12.0", - "eslint-visitor-keys": "^2.0.0" + "@typescript-eslint/types": "5.23.0", + "eslint-visitor-keys": "^3.0.0" }, "dependencies": { "eslint-visitor-keys": { - "version": "2.0.0", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", "dev": true } } @@ -27245,10 +27451,12 @@ } }, "eslint-scope": { - "version": "5.1.0", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, "requires": { - "esrecurse": "^4.1.0", + "esrecurse": "^4.3.0", "estraverse": "^4.1.1" } }, @@ -27302,14 +27510,26 @@ } }, "esrecurse": { - "version": "4.2.1", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, "requires": { - "estraverse": "^4.1.0" + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } } }, "estraverse": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true }, "estree-walker": { @@ -32439,7 +32659,9 @@ } }, "regexpp": { - "version": "3.1.0", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "dev": true }, "regjsgen": { @@ -33653,7 +33875,9 @@ "dev": true }, "tsutils": { - "version": "3.18.0", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", "dev": true, "requires": { "tslib": "^1.8.1" diff --git a/package.json b/package.json index 93fb3ddb1e..5085af82f3 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "@istanbuljs/nyc-config-typescript": "^1.0.1", "@microsoft/api-extractor": "~7.20.1", "@pixi-build-tools/api-extractor-lerna-monorepo": "~1.1.0", - "@pixi/eslint-config": "^2.0.1", + "@pixi/eslint-config": "^4.0.1", "@pixi/webdoc-template": "^1.5.3", "@rollup/plugin-alias": "^3.1.1", "@rollup/plugin-buble": "^0.21.3", diff --git a/packages/accessibility/src/AccessibilityManager.ts b/packages/accessibility/src/AccessibilityManager.ts index 7644a4f27c..7d5a0ab782 100644 --- a/packages/accessibility/src/AccessibilityManager.ts +++ b/packages/accessibility/src/AccessibilityManager.ts @@ -44,7 +44,7 @@ export class AccessibilityManager * * @type {PIXI.CanvasRenderer|PIXI.Renderer} */ - public renderer: AbstractRenderer|Renderer; + public renderer: AbstractRenderer | Renderer; /** Internal variable, see isActive getter. */ private _isActive = false; @@ -76,7 +76,7 @@ export class AccessibilityManager /** * @param {PIXI.CanvasRenderer|PIXI.Renderer} renderer - A reference to the current renderer */ - constructor(renderer: AbstractRenderer|Renderer) + constructor(renderer: AbstractRenderer | Renderer) { this._hookDiv = null; diff --git a/packages/accessibility/src/accessibleTarget.ts b/packages/accessibility/src/accessibleTarget.ts index 8718ef0a5f..a402bc2ee3 100644 --- a/packages/accessibility/src/accessibleTarget.ts +++ b/packages/accessibility/src/accessibleTarget.ts @@ -12,7 +12,8 @@ export type PointerEvents = 'auto' | 'all' | 'inherit'; -export interface IAccessibleTarget { +export interface IAccessibleTarget +{ accessible: boolean; accessibleTitle: string; accessibleHint: string; @@ -25,7 +26,8 @@ export interface IAccessibleTarget { renderId: number; } -export interface IAccessibleHTMLElement extends HTMLElement { +export interface IAccessibleHTMLElement extends HTMLElement +{ type?: string; displayObject?: DisplayObject; } diff --git a/packages/app/global.d.ts b/packages/app/global.d.ts index 7998a3c5b4..e1a9a0de1c 100644 --- a/packages/app/global.d.ts +++ b/packages/app/global.d.ts @@ -3,13 +3,13 @@ declare namespace GlobalMixins // eslint-disable-next-line @typescript-eslint/no-empty-interface interface Application { - resizeTo: Window|HTMLElement; + resizeTo: Window | HTMLElement; resize(): void; } // eslint-disable-next-line @typescript-eslint/no-empty-interface interface IApplicationOptions { - resizeTo?: Window|HTMLElement; + resizeTo?: Window | HTMLElement; } } diff --git a/packages/app/src/Application.ts b/packages/app/src/Application.ts index 5e333a30e4..5a2a870a80 100644 --- a/packages/app/src/Application.ts +++ b/packages/app/src/Application.ts @@ -10,7 +10,8 @@ import type { IDestroyOptions } from '@pixi/display'; * @memberof PIXI * @see {@link PIXI.Application.registerPlugin} */ -export interface IApplicationPlugin { +export interface IApplicationPlugin +{ /** * Called when Application is constructed, scoped to Application instance. * Passes in `options` as the only argument, which are Application constructor options. @@ -62,7 +63,7 @@ export class Application * WebGL renderer if available, otherwise CanvasRenderer. * @member {PIXI.Renderer|PIXI.CanvasRenderer} */ - public renderer: Renderer|AbstractRenderer; + public renderer: Renderer | AbstractRenderer; /** * @param {object} [options] - The optional renderer parameters. @@ -163,7 +164,7 @@ export class Application * @param {boolean} [stageOptions.baseTexture=false] - Only used for child Sprites if stageOptions.children is set * to true. Should it destroy the base texture of the child sprite */ - public destroy(removeView?: boolean, stageOptions?: IDestroyOptions|boolean): void + public destroy(removeView?: boolean, stageOptions?: IDestroyOptions | boolean): void { // Destroy plugins in the opposite order // which they were constructed diff --git a/packages/app/src/ResizePlugin.ts b/packages/app/src/ResizePlugin.ts index 53ef096ebb..e7476da906 100644 --- a/packages/app/src/ResizePlugin.ts +++ b/packages/app/src/ResizePlugin.ts @@ -9,12 +9,12 @@ import type { IApplicationOptions } from './Application'; */ export class ResizePlugin { - public static resizeTo: Window|HTMLElement; + public static resizeTo: Window | HTMLElement; public static resize: () => void; - public static renderer: Renderer|CanvasRenderer; + public static renderer: Renderer | CanvasRenderer; public static queueResize: () => void; private static _resizeId: number; - private static _resizeTo: Window|HTMLElement; + private static _resizeTo: Window | HTMLElement; private static cancelResize: () => void; /** @@ -34,7 +34,7 @@ export class ResizePlugin * @memberof PIXI.Application# */ { - set(dom: Window|HTMLElement) + set(dom: Window | HTMLElement) { globalThis.removeEventListener('resize', this.queueResize); this._resizeTo = dom; diff --git a/packages/basis/src/Basis.ts b/packages/basis/src/Basis.ts index a673e1ad09..0b4b8e8ac5 100644 --- a/packages/basis/src/Basis.ts +++ b/packages/basis/src/Basis.ts @@ -8,8 +8,9 @@ import { INTERNAL_FORMATS } from '@pixi/compressed-textures'; * * @ignore */ -/* eslint-disable camelcase */ -export enum BASIS_FORMATS { +/* eslint-disable camelcase, @typescript-eslint/indent */ +export enum BASIS_FORMATS +{ cTFETC1 = 0, cTFETC2 = 1, cTFBC1 = 2, @@ -27,7 +28,7 @@ export enum BASIS_FORMATS { cTFBGR565 = 15, cTFRGBA4444 = 16, } -/* eslint-enable camelcase */ +/* eslint-enable camelcase, @typescript-eslint/indent */ /** * Maps {@link BASIS_FORMATS} to {@link PIXI.INTERNAL_FORMATS} @@ -41,7 +42,7 @@ export const BASIS_FORMAT_TO_INTERNAL_FORMAT: { [id: number]: INTERNAL_FORMATS } [BASIS_FORMATS.cTFPVRTC1_4_RGB]: INTERNAL_FORMATS.COMPRESSED_RGB_PVRTC_4BPPV1_IMG, [BASIS_FORMATS.cTFPVRTC1_4_RGBA]: INTERNAL_FORMATS.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, [BASIS_FORMATS.cTFATC_RGB]: INTERNAL_FORMATS.COMPRESSED_RGB_ATC_WEBGL, - [BASIS_FORMATS.cTFASTC_4x4]: INTERNAL_FORMATS.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL + [BASIS_FORMATS.cTFASTC_4x4]: INTERNAL_FORMATS.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL, }; /** @@ -56,7 +57,7 @@ export const BASIS_FORMAT_TO_INTERNAL_FORMAT: { [id: number]: INTERNAL_FORMATS } export const BASIS_FORMAT_TO_TYPE: { [id: number]: TYPES } = { [BASIS_FORMATS.cTFRGBA32]: TYPES.UNSIGNED_BYTE, [BASIS_FORMATS.cTFRGB565]: TYPES.UNSIGNED_SHORT_5_6_5, - [BASIS_FORMATS.cTFRGBA4444]: TYPES.UNSIGNED_SHORT_4_4_4_4 + [BASIS_FORMATS.cTFRGBA4444]: TYPES.UNSIGNED_SHORT_4_4_4_4, }; /** @@ -82,7 +83,7 @@ export const INTERNAL_FORMAT_TO_BASIS_FORMAT: { [id: number]: number } export const BASIS_FORMATS_ALPHA: { [id: number]: boolean } = { [BASIS_FORMATS.cTFBC3]: true, [BASIS_FORMATS.cTFPVRTC1_4_RGBA]: true, - [BASIS_FORMATS.cTFASTC_4x4]: true + [BASIS_FORMATS.cTFASTC_4x4]: true, }; /** diff --git a/packages/basis/src/BasisLoader.ts b/packages/basis/src/BasisLoader.ts index 3ae3fb0b69..95849443a9 100644 --- a/packages/basis/src/BasisLoader.ts +++ b/packages/basis/src/BasisLoader.ts @@ -8,7 +8,7 @@ import { BASIS_FORMATS_ALPHA, BasisTextureExtensions, BasisBinding, - BASIS_FORMAT_TO_TYPE + BASIS_FORMAT_TO_TYPE, } from './Basis'; import { TranscoderWorker } from './TranscoderWorker'; import { LoaderResource } from '@pixi/loaders'; @@ -126,7 +126,7 @@ export class BasisLoader Object.assign(resource, BasisLoader.registerTextures( resource.url, resources, - resource.metadata + resource.metadata, )); } catch (err) @@ -149,7 +149,7 @@ export class BasisLoader private static registerTextures( url: string, resources: TranscodedResourcesArray, - metadata: IResourceMetadata + metadata: IResourceMetadata, ): BasisTexturesResult { const result: BasisTexturesResult = { @@ -175,7 +175,7 @@ export class BasisLoader : MIPMAP_MODES.OFF, alphaMode: ALPHA_MODES.NO_PREMULTIPLIED_ALPHA, type, - format + format, }, metadata))) )); @@ -236,7 +236,7 @@ export class BasisLoader const response = await worker.transcodeAsync( new Uint8Array(arrayBuffer), BasisLoader.defaultRGBAFormat.basisFormat, - BasisLoader.defaultRGBFormat.basisFormat + BasisLoader.defaultRGBFormat.basisFormat, ); const basisFormat = response.basisFormat; @@ -260,7 +260,7 @@ export class BasisLoader width: imageArray[i].width, height: imageArray[i].height, levelBuffers: imageArray[i].levelArray, - levels: imageArray[i].levelArray.length + levels: imageArray[i].levelArray.length, }); } } @@ -270,8 +270,8 @@ export class BasisLoader imageResources = imageArray.map((image) => new BufferResource( new Uint16Array(image.levelArray[0].levelBuffer.buffer), { width: image.width, - height: image.height - }) + height: image.height, + }), ) as TranscodedResourcesArray; } @@ -375,7 +375,7 @@ export class BasisLoader width: alignedWidth, height: alignedHeight, levelBuffers: imageLevels, - levels + levels, }); } else @@ -427,7 +427,7 @@ export class BasisLoader pvrtc: gl.getExtension('WEBGL_compressed_texture_pvrtc') || gl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc'), atc: gl.getExtension('WEBGL_compressed_texture_atc'), - astc: gl.getExtension('WEBGL_compressed_texture_astc') + astc: gl.getExtension('WEBGL_compressed_texture_astc'), }; } @@ -479,7 +479,7 @@ export class BasisLoader { BasisLoader[detectWithAlpha ? 'defaultRGBAFormat' : 'defaultRGBFormat'] = { textureFormat: TYPES.UNSIGNED_SHORT_5_6_5, - basisFormat: BASIS_FORMATS.cTFRGB565 + basisFormat: BASIS_FORMATS.cTFRGB565, }; BasisLoader.fallbackMode = true; diff --git a/packages/basis/src/TranscoderWorkerWrapper.ts b/packages/basis/src/TranscoderWorkerWrapper.ts index e53dce4cbc..6e07b061d8 100644 --- a/packages/basis/src/TranscoderWorkerWrapper.ts +++ b/packages/basis/src/TranscoderWorkerWrapper.ts @@ -4,7 +4,8 @@ import type { BASIS, BASIS_FORMATS, BasisBinding } from './Basis'; * Initialization message sent by the main thread. * @ignore */ -export interface IInitializeTranscoderMessage { +export interface IInitializeTranscoderMessage +{ wasmSource: ArrayBuffer; type: 'init'; } @@ -23,7 +24,8 @@ export interface ITranscodeMessage } /** @ignore */ -export interface ITranscodedImage { +export interface ITranscodedImage +{ imageID: number; levelArray: Array<{ levelID: number, @@ -39,7 +41,8 @@ export interface ITranscodedImage { * Response format for {@link TranscoderWorker}. * @ignore */ -export interface ITranscodeResponse { +export interface ITranscodeResponse +{ type: 'init' | 'transcode'; requestID?: number; success: boolean; @@ -57,8 +60,10 @@ export interface ITranscodeResponse { }>; } -declare global { - interface Window { +declare global +{ + interface Window + { BASIS: BASIS; } } diff --git a/packages/canvas/canvas-display/global.d.ts b/packages/canvas/canvas-display/global.d.ts index 5854bc9e9f..504a36c8d6 100644 --- a/packages/canvas/canvas-display/global.d.ts +++ b/packages/canvas/canvas-display/global.d.ts @@ -1,5 +1,7 @@ -declare namespace GlobalMixins { - interface Container { +declare namespace GlobalMixins +{ + interface Container + { _renderCanvas(renderer: import('@pixi/canvas-renderer').CanvasRenderer): void; } } diff --git a/packages/canvas/canvas-extract/src/CanvasExtract.ts b/packages/canvas/canvas-extract/src/CanvasExtract.ts index 1fb0d43ecb..8054610de7 100644 --- a/packages/canvas/canvas-extract/src/CanvasExtract.ts +++ b/packages/canvas/canvas-extract/src/CanvasExtract.ts @@ -37,7 +37,7 @@ export class CanvasExtract * @param quality - JPEG or Webp compression from 0 to 1. Default is 0.92. * @return HTML Image of the target */ - public image(target?: DisplayObject|RenderTexture, format?: string, quality?: number): HTMLImageElement + public image(target?: DisplayObject | RenderTexture, format?: string, quality?: number): HTMLImageElement { const image = new Image(); @@ -56,7 +56,7 @@ export class CanvasExtract * @param quality - JPEG or Webp compression from 0 to 1. Default is 0.92. * @return A base64 encoded string of the texture. */ - public base64(target?: DisplayObject|RenderTexture, format?: string, quality?: number): string + public base64(target?: DisplayObject | RenderTexture, format?: string, quality?: number): string { return this.canvas(target).toDataURL(format, quality); } @@ -68,7 +68,7 @@ export class CanvasExtract * to convert. If left empty will use the main renderer * @return A Canvas element with the texture rendered on. */ - public canvas(target?: DisplayObject|RenderTexture): HTMLCanvasElement + public canvas(target?: DisplayObject | RenderTexture): HTMLCanvasElement { const renderer = this.renderer; let context; @@ -123,7 +123,7 @@ export class CanvasExtract * to convert. If left empty will use the main renderer * @return One-dimensional array containing the pixel data of the entire texture */ - public pixels(target?: DisplayObject|RenderTexture): Uint8ClampedArray + public pixels(target?: DisplayObject | RenderTexture): Uint8ClampedArray { const renderer = this.renderer; let context; diff --git a/packages/canvas/canvas-graphics/global.d.ts b/packages/canvas/canvas-graphics/global.d.ts index 183cc55a3a..dd09b95742 100644 --- a/packages/canvas/canvas-graphics/global.d.ts +++ b/packages/canvas/canvas-graphics/global.d.ts @@ -1,5 +1,7 @@ -declare namespace GlobalMixins { - interface Graphics { +declare namespace GlobalMixins +{ + interface Graphics + { _renderCanvas(renderer: import('@pixi/canvas-renderer').CanvasRenderer): void; generateCanvasTexture(scaleMode: import('@pixi/constants').SCALE_MODES, resolution?: number): Texture; cachedGraphicsData: import('@pixi/graphics').GraphicsData[]; diff --git a/packages/canvas/canvas-graphics/src/CanvasGraphicsRenderer.ts b/packages/canvas/canvas-graphics/src/CanvasGraphicsRenderer.ts index 25f6dfa58c..bfd84a8519 100644 --- a/packages/canvas/canvas-graphics/src/CanvasGraphicsRenderer.ts +++ b/packages/canvas/canvas-graphics/src/CanvasGraphicsRenderer.ts @@ -29,7 +29,7 @@ export class CanvasGraphicsRenderer { /** A reference to the current renderer */ public renderer: CanvasRenderer; - private _svgMatrix: DOMMatrix|boolean = null; + private _svgMatrix: DOMMatrix | boolean = null; private _tempMatrix: Matrix = new Matrix(); /** @@ -48,7 +48,7 @@ export class CanvasGraphicsRenderer * will be used for the fill.stroke * @param tint - color to set the fill/stroke too. */ - private _calcCanvasStyle(style: FillStyle, tint: number): string|CanvasPattern + private _calcCanvasStyle(style: FillStyle, tint: number): string | CanvasPattern { let res; @@ -401,7 +401,7 @@ export class CanvasGraphicsRenderer * @param context - The canvas context */ private paintPolygonStroke( - shape: Polygon, lineStyle: LineStyle, contextStrokeStyle: string|CanvasPattern, + shape: Polygon, lineStyle: LineStyle, contextStrokeStyle: string | CanvasPattern, holes: GraphicsData[], holesDirection: boolean[], worldAlpha: number, context: CrossPlatformCanvasRenderingContext2D ): void @@ -474,7 +474,7 @@ export class CanvasGraphicsRenderer */ private paintEllipse( shape: Ellipse, fillStyle: FillStyle, lineStyle: LineStyle, - contextFillStyle: string|CanvasPattern, worldAlpha: number, + contextFillStyle: string | CanvasPattern, worldAlpha: number, context: CrossPlatformCanvasRenderingContext2D): void { // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas @@ -536,7 +536,7 @@ export class CanvasGraphicsRenderer */ private paintRoundedRectangle( shape: RoundedRectangle, fillStyle: FillStyle, lineStyle: LineStyle, - contextFillStyle: string|CanvasPattern, worldAlpha: number, + contextFillStyle: string | CanvasPattern, worldAlpha: number, context: CrossPlatformCanvasRenderingContext2D ): void { diff --git a/packages/canvas/canvas-mesh/global.d.ts b/packages/canvas/canvas-mesh/global.d.ts index 5974bc236e..5f84124f93 100644 --- a/packages/canvas/canvas-mesh/global.d.ts +++ b/packages/canvas/canvas-mesh/global.d.ts @@ -1,5 +1,7 @@ -declare namespace GlobalMixins { - interface Mesh { +declare namespace GlobalMixins +{ + interface Mesh + { _renderCanvas(renderer: import('@pixi/canvas-renderer').CanvasRenderer): void; _canvasPadding: number; canvasPadding: number; @@ -8,11 +10,13 @@ declare namespace GlobalMixins { _cachedTexture: import('@pixi/core').Texture; } - interface MeshMaterial { + interface MeshMaterial + { _renderCanvas(renderer: import('@pixi/canvas-renderer').CanvasRenderer, mesh: import('@pixi/mesh').Mesh): void; } - interface NineSlicePlane { + interface NineSlicePlane + { _cachedTint: number; _tintedCanvas: HTMLCanvasElement; _canvasUvs: number[]; diff --git a/packages/canvas/canvas-renderer/src/CanvasRenderer.ts b/packages/canvas/canvas-renderer/src/CanvasRenderer.ts index 7e85b46a40..85a321d6fb 100644 --- a/packages/canvas/canvas-renderer/src/CanvasRenderer.ts +++ b/packages/canvas/canvas-renderer/src/CanvasRenderer.ts @@ -16,7 +16,8 @@ import type { const tempMatrix = new Matrix(); -export interface ICanvasRendererPluginConstructor { +export interface ICanvasRendererPluginConstructor +{ new (renderer: CanvasRenderer, options?: any): IRendererPlugin; } @@ -87,7 +88,7 @@ export class CanvasRenderer extends AbstractRenderer public readonly blendModes: string[] = mapCanvasBlendModesToPixi(); public renderingToScreen = false; - private _activeBlendMode: BLEND_MODES =null; + private _activeBlendMode: BLEND_MODES = null; /** Projection transform, passed in render() stored here */ private _projTransform: Matrix = null; diff --git a/packages/canvas/canvas-sprite-tiling/global.d.ts b/packages/canvas/canvas-sprite-tiling/global.d.ts index e445fb0027..011547f89f 100644 --- a/packages/canvas/canvas-sprite-tiling/global.d.ts +++ b/packages/canvas/canvas-sprite-tiling/global.d.ts @@ -1,5 +1,7 @@ -declare namespace GlobalMixins { - interface TilingSprite { +declare namespace GlobalMixins +{ + interface TilingSprite + { _canvasPattern: CanvasPattern; } } diff --git a/packages/canvas/canvas-sprite/global.d.ts b/packages/canvas/canvas-sprite/global.d.ts index 5f57e9e597..77592778c6 100644 --- a/packages/canvas/canvas-sprite/global.d.ts +++ b/packages/canvas/canvas-sprite/global.d.ts @@ -1,6 +1,8 @@ -declare namespace GlobalMixins { - interface Sprite { - _tintedCanvas: HTMLCanvasElement|HTMLImageElement; +declare namespace GlobalMixins +{ + interface Sprite + { + _tintedCanvas: HTMLCanvasElement | HTMLImageElement; _renderCanvas(renderer: import('@pixi/canvas-renderer').CanvasRenderer): void; } } diff --git a/packages/compressed-textures/src/const.ts b/packages/compressed-textures/src/const.ts index abc8f655bb..b9ce50d1a7 100644 --- a/packages/compressed-textures/src/const.ts +++ b/packages/compressed-textures/src/const.ts @@ -32,7 +32,9 @@ * @property {number} COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=0x8C92 * @property {number} COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=0x87EE */ -export enum INTERNAL_FORMATS { +export enum INTERNAL_FORMATS +// eslint-disable-next-line @typescript-eslint/indent +{ // WEBGL_compressed_texture_s3tc COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0, COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1, diff --git a/packages/compressed-textures/src/loaders/DDSLoader.ts b/packages/compressed-textures/src/loaders/DDSLoader.ts index 05686bb798..435c3f3028 100644 --- a/packages/compressed-textures/src/loaders/DDSLoader.ts +++ b/packages/compressed-textures/src/loaders/DDSLoader.ts @@ -63,7 +63,8 @@ const DDS_DX10_FIELDS = { */ // This is way over-blown for us! Lend us a hand, and remove the ones that aren't used (but set the remaining // ones to their correct value) -enum DXGI_FORMAT { +enum DXGI_FORMAT + { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_R32G32B32A32_TYPELESS, DXGI_FORMAT_R32G32B32A32_FLOAT, @@ -193,7 +194,8 @@ enum DXGI_FORMAT { * * @ignore */ -enum D3D10_RESOURCE_DIMENSION { +enum D3D10_RESOURCE_DIMENSION + { DDS_DIMENSION_TEXTURE1D = 2, DDS_DIMENSION_TEXTURE2D = 3, DDS_DIMENSION_TEXTURE3D = 6 diff --git a/packages/compressed-textures/src/resources/CompressedTextureResource.ts b/packages/compressed-textures/src/resources/CompressedTextureResource.ts index cf024839ca..8e26b820c0 100644 --- a/packages/compressed-textures/src/resources/CompressedTextureResource.ts +++ b/packages/compressed-textures/src/resources/CompressedTextureResource.ts @@ -177,8 +177,8 @@ export class CompressedTextureResource extends BlobResource * @param format - the compression format to get the extension for. */ private static _formatToExtension(format: INTERNAL_FORMATS): - 's3tc' | 's3tc_sRGB' | 'atc' | - 'astc' | 'etc' | 'etc1' | 'pvrtc' + 's3tc' | 's3tc_sRGB' | 'atc' | + 'astc' | 'etc' | 'etc1' | 'pvrtc' { if (format >= 0x83F0 && format <= 0x83F3) { diff --git a/packages/constants/src/index.ts b/packages/constants/src/index.ts index 1c4ba80852..40f7fc7ba7 100644 --- a/packages/constants/src/index.ts +++ b/packages/constants/src/index.ts @@ -10,7 +10,9 @@ * @property {number} WEBGL - Version 1 of WebGL * @property {number} WEBGL2 - Version 2 of WebGL */ -export enum ENV { +export enum ENV +// eslint-disable-next-line @typescript-eslint/indent +{ WEBGL_LEGACY, WEBGL, WEBGL2, @@ -27,7 +29,9 @@ export enum ENV { * @property {number} WEBGL - WebGL render type. * @property {number} CANVAS - Canvas render type. */ -export enum RENDERER_TYPE { +export enum RENDERER_TYPE +// eslint-disable-next-line @typescript-eslint/indent +{ UNKNOWN, WEBGL, CANVAS, @@ -44,7 +48,9 @@ export enum RENDERER_TYPE { * @property {number} DEPTH - Indicates the depth buffer. * @property {number} STENCIL - Indicates the stencil buffer. */ -export enum BUFFER_BITS { +export enum BUFFER_BITS +// eslint-disable-next-line @typescript-eslint/indent +{ COLOR = 0x00004000, DEPTH = 0x00000100, STENCIL = 0x00000400 @@ -92,7 +98,9 @@ export enum BUFFER_BITS { * @property {number} ERASE * @property {number} XOR */ -export enum BLEND_MODES { +export enum BLEND_MODES +// eslint-disable-next-line @typescript-eslint/indent +{ NORMAL = 0, ADD = 1, MULTIPLY = 2, @@ -144,7 +152,9 @@ export enum BLEND_MODES { * @property {number} TRIANGLE_STRIP * @property {number} TRIANGLE_FAN */ -export enum DRAW_MODES { +export enum DRAW_MODES +// eslint-disable-next-line @typescript-eslint/indent +{ POINTS, LINES, LINE_LOOP, @@ -175,7 +185,9 @@ export enum DRAW_MODES { * @property {number} DEPTH_COMPONENT=6402 * @property {number} DEPTH_STENCIL=34041 */ -export enum FORMATS { +export enum FORMATS +// eslint-disable-next-line @typescript-eslint/indent +{ RGBA = 6408, RGB = 6407, RG = 33319, @@ -208,7 +220,9 @@ export enum FORMATS { * @property {number} TEXTURE_CUBE_MAP_POSITIVE_Z=34073 * @property {number} TEXTURE_CUBE_MAP_NEGATIVE_Z=34074 */ -export enum TARGETS { +export enum TARGETS +// eslint-disable-next-line @typescript-eslint/indent +{ TEXTURE_2D = 3553, TEXTURE_CUBE_MAP = 34067, TEXTURE_2D_ARRAY = 35866, @@ -244,7 +258,9 @@ export enum TARGETS { * @property {number} FLOAT_32_UNSIGNED_INT_24_8_REV=36269 * @property {number} HALF_FLOAT=36193 */ -export enum TYPES { +export enum TYPES +// eslint-disable-next-line @typescript-eslint/indent +{ UNSIGNED_BYTE = 5121, UNSIGNED_SHORT = 5123, UNSIGNED_SHORT_5_6_5 = 33635, @@ -275,7 +291,9 @@ export enum TYPES { * @property {number} INT=1 * @property {number} UINT=2 */ -export enum SAMPLER_TYPES { +export enum SAMPLER_TYPES +// eslint-disable-next-line @typescript-eslint/indent +{ FLOAT = 0, INT = 1, UINT = 2, @@ -294,7 +312,9 @@ export enum SAMPLER_TYPES { * @property {number} LINEAR Smooth scaling * @property {number} NEAREST Pixelating scaling */ -export enum SCALE_MODES { +export enum SCALE_MODES +// eslint-disable-next-line @typescript-eslint/indent +{ NEAREST, LINEAR, } @@ -317,7 +337,9 @@ export enum SCALE_MODES { * @property {number} REPEAT - The texture uvs tile and repeat * @property {number} MIRRORED_REPEAT - The texture uvs tile and repeat with mirroring */ -export enum WRAP_MODES { +export enum WRAP_MODES +// eslint-disable-next-line @typescript-eslint/indent +{ CLAMP = 33071, REPEAT = 10497, MIRRORED_REPEAT = 33648, @@ -343,7 +365,9 @@ export enum WRAP_MODES { * @property {number} ON_MANUAL - Use mipmaps, but do not auto-generate them; this is used with a resource * that supports buffering each level-of-detail. */ -export enum MIPMAP_MODES { +export enum MIPMAP_MODES +// eslint-disable-next-line @typescript-eslint/indent +{ OFF, POW2, ON, @@ -367,7 +391,9 @@ export enum MIPMAP_MODES { * @property {number} UNPACK - Default option, alias for PREMULTIPLY_ON_UPLOAD. * @property {number} PMA - Alias for PREMULTIPLIED_ALPHA. */ -export enum ALPHA_MODES { +export enum ALPHA_MODES +// eslint-disable-next-line @typescript-eslint/indent +{ NPM = 0, UNPACK = 1, PMA = 2, @@ -394,7 +420,9 @@ export enum ALPHA_MODES { * @property {number} YES - Alias for CLEAR, same as `true` in earlier versions * @property {number} AUTO - Alias for BLIT */ -export enum CLEAR_MODES { +export enum CLEAR_MODES +// eslint-disable-next-line @typescript-eslint/indent +{ NO = 0, YES = 1, AUTO = 2, @@ -422,7 +450,9 @@ export enum CLEAR_MODES { * @property {number} AUTO - Garbage collection will happen periodically automatically * @property {number} MANUAL - Garbage collection will need to be called manually */ -export enum GC_MODES { +export enum GC_MODES +// eslint-disable-next-line @typescript-eslint/indent +{ AUTO, MANUAL, } @@ -439,7 +469,9 @@ export enum GC_MODES { * @property {string} MEDIUM='mediump' * @property {string} HIGH='highp' */ -export enum PRECISION { +export enum PRECISION +// eslint-disable-next-line @typescript-eslint/indent +{ LOW = 'lowp', MEDIUM = 'mediump', HIGH = 'highp', @@ -458,7 +490,9 @@ export enum PRECISION { * @property {number} STENCIL - Stencil mask, 1-bit, medium, works only if renderer supports stencil * @property {number} SPRITE - Mask that uses SpriteMaskFilter, uses temporary RenderTexture */ -export enum MASK_TYPES { +export enum MASK_TYPES +// eslint-disable-next-line @typescript-eslint/indent +{ NONE = 0, SCISSOR = 1, STENCIL = 2, @@ -479,7 +513,9 @@ export enum MASK_TYPES { * @property {number} MEDIUM - Try 4 samples * @property {number} HIGH - Try 8 samples */ -export enum MSAA_QUALITY { +export enum MSAA_QUALITY +// eslint-disable-next-line @typescript-eslint/indent +{ NONE = 0, LOW = 2, MEDIUM = 4, @@ -499,7 +535,9 @@ export enum MSAA_QUALITY { * @property {number} ARRAY_BUFFER - buffer type for using attribute data * @property {number} UNIFORM_BUFFER - the buffer type is for uniform buffer objects */ -export enum BUFFER_TYPE { +export enum BUFFER_TYPE +// eslint-disable-next-line @typescript-eslint/indent +{ ELEMENT_ARRAY_BUFFER = 34963, ARRAY_BUFFER = 34962, // NOT YET SUPPORTED diff --git a/packages/core/src/AbstractRenderer.ts b/packages/core/src/AbstractRenderer.ts index 7334f61c6c..ec2bf49a27 100644 --- a/packages/core/src/AbstractRenderer.ts +++ b/packages/core/src/AbstractRenderer.ts @@ -38,14 +38,16 @@ export interface IRendererPlugins [key: string]: any; } -export interface IRendererRenderOptions { +export interface IRendererRenderOptions +{ renderTexture?: RenderTexture; clear?: boolean; transform?: Matrix; skipUpdateTransform?: boolean; } -export interface IGenerateTextureOptions { +export interface IGenerateTextureOptions +{ scaleMode?: SCALE_MODES; resolution?: number; region?: Rectangle; diff --git a/packages/core/src/IRenderableObject.ts b/packages/core/src/IRenderableObject.ts index 1247c5e8c4..1516077ef6 100644 --- a/packages/core/src/IRenderableObject.ts +++ b/packages/core/src/IRenderableObject.ts @@ -6,7 +6,8 @@ import type { Renderer } from './Renderer'; * The minimum APIs needed to implement a renderable object. * @memberof PIXI */ -interface IRenderableObject { +interface IRenderableObject +{ /** Object must have a parent container */ parent: IRenderableContainer; /** Before method for transform updates */ @@ -23,7 +24,8 @@ interface IRenderableObject { * Interface for Container to interface with Renderer. * @memberof PIXI */ -interface IRenderableContainer extends IRenderableObject { +interface IRenderableContainer extends IRenderableObject +{ /** Get Local bounds for container */ getLocalBounds(rect?: Rectangle, skipChildrenUpdate?: boolean): Rectangle; } diff --git a/packages/core/src/Renderer.ts b/packages/core/src/Renderer.ts index 19ba626c73..94c38335d2 100644 --- a/packages/core/src/Renderer.ts +++ b/packages/core/src/Renderer.ts @@ -28,11 +28,13 @@ import type { ISystemConstructor } from './ISystem'; import type { IRenderingContext } from './IRenderingContext'; import type { IRenderableObject } from './IRenderableObject'; -export interface IRendererPluginConstructor { +export interface IRendererPluginConstructor +{ new (renderer: Renderer, options?: any): IRendererPlugin; } -export interface IRendererPlugin { +export interface IRendererPlugin +{ destroy(): void; } @@ -250,7 +252,7 @@ export class Renderer extends AbstractRenderer * for devices with dual graphics card. * @param {object} [options.context] - If WebGL context already exists, all parameters must be taken from it. */ - constructor(options? : IRendererOptions) + constructor(options?: IRendererOptions) { super(RENDERER_TYPE.WEBGL, options); diff --git a/packages/core/src/batch/AbstractBatchRenderer.ts b/packages/core/src/batch/AbstractBatchRenderer.ts index 4038158bae..441c25bf9c 100644 --- a/packages/core/src/batch/AbstractBatchRenderer.ts +++ b/packages/core/src/batch/AbstractBatchRenderer.ts @@ -23,7 +23,8 @@ import type { BLEND_MODES } from '@pixi/constants'; * * @memberof PIXI */ -export interface IBatchableElement { +export interface IBatchableElement +{ _texture: Texture; vertexData: Float32Array; indices: Uint16Array | Uint32Array | Array; diff --git a/packages/core/src/context/ContextSystem.ts b/packages/core/src/context/ContextSystem.ts index 8724f23be4..fb53b3c4ed 100644 --- a/packages/core/src/context/ContextSystem.ts +++ b/packages/core/src/context/ContextSystem.ts @@ -8,7 +8,8 @@ import type { WebGLExtensions } from './WebGLExtensions'; let CONTEXT_UID_COUNTER = 0; -export interface ISupportDict { +export interface ISupportDict +{ uint32Indices: boolean; } diff --git a/packages/core/src/context/WebGLExtensions.ts b/packages/core/src/context/WebGLExtensions.ts index eeb8b82eb8..aae4036faa 100644 --- a/packages/core/src/context/WebGLExtensions.ts +++ b/packages/core/src/context/WebGLExtensions.ts @@ -30,7 +30,8 @@ export interface WEBGL_compressed_texture_atc COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL: number; } -export interface WebGLExtensions { +export interface WebGLExtensions +{ drawBuffers?: WEBGL_draw_buffers; depthTexture?: OES_texture_float; loseContext?: WEBGL_lose_context; diff --git a/packages/core/src/geometry/Buffer.ts b/packages/core/src/geometry/Buffer.ts index 890ca47794..e494ab35ae 100644 --- a/packages/core/src/geometry/Buffer.ts +++ b/packages/core/src/geometry/Buffer.ts @@ -55,7 +55,7 @@ export class Buffer public static: boolean; public id: number; - disposeRunner: Runner; + disposeRunner: Runner; /** * A map of renderer IDs to webgl buffer diff --git a/packages/core/src/geometry/Geometry.ts b/packages/core/src/geometry/Geometry.ts index dbc3e1478c..5bd1e6a54d 100644 --- a/packages/core/src/geometry/Geometry.ts +++ b/packages/core/src/geometry/Geometry.ts @@ -106,7 +106,7 @@ export class Geometry * @param instance - Instancing flag * @return - Returns self, useful for chaining. */ - addAttribute(id: string, buffer: Buffer|Float32Array|Uint32Array|Array, size = 0, normalized = false, + addAttribute(id: string, buffer: Buffer | Float32Array | Uint32Array | Array, size = 0, normalized = false, type?: TYPES, stride?: number, start?: number, instance = false): this { if (!buffer) diff --git a/packages/core/src/mask/MaskSystem.ts b/packages/core/src/mask/MaskSystem.ts index dc175200c2..9eb6321ba3 100644 --- a/packages/core/src/mask/MaskSystem.ts +++ b/packages/core/src/mask/MaskSystem.ts @@ -89,7 +89,7 @@ export class MaskSystem implements ISystem * @param {PIXI.DisplayObject} target - Display Object to push the mask to * @param {PIXI.MaskData|PIXI.Sprite|PIXI.Graphics|PIXI.DisplayObject} maskData - The masking data. */ - push(target: IMaskTarget, maskDataOrTarget: MaskData|IMaskTarget): void + push(target: IMaskTarget, maskDataOrTarget: MaskData | IMaskTarget): void { let maskData = maskDataOrTarget as MaskData; diff --git a/packages/core/src/renderTexture/RenderTexture.ts b/packages/core/src/renderTexture/RenderTexture.ts index ce0c2d618e..a2a12a934e 100644 --- a/packages/core/src/renderTexture/RenderTexture.ts +++ b/packages/core/src/renderTexture/RenderTexture.ts @@ -57,14 +57,14 @@ export class RenderTexture extends Texture * * @readonly */ - public filterFrame: Rectangle|null; + public filterFrame: Rectangle | null; /** * The key for pooled texture of FilterSystem. * * @see PIXI.RenderTexturePool */ - public filterPoolKey: string|number|null; + public filterPoolKey: string | number | null; /** * @param baseRenderTexture - The base texture object that this texture uses. diff --git a/packages/core/src/renderTexture/RenderTexturePool.ts b/packages/core/src/renderTexture/RenderTexturePool.ts index 08c45f24f7..b3ec37851d 100644 --- a/packages/core/src/renderTexture/RenderTexturePool.ts +++ b/packages/core/src/renderTexture/RenderTexturePool.ts @@ -28,7 +28,7 @@ export class RenderTexturePool * @default false */ public enableFullScreen: boolean; - texturePool: {[x in string|number]: RenderTexture[]}; + texturePool: {[x in string | number]: RenderTexture[]}; private _pixelsWidth: number; private _pixelsHeight: number; diff --git a/packages/core/src/shader/utils/defaultValue.ts b/packages/core/src/shader/utils/defaultValue.ts index 748e8c0afd..74824226e2 100644 --- a/packages/core/src/shader/utils/defaultValue.ts +++ b/packages/core/src/shader/utils/defaultValue.ts @@ -17,7 +17,10 @@ function booleanArray(size: number): Array * @param {number} size * @private */ -export function defaultValue(type: string, size: number): number|Float32Array|Int32Array|Uint32Array|boolean|boolean[] +export function defaultValue( + type: string, + size: number +): number | Float32Array | Int32Array | Uint32Array | boolean | boolean[] { switch (type) { diff --git a/packages/core/src/shader/utils/generateUniformBufferSync.ts b/packages/core/src/shader/utils/generateUniformBufferSync.ts index 43116e978e..4eb784e33d 100644 --- a/packages/core/src/shader/utils/generateUniformBufferSync.ts +++ b/packages/core/src/shader/utils/generateUniformBufferSync.ts @@ -92,7 +92,8 @@ const GLSL_TO_STD40_SIZE: Dict = { mat4: 16 * 4, }; -interface UBOElement { +interface UBOElement +{ data: IUniformData offset: number, dataLen: number, diff --git a/packages/core/src/textures/BaseTexture.ts b/packages/core/src/textures/BaseTexture.ts index e1e2ecf7d6..298eda283a 100644 --- a/packages/core/src/textures/BaseTexture.ts +++ b/packages/core/src/textures/BaseTexture.ts @@ -15,9 +15,10 @@ const defaultBufferOptions = { alphaMode: ALPHA_MODES.NPM, }; -export type ImageSource = HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|ImageBitmap; +export type ImageSource = HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap; -export interface IBaseTextureOptions { +export interface IBaseTextureOptions +{ alphaMode?: ALPHA_MODES; mipmap?: MIPMAP_MODES; anisotropicLevel?: number; @@ -629,7 +630,7 @@ export class BaseTexture * @param {boolean} [strict] - Enforce strict-mode, see {@link PIXI.settings.STRICT_TEXTURE_CACHE}. * @returns {PIXI.BaseTexture} The new base texture. */ - static from(source: ImageSource|string, + static from(source: ImageSource | string, options?: IBaseTextureOptions, strict = settings.STRICT_TEXTURE_CACHE): BaseTexture { const isFrame = typeof source === 'string'; @@ -680,7 +681,7 @@ export class BaseTexture * @param options - See {@link PIXI.BaseTexture}'s constructor for options. * @return - The resulting new BaseTexture */ - static fromBuffer(buffer: Float32Array|Uint8Array, + static fromBuffer(buffer: Float32Array | Uint8Array, width: number, height: number, options?: IBaseTextureOptions): BaseTexture { buffer = buffer || new Float32Array(width * height * 4); @@ -723,7 +724,7 @@ export class BaseTexture * @param {string|PIXI.BaseTexture} baseTexture - id of a BaseTexture to be removed, or a BaseTexture instance itself. * @return {PIXI.BaseTexture|null} The BaseTexture that was removed. */ - static removeFromCache(baseTexture: string | BaseTexture): BaseTexture|null + static removeFromCache(baseTexture: string | BaseTexture): BaseTexture | null { if (typeof baseTexture === 'string') { diff --git a/packages/core/src/textures/Texture.ts b/packages/core/src/textures/Texture.ts index 5e7e6dee7b..d44b95168b 100644 --- a/packages/core/src/textures/Texture.ts +++ b/packages/core/src/textures/Texture.ts @@ -14,7 +14,7 @@ import type { TextureMatrix } from './TextureMatrix'; const DEFAULT_UVS = new TextureUvs(); -export type TextureSource = string|BaseTexture|ImageSource; +export type TextureSource = string | BaseTexture | ImageSource; export interface Texture extends GlobalMixins.Texture, EventEmitter {} @@ -453,7 +453,7 @@ export class Texture extends EventEmitter * @param options - See {@link PIXI.BaseTexture}'s constructor for options. * @return - The resulting new BaseTexture */ - static fromBuffer(buffer: Float32Array|Uint8Array, + static fromBuffer(buffer: Float32Array | Uint8Array, width: number, height: number, options?: IBaseTextureOptions): Texture { return new Texture(BaseTexture.fromBuffer(buffer, width, height, options)); @@ -468,7 +468,7 @@ export class Texture extends EventEmitter * specified, only `imageUrl` will be used as the cache ID. * @return - Output texture */ - static fromLoader(source: HTMLImageElement|HTMLCanvasElement|string, + static fromLoader(source: HTMLImageElement | HTMLCanvasElement | string, imageUrl: string, name?: string, options?: IBaseTextureOptions): Promise> { const baseTexture = new BaseTexture(source, Object.assign({ @@ -546,7 +546,7 @@ export class Texture extends EventEmitter * @param texture - id of a Texture to be removed, or a Texture instance itself * @return - The Texture that was removed */ - static removeFromCache(texture: string|Texture): Texture|null + static removeFromCache(texture: string | Texture): Texture | null { if (typeof texture === 'string') { diff --git a/packages/core/src/textures/TextureGCSystem.ts b/packages/core/src/textures/TextureGCSystem.ts index fe17f8800e..dd45182693 100644 --- a/packages/core/src/textures/TextureGCSystem.ts +++ b/packages/core/src/textures/TextureGCSystem.ts @@ -6,7 +6,8 @@ import type { Renderer } from '../Renderer'; import type { Texture } from './Texture'; import type { RenderTexture } from '../renderTexture/RenderTexture'; -export interface IUnloadableTexture { +export interface IUnloadableTexture +{ _texture: Texture | RenderTexture; children: IUnloadableTexture[]; } diff --git a/packages/core/src/textures/TextureSystem.ts b/packages/core/src/textures/TextureSystem.ts index 2a2a8b7cd1..ade462aaf4 100644 --- a/packages/core/src/textures/TextureSystem.ts +++ b/packages/core/src/textures/TextureSystem.ts @@ -133,7 +133,7 @@ export class TextureSystem implements ISystem * @param texture_ - Texture to bind * @param [location=0] - Location to bind at */ - bind(texture: Texture|BaseTexture, location = 0): void + bind(texture: Texture | BaseTexture, location = 0): void { const { gl } = this; @@ -374,7 +374,7 @@ export class TextureSystem implements ISystem * @param texture_ - the texture to destroy * @param [skipRemove=false] - Whether to skip removing the texture from the TextureManager. */ - destroyTexture(texture: BaseTexture|Texture, skipRemove?: boolean): void + destroyTexture(texture: BaseTexture | Texture, skipRemove?: boolean): void { const { gl } = this; diff --git a/packages/core/src/textures/resources/ArrayResource.ts b/packages/core/src/textures/resources/ArrayResource.ts index 260321dd5e..2e13407232 100644 --- a/packages/core/src/textures/resources/ArrayResource.ts +++ b/packages/core/src/textures/resources/ArrayResource.ts @@ -21,7 +21,7 @@ export class ArrayResource extends AbstractMultiResource * @param {number} [options.width] - Width of the resource * @param {number} [options.height] - Height of the resource */ - constructor(source: number|Array, options?: ISize) + constructor(source: number | Array, options?: ISize) { const { width, height } = options || {}; diff --git a/packages/core/src/textures/resources/BaseImageResource.ts b/packages/core/src/textures/resources/BaseImageResource.ts index 85cabac3d8..ff5c227993 100644 --- a/packages/core/src/textures/resources/BaseImageResource.ts +++ b/packages/core/src/textures/resources/BaseImageResource.ts @@ -52,7 +52,7 @@ export class BaseImageResource extends Resource * @param url - URL to check * @param crossorigin - Cross origin value to use */ - static crossOrigin(element: HTMLImageElement|HTMLVideoElement, url: string, crossorigin?: boolean|string): void + static crossOrigin(element: HTMLImageElement | HTMLVideoElement, url: string, crossorigin?: boolean | string): void { if (crossorigin === undefined && url.indexOf('data:') !== 0) { diff --git a/packages/core/src/textures/resources/BufferResource.ts b/packages/core/src/textures/resources/BufferResource.ts index 402adeeb2b..05ba55a0b1 100644 --- a/packages/core/src/textures/resources/BufferResource.ts +++ b/packages/core/src/textures/resources/BufferResource.ts @@ -20,7 +20,7 @@ export class BufferResource extends Resource * Source array * Cannot be {@code ClampedUint8Array} because it cant be uploaded to WebGL */ - data: Float32Array|Uint8Array|Uint16Array|Int32Array|Uint32Array; + data: Float32Array | Uint8Array | Uint16Array | Int32Array | Uint32Array; /** * @param source - Source buffer @@ -28,7 +28,7 @@ export class BufferResource extends Resource * @param {number} options.width - Width of the texture * @param {number} options.height - Height of the texture */ - constructor(source: Float32Array|Uint8Array|Uint16Array|Int32Array|Uint32Array, options: ISize) + constructor(source: Float32Array | Uint8Array | Uint16Array | Int32Array | Uint32Array, options: ISize) { const { width, height } = options || {}; @@ -106,7 +106,7 @@ export class BufferResource extends Resource * @param {*} source - The source object * @return {boolean} `true` if */ - static test(source: unknown): source is Float32Array|Uint8Array|Uint32Array + static test(source: unknown): source is Float32Array | Uint8Array | Uint32Array { return source instanceof Float32Array || source instanceof Uint8Array diff --git a/packages/core/src/textures/resources/CanvasResource.ts b/packages/core/src/textures/resources/CanvasResource.ts index 85ec31a6f9..ab92459c16 100644 --- a/packages/core/src/textures/resources/CanvasResource.ts +++ b/packages/core/src/textures/resources/CanvasResource.ts @@ -26,7 +26,7 @@ export class CanvasResource extends BaseImageResource * @param {*} source - The source object * @return {boolean} `true` if source is HTMLCanvasElement or OffscreenCanvas */ - static test(source: unknown): source is OffscreenCanvas|HTMLCanvasElement + static test(source: unknown): source is OffscreenCanvas | HTMLCanvasElement { const { OffscreenCanvas } = globalThis; diff --git a/packages/core/src/textures/resources/CubeResource.ts b/packages/core/src/textures/resources/CubeResource.ts index 19d1c56d5f..625a19515d 100644 --- a/packages/core/src/textures/resources/CubeResource.ts +++ b/packages/core/src/textures/resources/CubeResource.ts @@ -46,7 +46,7 @@ export class CubeResource extends AbstractMultiResource * @param {number} [options.linkBaseTexture=true] - In case BaseTextures are supplied, * whether to copy them or use */ - constructor(source?: ArrayFixed, options?: ICubeResourceOptions) + constructor(source?: ArrayFixed, options?: ICubeResourceOptions) { const { width, height, autoLoad, linkBaseTexture } = options || {}; @@ -181,7 +181,7 @@ export class CubeResource extends AbstractMultiResource * @param {*} source - The source object * @return {boolean} `true` if source is an array of 6 elements */ - static test(source: unknown): source is ArrayFixed + static test(source: unknown): source is ArrayFixed { return Array.isArray(source) && source.length === CubeResource.SIDES; } diff --git a/packages/core/src/textures/resources/ImageResource.ts b/packages/core/src/textures/resources/ImageResource.ts index 8357a66cd1..3596ac7e93 100644 --- a/packages/core/src/textures/resources/ImageResource.ts +++ b/packages/core/src/textures/resources/ImageResource.ts @@ -15,7 +15,7 @@ export interface IImageResourceOptions createBitmap?: boolean; /** Load image using cross origin. */ - crossorigin?: boolean|string; + crossorigin?: boolean | string; /** Premultiply image alpha in bitmap. */ alphaMode?: ALPHA_MODES; @@ -80,7 +80,7 @@ export class ImageResource extends BaseImageResource * @param {boolean} [options.crossorigin=true] - Load image using cross origin * @param {PIXI.ALPHA_MODES} [options.alphaMode=PIXI.ALPHA_MODES.UNPACK] - Premultiply image alpha in bitmap */ - constructor(source: HTMLImageElement|string, options?: IImageResourceOptions) + constructor(source: HTMLImageElement | string, options?: IImageResourceOptions) { options = options || {}; @@ -325,7 +325,7 @@ export class ImageResource extends BaseImageResource * @param {*} source - The source object * @return {boolean} `true` if source is string or HTMLImageElement */ - static test(source: unknown): source is string|HTMLImageElement + static test(source: unknown): source is string | HTMLImageElement { return typeof source === 'string' || source instanceof HTMLImageElement; } diff --git a/packages/core/src/textures/resources/SVGResource.ts b/packages/core/src/textures/resources/SVGResource.ts index 7432530b57..8187d56c2e 100644 --- a/packages/core/src/textures/resources/SVGResource.ts +++ b/packages/core/src/textures/resources/SVGResource.ts @@ -10,7 +10,7 @@ export interface ISVGResourceOptions width?: number; height?: number; autoLoad?: boolean; - crossorigin?: boolean|string; + crossorigin?: boolean | string; } /** * Resource type for SVG elements and graphics. @@ -38,7 +38,7 @@ export class SVGResource extends BaseImageResource private _load: Promise; /** Cross origin value to use */ - private _crossorigin?: boolean|string; + private _crossorigin?: boolean | string; /** * @param sourceBase64 - Base64 encoded SVG element or URL for SVG file. diff --git a/packages/core/src/textures/resources/VideoResource.ts b/packages/core/src/textures/resources/VideoResource.ts index 705e2dd7fe..f7cc5a5624 100644 --- a/packages/core/src/textures/resources/VideoResource.ts +++ b/packages/core/src/textures/resources/VideoResource.ts @@ -8,7 +8,7 @@ export interface IVideoResourceOptions autoLoad?: boolean; autoPlay?: boolean; updateFPS?: number; - crossorigin?: boolean|string; + crossorigin?: boolean | string; } export interface IVideoResourceOptionsElement @@ -70,7 +70,9 @@ export class VideoResource extends BaseImageResource * Leave at 0 to update at every render. * @param {boolean} [options.crossorigin=true] - Load image using cross origin */ - constructor(source?: HTMLVideoElement|Array|string, options?: IVideoResourceOptions) + constructor( + source?: HTMLVideoElement | Array | string, options?: IVideoResourceOptions + ) { options = options || {}; diff --git a/packages/core/src/textures/resources/autoDetectResource.ts b/packages/core/src/textures/resources/autoDetectResource.ts index dbf90a3bc3..70805bb48e 100644 --- a/packages/core/src/textures/resources/autoDetectResource.ts +++ b/packages/core/src/textures/resources/autoDetectResource.ts @@ -15,11 +15,11 @@ export type IResourcePluginOptions = { [key: string]: any }; * All allowable options for autoDetectResource */ export type IAutoDetectOptions = ISize - | ICubeResourceOptions - | IImageResourceOptions - | ISVGResourceOptions - | IVideoResourceOptions - | IResourcePluginOptions; +| ICubeResourceOptions +| IImageResourceOptions +| ISVGResourceOptions +| IVideoResourceOptions +| IResourcePluginOptions; /** * Shape of supported resource plugins diff --git a/packages/core/src/textures/utils/mapTypeAndFormatToInternalFormat.ts b/packages/core/src/textures/utils/mapTypeAndFormatToInternalFormat.ts index dde0c3f738..d294f739e9 100644 --- a/packages/core/src/textures/utils/mapTypeAndFormatToInternalFormat.ts +++ b/packages/core/src/textures/utils/mapTypeAndFormatToInternalFormat.ts @@ -10,7 +10,7 @@ import { FORMATS, TYPES } from '@pixi/constants'; * @return {{ [type: number]: { [format: number]: number } }} Lookup table. */ export function mapTypeAndFormatToInternalFormat(gl: WebGLRenderingContextBase): - { [type: number]: { [format: number]: number } } +{ [type: number]: { [format: number]: number } } { let table; diff --git a/packages/core/test/SVGResource.tests.ts b/packages/core/test/SVGResource.tests.ts index e64deda431..2531295f92 100644 --- a/packages/core/test/SVGResource.tests.ts +++ b/packages/core/test/SVGResource.tests.ts @@ -180,7 +180,7 @@ describe('SVGResource', function () it('should return a size object from an SVG string with inverted quotes', function () { - const svgSize = SVGResource.getSize(""); // eslint-disable-line quotes + const svgSize = SVGResource.getSize(''); // eslint-disable-line quotes expect(svgSize) .to.be.an('object'); diff --git a/packages/display/src/Container.ts b/packages/display/src/Container.ts index e56b19b95b..1acc8bdc0e 100644 --- a/packages/display/src/Container.ts +++ b/packages/display/src/Container.ts @@ -757,7 +757,7 @@ export class Container extends DisplayObject * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true * Should it destroy the base texture of the child sprite */ - destroy(options?: IDestroyOptions|boolean): void + destroy(options?: IDestroyOptions | boolean): void { super.destroy(); diff --git a/packages/display/src/DisplayObject.ts b/packages/display/src/DisplayObject.ts index c8f4e9d9d9..ece32e5d6c 100644 --- a/packages/display/src/DisplayObject.ts +++ b/packages/display/src/DisplayObject.ts @@ -7,7 +7,8 @@ import type { Filter, MaskData, Renderer } from '@pixi/core'; import type { IPointData, ObservablePoint } from '@pixi/math'; import type { Dict } from '@pixi/utils'; -export interface IDestroyOptions { +export interface IDestroyOptions +{ children?: boolean; texture?: boolean; baseTexture?: boolean; @@ -288,7 +289,7 @@ export abstract class DisplayObject extends EventEmitter * * @protected */ - public _mask: Container|MaskData; + public _mask: Container | MaskData; /** The bounds object, this is used to calculate and store the bounds of the displayObject. */ public _bounds: Bounds; @@ -709,7 +710,7 @@ export abstract class DisplayObject extends EventEmitter * all current event listeners and internal references. Do not use a DisplayObject * after calling `destroy()`. */ - destroy(_options?: IDestroyOptions|boolean): void + destroy(_options?: IDestroyOptions | boolean): void { if (this.parent) { @@ -984,12 +985,12 @@ export abstract class DisplayObject extends EventEmitter * * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask. */ - get mask(): Container|MaskData|null + get mask(): Container | MaskData | null { return this._mask; } - set mask(value: Container|MaskData|null) + set mask(value: Container | MaskData | null) { if (this._mask === value) { diff --git a/packages/events/src/EventBoundary.ts b/packages/events/src/EventBoundary.ts index d9b0466dfa..9645a756a7 100644 --- a/packages/events/src/EventBoundary.ts +++ b/packages/events/src/EventBoundary.ts @@ -58,8 +58,8 @@ type TrackingData = { * @ignore */ type EmitterListeners = Record - | { fn(...args: any[]): any, context: any } +| Array<{ fn(...args: any[]): any, context: any }> +| { fn(...args: any[]): any, context: any } >; /** diff --git a/packages/events/src/EventSystem.ts b/packages/events/src/EventSystem.ts index 3b3db9aadf..42bc9e22dd 100644 --- a/packages/events/src/EventSystem.ts +++ b/packages/events/src/EventSystem.ts @@ -506,7 +506,7 @@ export class EventSystem * @return An array containing a single normalized pointer event, in the case of a pointer * or mouse event, or a multiple normalized pointer events if there are multiple changed touches */ - private normalizeToPointerData(event: TouchEvent|MouseEvent|PointerEvent): PointerEvent[] + private normalizeToPointerData(event: TouchEvent | MouseEvent | PointerEvent): PointerEvent[] { const normalizedEvents = []; diff --git a/packages/events/src/FederatedEventTarget.ts b/packages/events/src/FederatedEventTarget.ts index 718f5e856d..81c167a630 100644 --- a/packages/events/src/FederatedEventTarget.ts +++ b/packages/events/src/FederatedEventTarget.ts @@ -4,44 +4,45 @@ import { FederatedEvent } from './FederatedEvent'; import type { EventEmitter } from '@pixi/utils'; export type Cursor = 'auto' - | 'default' - | 'none' - | 'context-menu' - | 'help' - | 'pointer' - | 'progress' - | 'wait' - | 'cell' - | 'crosshair' - | 'text' - | 'vertical-text' - | 'alias' - | 'copy' - | 'move' - | 'no-drop' - | 'not-allowed' - | 'e-resize' - | 'n-resize' - | 'ne-resize' - | 'nw-resize' - | 's-resize' - | 'se-resize' - | 'sw-resize' - | 'w-resize' - | 'ns-resize' - | 'ew-resize' - | 'nesw-resize' - | 'col-resize' - | 'nwse-resize' - | 'row-resize' - | 'all-scroll' - | 'zoom-in' - | 'zoom-out' - | 'grab' - | 'grabbing'; +| 'default' +| 'none' +| 'context-menu' +| 'help' +| 'pointer' +| 'progress' +| 'wait' +| 'cell' +| 'crosshair' +| 'text' +| 'vertical-text' +| 'alias' +| 'copy' +| 'move' +| 'no-drop' +| 'not-allowed' +| 'e-resize' +| 'n-resize' +| 'ne-resize' +| 'nw-resize' +| 's-resize' +| 'se-resize' +| 'sw-resize' +| 'w-resize' +| 'ns-resize' +| 'ew-resize' +| 'nesw-resize' +| 'col-resize' +| 'nwse-resize' +| 'row-resize' +| 'all-scroll' +| 'zoom-in' +| 'zoom-out' +| 'grab' +| 'grabbing'; // @ignore - This is documented elsewhere. -export interface IHitArea { +export interface IHitArea +{ contains(x: number, y: number): boolean; } @@ -50,7 +51,8 @@ export interface IHitArea { * * @memberof PIXI */ -export interface FederatedEventTarget extends EventEmitter, EventTarget { +export interface FederatedEventTarget extends EventEmitter, EventTarget +{ /** The cursor preferred when the mouse pointer is hovering over. */ cursor: Cursor | string; @@ -74,8 +76,8 @@ export interface FederatedEventTarget extends EventEmitter, EventTarget { } export const FederatedDisplayObject: Omit< - FederatedEventTarget, - 'parent' | 'children' | keyof EventEmitter | 'cursor' +FederatedEventTarget, +'parent' | 'children' | keyof EventEmitter | 'cursor' > = { /** * Enable interaction events for the DisplayObject. Touch, pointer and mouse diff --git a/packages/events/src/FederatedMouseEvent.ts b/packages/events/src/FederatedMouseEvent.ts index 928521f741..e6a56ff798 100644 --- a/packages/events/src/FederatedMouseEvent.ts +++ b/packages/events/src/FederatedMouseEvent.ts @@ -7,7 +7,7 @@ import { Point } from '@pixi/math'; * @memberof PIXI */ export class FederatedMouseEvent extends FederatedEvent< - MouseEvent | PointerEvent | TouchEvent +MouseEvent | PointerEvent | TouchEvent > implements MouseEvent { /** Whether the "alt" key was pressed when this mouse event occurred. */ diff --git a/packages/extract/src/Extract.ts b/packages/extract/src/Extract.ts index 449afa56dd..9dbf64466a 100644 --- a/packages/extract/src/Extract.ts +++ b/packages/extract/src/Extract.ts @@ -14,7 +14,8 @@ const BYTES_PER_PIXEL = 4; * @exemple * test: PixelExtractOptions = { x: 15, y: 20, resolution: 4, width: 10, height: 10 } */ -export interface PixelExtractOptions { +export interface PixelExtractOptions +{ x: number, y: number, height: number, @@ -66,7 +67,7 @@ export class Extract implements IRendererPlugin * @param quality - JPEG or Webp compression from 0 to 1. Default is 0.92. * @return - HTML Image of the target */ - public image(target: DisplayObject|RenderTexture, format?: string, quality?: number): HTMLImageElement + public image(target: DisplayObject | RenderTexture, format?: string, quality?: number): HTMLImageElement { const image = new Image(); @@ -85,7 +86,7 @@ export class Extract implements IRendererPlugin * @param quality - JPEG or Webp compression from 0 to 1. Default is 0.92. * @return - A base64 encoded string of the texture. */ - public base64(target: DisplayObject|RenderTexture, format?: string, quality?: number): string + public base64(target: DisplayObject | RenderTexture, format?: string, quality?: number): string { return this.canvas(target).toDataURL(format, quality); } @@ -97,7 +98,7 @@ export class Extract implements IRendererPlugin * to convert. If left empty will use the main renderer * @return - A Canvas element with the texture rendered on. */ - public canvas(target: DisplayObject|RenderTexture): HTMLCanvasElement + public canvas(target: DisplayObject | RenderTexture): HTMLCanvasElement { const renderer = this.renderer; let resolution; @@ -197,7 +198,7 @@ export class Extract implements IRendererPlugin * to convert. If left empty will use the main renderer * @return - One-dimensional array containing the pixel data of the entire texture */ - public pixels(target?: DisplayObject|RenderTexture, options?: PixelExtractOptions): Uint8Array + public pixels(target?: DisplayObject | RenderTexture, options?: PixelExtractOptions): Uint8Array { const renderer = this.renderer; let resolution; diff --git a/packages/filters/filter-blur/src/generateBlurFragSource.ts b/packages/filters/filter-blur/src/generateBlurFragSource.ts index 090ad96e12..376d2c3956 100644 --- a/packages/filters/filter-blur/src/generateBlurFragSource.ts +++ b/packages/filters/filter-blur/src/generateBlurFragSource.ts @@ -1,4 +1,5 @@ -interface IGAUSSIAN_VALUES { +interface IGAUSSIAN_VALUES +{ [x: number]: number[]; } const GAUSSIAN_VALUES: IGAUSSIAN_VALUES = { diff --git a/packages/graphics-extras/src/index.ts b/packages/graphics-extras/src/index.ts index 795213c066..808613cf89 100644 --- a/packages/graphics-extras/src/index.ts +++ b/packages/graphics-extras/src/index.ts @@ -6,7 +6,8 @@ import { drawRegularPolygon } from './drawRegularPolygon'; import { drawRoundedPolygon } from './drawRoundedPolygon'; import { drawStar } from './drawStar'; -export interface IGraphicsExtras { +export interface IGraphicsExtras +{ drawTorus: typeof drawTorus; drawChamferRect: typeof drawChamferRect; drawFilletRect: typeof drawFilletRect; diff --git a/packages/graphics/src/Graphics.ts b/packages/graphics/src/Graphics.ts index 753af9d5eb..3c337c4a79 100644 --- a/packages/graphics/src/Graphics.ts +++ b/packages/graphics/src/Graphics.ts @@ -26,7 +26,8 @@ import { LINE_JOIN, LINE_CAP } from './const'; /** * Batch element computed from Graphics geometry */ -export interface IGraphicsBatchElement { +export interface IGraphicsBatchElement +{ vertexData: Float32Array; blendMode: BLEND_MODES; indices: Uint16Array | Uint32Array; @@ -38,14 +39,16 @@ export interface IGraphicsBatchElement { _texture: Texture; } -export interface IFillStyleOptions { +export interface IFillStyleOptions +{ color?: number; alpha?: number; texture?: Texture; matrix?: Matrix; } -export interface ILineStyleOptions extends IFillStyleOptions { +export interface ILineStyleOptions extends IFillStyleOptions +{ width?: number; alignment?: number; native?: boolean; @@ -742,8 +745,8 @@ export class Graphics extends Container return this.drawShape(new Ellipse(x, y, width, height)); } - public drawPolygon(...path: Array | Array): this - public drawPolygon(path: Array | Array | Polygon): this + public drawPolygon(...path: Array | Array): this; + public drawPolygon(path: Array | Array | Polygon): this; /** * Draws a polygon using the given path. @@ -1223,7 +1226,7 @@ export class Graphics extends Container * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true * Should it destroy the base texture of the child sprite */ - public destroy(options?: IDestroyOptions|boolean): void + public destroy(options?: IDestroyOptions | boolean): void { this._geometry.refCount--; if (this._geometry.refCount === 0) diff --git a/packages/graphics/src/const.ts b/packages/graphics/src/const.ts index 7d54aa9ac7..b0b13f3b8e 100644 --- a/packages/graphics/src/const.ts +++ b/packages/graphics/src/const.ts @@ -12,7 +12,9 @@ * @property {string} BEVEL - 'bevel': add a square butt at each end of line segment and fill the triangle at turn * @property {string} ROUND - 'round': add an arc at the joint */ -export enum LINE_JOIN { +export enum LINE_JOIN +// eslint-disable-next-line @typescript-eslint/indent +{ MITER = 'miter', BEVEL = 'bevel', ROUND = 'round' @@ -31,13 +33,16 @@ export enum LINE_JOIN { * @property {string} ROUND - 'round': add semicircle at ends * @property {string} SQUARE - 'square': add square at end (like `BUTT` except more length at end) */ -export enum LINE_CAP { +export enum LINE_CAP +// eslint-disable-next-line @typescript-eslint/indent +{ BUTT = 'butt', ROUND = 'round', SQUARE = 'square' } -export interface IGraphicsCurvesSettings { +export interface IGraphicsCurvesSettings +{ adaptive: boolean; maxLength: number; minSegments: number; diff --git a/packages/graphics/src/utils/ArcUtils.ts b/packages/graphics/src/utils/ArcUtils.ts index 0aa46d393d..0147650a74 100644 --- a/packages/graphics/src/utils/ArcUtils.ts +++ b/packages/graphics/src/utils/ArcUtils.ts @@ -1,7 +1,8 @@ import { GRAPHICS_CURVES } from '../const'; import { PI_2 } from '@pixi/math'; -interface IArcLikeShape { +interface IArcLikeShape +{ cx: number; cy: number; radius: number; diff --git a/packages/graphics/src/utils/IShapeBuildCommand.ts b/packages/graphics/src/utils/IShapeBuildCommand.ts index e3ffc23014..14573617f4 100644 --- a/packages/graphics/src/utils/IShapeBuildCommand.ts +++ b/packages/graphics/src/utils/IShapeBuildCommand.ts @@ -1,7 +1,8 @@ import type { GraphicsData } from '../GraphicsData'; import type { GraphicsGeometry } from '../GraphicsGeometry'; -export interface IShapeBuildCommand { +export interface IShapeBuildCommand +{ build(graphicsData: GraphicsData): void; triangulate(graphicsData: GraphicsData, target: GraphicsGeometry): void; } diff --git a/packages/interaction/src/InteractionManager.ts b/packages/interaction/src/InteractionManager.ts index 8cbaba67eb..30c7638e32 100644 --- a/packages/interaction/src/InteractionManager.ts +++ b/packages/interaction/src/InteractionManager.ts @@ -31,13 +31,15 @@ const hitTestEvent: TestInteractionEvent = { }, }; -export interface InteractionManagerOptions { +export interface InteractionManagerOptions +{ autoPreventDefault?: boolean; interactionFrequency?: number; useSystemTicker?: boolean; } -export interface DelayedEvent { +export interface DelayedEvent +{ displayObject: DisplayObject; eventString: string; eventData: InteractionEvent; diff --git a/packages/interaction/src/interactiveTarget.ts b/packages/interaction/src/interactiveTarget.ts index baa28049c5..eca155e90a 100644 --- a/packages/interaction/src/interactiveTarget.ts +++ b/packages/interaction/src/interactiveTarget.ts @@ -1,47 +1,49 @@ import type { InteractionTrackingData } from './InteractionTrackingData'; type Cursor = 'auto' - | 'default' - | 'none' - | 'context-menu' - | 'help' - | 'pointer' - | 'progress' - | 'wait' - | 'cell' - | 'crosshair' - | 'text' - | 'vertical-text' - | 'alias' - | 'copy' - | 'move' - | 'no-drop' - | 'not-allowed' - | 'e-resize' - | 'n-resize' - | 'ne-resize' - | 'nw-resize' - | 's-resize' - | 'se-resize' - | 'sw-resize' - | 'w-resize' - | 'ns-resize' - | 'ew-resize' - | 'nesw-resize' - | 'col-resize' - | 'nwse-resize' - | 'row-resize' - | 'all-scroll' - | 'zoom-in' - | 'zoom-out' - | 'grab' - | 'grabbing'; +| 'default' +| 'none' +| 'context-menu' +| 'help' +| 'pointer' +| 'progress' +| 'wait' +| 'cell' +| 'crosshair' +| 'text' +| 'vertical-text' +| 'alias' +| 'copy' +| 'move' +| 'no-drop' +| 'not-allowed' +| 'e-resize' +| 'n-resize' +| 'ne-resize' +| 'nw-resize' +| 's-resize' +| 'se-resize' +| 'sw-resize' +| 'w-resize' +| 'ns-resize' +| 'ew-resize' +| 'nesw-resize' +| 'col-resize' +| 'nwse-resize' +| 'row-resize' +| 'all-scroll' +| 'zoom-in' +| 'zoom-out' +| 'grab' +| 'grabbing'; -export interface IHitArea { +export interface IHitArea +{ contains(x: number, y: number): boolean; } -export interface InteractiveTarget { +export interface InteractiveTarget +{ interactive: boolean; interactiveChildren: boolean; hitArea: IHitArea | null; diff --git a/packages/loaders/src/Loader.ts b/packages/loaders/src/Loader.ts index 1e80ed2d4b..8264d03a66 100644 --- a/packages/loaders/src/Loader.ts +++ b/packages/loaders/src/Loader.ts @@ -10,7 +10,8 @@ const rgxExtractUrlHash = /(#[\w-]+)?$/; export type ILoaderMiddleware = (resource: LoaderResource, next: (...args: any[]) => void) => void; -export interface ILoaderAdd { +export interface ILoaderAdd +{ (this: Loader, name: string, url: string, callback?: LoaderResource.OnCompleteSignal): Loader; (this: Loader, name: string, url: string, options?: IAddOptions, callback?: LoaderResource.OnCompleteSignal): Loader; (this: Loader, url: string, callback?: LoaderResource.OnCompleteSignal): Loader; @@ -38,7 +39,8 @@ export interface ILoaderAdd { * @property callback - Alias for `onComplete`. * @property metadata - Extra configuration for middleware and the Resource object. */ -export interface IAddOptions { +export interface IAddOptions +{ name?: string; key?: string; url?: string; @@ -773,7 +775,8 @@ export { Loader }; * @property use - Middleware function to run after load, the * arguments for this are `(resource, next)` */ -export interface ILoaderPlugin { +export interface ILoaderPlugin +{ /** * Function to call immediate after registering plugin. */ diff --git a/packages/loaders/src/LoaderResource.ts b/packages/loaders/src/LoaderResource.ts index e7e7a374e8..6f1ff963f2 100644 --- a/packages/loaders/src/LoaderResource.ts +++ b/packages/loaders/src/LoaderResource.ts @@ -1235,7 +1235,8 @@ class LoaderResource } // eslint-disable-next-line @typescript-eslint/no-namespace -namespace LoaderResource { +namespace LoaderResource +{ /** * When the resource starts to load. * @@ -1270,15 +1271,17 @@ namespace LoaderResource { * @enum {number} * @memberof PIXI.LoaderResource */ - export enum STATUS_FLAGS { + export enum STATUS_FLAGS + // eslint-disable-next-line @typescript-eslint/indent + { /** None */ - NONE= 0, + NONE = 0, /** Data URL */ - DATA_URL= (1 << 0), + DATA_URL = (1 << 0), /** Complete */ - COMPLETE= (1 << 1), + COMPLETE = (1 << 1), /** Loading */ - LOADING= (1 << 2), + LOADING = (1 << 2), } /** @@ -1289,21 +1292,23 @@ namespace LoaderResource { * @enum {number} * @memberof PIXI.LoaderResource */ - export enum TYPE { + export enum TYPE + // eslint-disable-next-line @typescript-eslint/indent + { /** Unknown */ - UNKNOWN= 0, + UNKNOWN = 0, /** JSON */ - JSON= 1, + JSON = 1, /** XML */ - XML= 2, + XML = 2, /** Image */ - IMAGE= 3, + IMAGE = 3, /** Audio */ - AUDIO= 4, + AUDIO = 4, /** Video */ - VIDEO= 5, + VIDEO = 5, /** Plain text */ - TEXT= 6, + TEXT = 6, } /** @@ -1314,7 +1319,9 @@ namespace LoaderResource { * @enum {number} * @memberof PIXI.LoaderResource */ - export enum LOAD_TYPE { + export enum LOAD_TYPE + // eslint-disable-next-line @typescript-eslint/indent + { /** Uses XMLHttpRequest to load the resource. */ XHR = 1, /** Uses an `Image` object to load the resource. */ @@ -1333,7 +1340,9 @@ namespace LoaderResource { * @enum {string} * @memberof PIXI.LoaderResource */ - export enum XHR_RESPONSE_TYPE { + export enum XHR_RESPONSE_TYPE + // eslint-disable-next-line @typescript-eslint/indent + { /** string */ DEFAULT = 'text', /** ArrayBuffer */ diff --git a/packages/loaders/src/base/AsyncQueue.ts b/packages/loaders/src/base/AsyncQueue.ts index 5a5c582abb..c21de886ca 100644 --- a/packages/loaders/src/base/AsyncQueue.ts +++ b/packages/loaders/src/base/AsyncQueue.ts @@ -29,7 +29,8 @@ function onlyOnce(fn: () => void): () => void } // eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface IQueue { +export interface IQueue +{ } diff --git a/packages/math-extras/global.d.ts b/packages/math-extras/global.d.ts index 8165d10230..2a5d207d38 100644 --- a/packages/math-extras/global.d.ts +++ b/packages/math-extras/global.d.ts @@ -26,7 +26,8 @@ declare namespace GlobalMixins } } -interface Vector2Math { +interface Vector2Math +{ add(other: import('@pixi/math').IPointData): import('@pixi/math').Point; add(other: import('@pixi/math').IPointData, outPoint: T): T; diff --git a/packages/math/src/Matrix.ts b/packages/math/src/Matrix.ts index 2301c8ddc4..d58a08ec26 100644 --- a/packages/math/src/Matrix.ts +++ b/packages/math/src/Matrix.ts @@ -36,7 +36,7 @@ export class Matrix /** @default 0 */ public ty: number; - public array: Float32Array|null = null; + public array: Float32Array | null = null; /** * @param a - x scale diff --git a/packages/math/src/const.ts b/packages/math/src/const.ts index 6fcfbf8450..915115a0e6 100644 --- a/packages/math/src/const.ts +++ b/packages/math/src/const.ts @@ -37,7 +37,9 @@ export const DEG_TO_RAD = Math.PI / 180; * @property {number} ELIP Ellipse * @property {number} RREC Rounded Rectangle */ -export enum SHAPES { +export enum SHAPES +// eslint-disable-next-line @typescript-eslint/indent +{ POLY = 0, RECT = 1, CIRC = 2, diff --git a/packages/math/src/shapes/Polygon.ts b/packages/math/src/shapes/Polygon.ts index b36bdc01e6..c0c1dd337b 100644 --- a/packages/math/src/shapes/Polygon.ts +++ b/packages/math/src/shapes/Polygon.ts @@ -22,8 +22,8 @@ export class Polygon */ public readonly type: SHAPES.POLY; - constructor(points: IPointData[]|number[]); - constructor(...points: IPointData[]|number[]); + constructor(points: IPointData[] | number[]); + constructor(...points: IPointData[] | number[]); /** * @param {PIXI.IPointData[]|number[]} points - This can be an array of Points @@ -34,7 +34,7 @@ export class Polygon */ constructor(...points: any[]) { - let flat: IPointData[]|number[] = Array.isArray(points[0]) ? points[0] : points; + let flat: IPointData[] | number[] = Array.isArray(points[0]) ? points[0] : points; // if this is an array of points, convert it to a flat array of numbers if (typeof flat[0] !== 'number') diff --git a/packages/mesh-extras/src/SimplePlane.ts b/packages/mesh-extras/src/SimplePlane.ts index 0b9c52cdac..c64072e83c 100644 --- a/packages/mesh-extras/src/SimplePlane.ts +++ b/packages/mesh-extras/src/SimplePlane.ts @@ -99,7 +99,7 @@ export class SimplePlane extends Mesh super._render(renderer); } - public destroy(options?: IDestroyOptions|boolean): void + public destroy(options?: IDestroyOptions | boolean): void { this.shader.texture.off('update', this.textureUpdated, this); super.destroy(options); diff --git a/packages/mesh/src/Mesh.ts b/packages/mesh/src/Mesh.ts index a1002e703a..d4cfd08004 100644 --- a/packages/mesh/src/Mesh.ts +++ b/packages/mesh/src/Mesh.ts @@ -482,7 +482,7 @@ export class Mesh extends Container return false; } - public destroy(options?: IDestroyOptions|boolean): void + public destroy(options?: IDestroyOptions | boolean): void { super.destroy(options); diff --git a/packages/mesh/src/MeshMaterial.ts b/packages/mesh/src/MeshMaterial.ts index 6cc9e6abbb..e91def2d42 100644 --- a/packages/mesh/src/MeshMaterial.ts +++ b/packages/mesh/src/MeshMaterial.ts @@ -7,7 +7,8 @@ import vertex from './shader/mesh.vert'; import type { Texture } from '@pixi/core'; import type { Dict } from '@pixi/utils'; -export interface IMeshMaterialOptions { +export interface IMeshMaterialOptions +{ alpha?: number; tint?: number; pluginName?: string; diff --git a/packages/mixin-cache-as-bitmap/global.d.ts b/packages/mixin-cache-as-bitmap/global.d.ts index 8fadc0b8a3..83f5cd3024 100644 --- a/packages/mixin-cache-as-bitmap/global.d.ts +++ b/packages/mixin-cache-as-bitmap/global.d.ts @@ -1,6 +1,7 @@ declare namespace GlobalMixins { - interface DisplayObject { + interface DisplayObject + { cacheAsBitmap: boolean; cacheAsBitmapResolution: number; cacheAsBitmapMultisample: import('@pixi/constants').MSAA_QUALITY; @@ -15,6 +16,6 @@ declare namespace GlobalMixins _renderCachedCanvas(renderer: import('@pixi/core').AbstractRenderer): void; _initCachedDisplayObjectCanvas(renderer: import('@pixi/core').AbstractRenderer): void; _destroyCachedDisplayObject(): void; - _cacheAsBitmapDestroy(options?: import('@pixi/display').IDestroyOptions|boolean): void; + _cacheAsBitmapDestroy(options?: import('@pixi/display').IDestroyOptions | boolean): void; } } diff --git a/packages/mixin-cache-as-bitmap/src/index.ts b/packages/mixin-cache-as-bitmap/src/index.ts index 98c0a54946..2cb1f813b7 100644 --- a/packages/mixin-cache-as-bitmap/src/index.ts +++ b/packages/mixin-cache-as-bitmap/src/index.ts @@ -8,7 +8,8 @@ import { MSAA_QUALITY } from '@pixi/constants'; // Don't import CanvasRender to remove dependency on this optional package // this type should satisify these requirements for cacheAsBitmap types -interface CanvasRenderer extends AbstractRenderer { +interface CanvasRenderer extends AbstractRenderer +{ context: CanvasRenderingContext2D; } @@ -35,8 +36,8 @@ export class CacheData public originalCalculateBounds: () => void; public originalGetLocalBounds: (rect?: Rectangle) => Rectangle; public originalUpdateTransform: () => void; - public originalDestroy: (options?: IDestroyOptions|boolean) => void; - public originalMask: Container|MaskData; + public originalDestroy: (options?: IDestroyOptions | boolean) => void; + public originalMask: Container | MaskData; public originalFilterArea: Rectangle; public originalContainsPoint: (point: IPointData) => boolean; public sprite: Sprite; @@ -515,7 +516,7 @@ DisplayObject.prototype._destroyCachedDisplayObject = function _destroyCachedDis * have been set to that value. * Used when destroying containers, see the Container.destroy method. */ -DisplayObject.prototype._cacheAsBitmapDestroy = function _cacheAsBitmapDestroy(options?: IDestroyOptions|boolean): void +DisplayObject.prototype._cacheAsBitmapDestroy = function _cacheAsBitmapDestroy(options?: IDestroyOptions | boolean): void { this.cacheAsBitmap = false; this.destroy(options); diff --git a/packages/particle-container/src/ParticleContainer.ts b/packages/particle-container/src/ParticleContainer.ts index 02054cf47b..3727810f37 100644 --- a/packages/particle-container/src/ParticleContainer.ts +++ b/packages/particle-container/src/ParticleContainer.ts @@ -6,7 +6,8 @@ import type { BaseTexture, Renderer } from '@pixi/core'; import type { ParticleBuffer } from './ParticleBuffer'; import type { IDestroyOptions } from '@pixi/display'; -export interface IParticleProperties { +export interface IParticleProperties +{ vertices?: boolean; position?: boolean; rotation?: boolean; @@ -271,7 +272,7 @@ export class ParticleContainer extends Container * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true * Should it destroy the base texture of the child sprite */ - public destroy(options?: IDestroyOptions|boolean): void + public destroy(options?: IDestroyOptions | boolean): void { super.destroy(options); diff --git a/packages/particle-container/src/ParticleRenderer.ts b/packages/particle-container/src/ParticleRenderer.ts index dae0ad425e..0fc346ab9b 100644 --- a/packages/particle-container/src/ParticleRenderer.ts +++ b/packages/particle-container/src/ParticleRenderer.ts @@ -10,7 +10,8 @@ import type { DisplayObject } from '@pixi/display'; import type { ParticleContainer } from './ParticleContainer'; import type { Renderer } from '@pixi/core'; -export interface IParticleRendererProperty { +export interface IParticleRendererProperty +{ attributeName: string; size: number; type?: TYPES; diff --git a/packages/prepare/src/BasePrepare.ts b/packages/prepare/src/BasePrepare.ts index bde8c89940..dc62f4683d 100644 --- a/packages/prepare/src/BasePrepare.ts +++ b/packages/prepare/src/BasePrepare.ts @@ -7,21 +7,25 @@ import { CountLimiter } from './CountLimiter'; import type { AbstractRenderer } from '@pixi/core'; -interface IArrowFunction { +interface IArrowFunction +{ (): void; } -interface IUploadHook { +interface IUploadHook +{ (helper: AbstractRenderer | BasePrepare, item: IDisplayObjectExtended): boolean; } -interface IFindHook { +interface IFindHook +{ (item: any, queue: Array): boolean; } -export interface IDisplayObjectExtended extends DisplayObject { +export interface IDisplayObjectExtended extends DisplayObject +{ _textures?: Array; _texture?: Texture; - style?: TextStyle|Partial; + style?: TextStyle | Partial; } /** diff --git a/packages/settings/src/settings.ts b/packages/settings/src/settings.ts index eb09d3702f..358eb553e4 100644 --- a/packages/settings/src/settings.ts +++ b/packages/settings/src/settings.ts @@ -4,7 +4,8 @@ import { canUploadSameBuffer } from './utils/canUploadSameBuffer'; import { GC_MODES, MIPMAP_MODES, MSAA_QUALITY, PRECISION, SCALE_MODES, WRAP_MODES } from '@pixi/constants'; import type { ENV } from '@pixi/constants'; -export interface IRenderOptions { +export interface IRenderOptions +{ view: HTMLCanvasElement; antialias: boolean; autoDensity: boolean; @@ -18,7 +19,8 @@ export interface IRenderOptions { legacy: boolean; } -export interface ISettings { +export interface ISettings +{ MIPMAP_TEXTURES: MIPMAP_MODES; ANISOTROPIC_LEVEL: number; RESOLUTION: number; diff --git a/packages/sprite-animated/src/AnimatedSprite.ts b/packages/sprite-animated/src/AnimatedSprite.ts index 68170f380b..f04ee6d8fb 100644 --- a/packages/sprite-animated/src/AnimatedSprite.ts +++ b/packages/sprite-animated/src/AnimatedSprite.ts @@ -123,7 +123,7 @@ export class AnimatedSprite extends Sprite * objects that make up the animation. * @param {boolean} [autoUpdate=true] - Whether to use PIXI.Ticker.shared to auto update animation time. */ - constructor(textures: Texture[]|FrameObject[], autoUpdate = true) + constructor(textures: Texture[] | FrameObject[], autoUpdate = true) { super(textures[0] instanceof Texture ? textures[0] : textures[0].texture); @@ -336,7 +336,7 @@ export class AnimatedSprite extends Sprite * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well. * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well. */ - public destroy(options?: IDestroyOptions|boolean): void + public destroy(options?: IDestroyOptions | boolean): void { this.stop(); super.destroy(options); @@ -395,12 +395,12 @@ export class AnimatedSprite extends Sprite } /** The array of textures used for this AnimatedSprite. */ - get textures(): Texture[]|FrameObject[] + get textures(): Texture[] | FrameObject[] { return this._textures; } - set textures(value: Texture[]|FrameObject[]) + set textures(value: Texture[] | FrameObject[]) { if (value[0] instanceof Texture) { @@ -477,7 +477,8 @@ export class AnimatedSprite extends Sprite } /** @memberof PIXI.AnimatedSprite */ -export interface FrameObject { +export interface FrameObject +{ /** The {@link PIXI.Texture} of the frame. */ texture: Texture; diff --git a/packages/sprite-tiling/src/TilingSprite.ts b/packages/sprite-tiling/src/TilingSprite.ts index cb11512152..e4fedeef98 100644 --- a/packages/sprite-tiling/src/TilingSprite.ts +++ b/packages/sprite-tiling/src/TilingSprite.ts @@ -217,7 +217,7 @@ export class TilingSprite extends Sprite * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well */ - public destroy(options?: IDestroyOptions|boolean): void + public destroy(options?: IDestroyOptions | boolean): void { super.destroy(options); diff --git a/packages/sprite/src/Sprite.ts b/packages/sprite/src/Sprite.ts index d514f1e54a..30a4d9ad50 100644 --- a/packages/sprite/src/Sprite.ts +++ b/packages/sprite/src/Sprite.ts @@ -12,7 +12,7 @@ import type { IPointData } from '@pixi/math'; const tempPoint = new Point(); const indices = new Uint16Array([0, 1, 2, 0, 2, 3]); -export type SpriteSource = TextureSource|Texture; +export type SpriteSource = TextureSource | Texture; export interface Sprite extends GlobalMixins.Sprite, Container {} @@ -481,7 +481,7 @@ export class Sprite extends Container * @param [options.texture=false] - Should it destroy the current texture of the sprite as well * @param [options.baseTexture=false] - Should it destroy the base texture of the sprite as well */ - public destroy(options?: IDestroyOptions|boolean): void + public destroy(options?: IDestroyOptions | boolean): void { super.destroy(options); diff --git a/packages/spritesheet/src/Spritesheet.ts b/packages/spritesheet/src/Spritesheet.ts index 616f08ad99..e977a534be 100644 --- a/packages/spritesheet/src/Spritesheet.ts +++ b/packages/spritesheet/src/Spritesheet.ts @@ -8,7 +8,8 @@ import type { IPointData } from '@pixi/math'; /** * Represents the JSON data for a spritesheet atlas. */ -export interface ISpritesheetFrameData { +export interface ISpritesheetFrameData +{ frame: { x: number; y: number; @@ -31,7 +32,8 @@ export interface ISpritesheetFrameData { /** * Atlas format. */ -export interface ISpritesheetData { +export interface ISpritesheetData +{ frames: Dict; animations?: Dict; meta: { diff --git a/packages/text-bitmap/global.d.ts b/packages/text-bitmap/global.d.ts index 08cee2b8c0..aa7375fc1c 100644 --- a/packages/text-bitmap/global.d.ts +++ b/packages/text-bitmap/global.d.ts @@ -1,6 +1,7 @@ declare namespace GlobalMixins { - interface IBitmapFontResource { + interface IBitmapFontResource + { bitmapFont: import('@pixi/text-bitmap').BitmapFont; } @@ -10,7 +11,8 @@ declare namespace GlobalMixins } - interface IBitmapFontResourceMetadata { + interface IBitmapFontResourceMetadata + { pageFile: string; } diff --git a/packages/text-bitmap/src/BitmapFont.ts b/packages/text-bitmap/src/BitmapFont.ts index b6661a4d06..6389006404 100644 --- a/packages/text-bitmap/src/BitmapFont.ts +++ b/packages/text-bitmap/src/BitmapFont.ts @@ -144,7 +144,7 @@ export class BitmapFont * @param ownsTextures - Setting to `true` will destroy page textures * when the font is uninstalled. */ - constructor(data: BitmapFontData, textures: Texture[]|Dict, ownsTextures?: boolean) + constructor(data: BitmapFontData, textures: Texture[] | Dict, ownsTextures?: boolean) { const [info] = data.info; const [common] = data.common; @@ -267,8 +267,8 @@ export class BitmapFont * and char fields. */ public static install( - data: string|XMLDocument|BitmapFontData, - textures: Texture|Texture[]|Dict, + data: string | XMLDocument | BitmapFontData, + textures: Texture | Texture[] | Dict, ownsTextures?: boolean ): BitmapFont { diff --git a/packages/text-bitmap/src/BitmapFontData.ts b/packages/text-bitmap/src/BitmapFontData.ts index 49042209a8..48548dcb05 100644 --- a/packages/text-bitmap/src/BitmapFontData.ts +++ b/packages/text-bitmap/src/BitmapFontData.ts @@ -37,7 +37,8 @@ export class BitmapFontData } /** @memberof PIXI */ -export interface IBitmapFontDataInfo { +export interface IBitmapFontDataInfo +{ /** Font face */ face: string; @@ -46,13 +47,15 @@ export interface IBitmapFontDataInfo { } /** @memberof PIXI */ -export interface IBitmapFontDataCommon { +export interface IBitmapFontDataCommon +{ /** Line height, in pixels. */ lineHeight: number; } /** @memberof PIXI */ -export interface IBitmapFontDataPage { +export interface IBitmapFontDataPage +{ /** Unique id for bitmap texture */ id: number; @@ -61,7 +64,8 @@ export interface IBitmapFontDataPage { } /** @memberof PIXI */ -export interface IBitmapFontDataChar { +export interface IBitmapFontDataChar +{ /** Unique id of character */ id: number; @@ -91,7 +95,8 @@ export interface IBitmapFontDataChar { } /** @memberof PIXI */ -export interface IBitmapFontDataKerning { +export interface IBitmapFontDataKerning +{ /** First character of pair */ first: number; @@ -103,7 +108,8 @@ export interface IBitmapFontDataKerning { } /** @memberof PIXI */ -export interface IBitmapFontDataDistanceField { +export interface IBitmapFontDataDistanceField +{ /** Type of distance field */ fieldType: string; diff --git a/packages/text-bitmap/src/BitmapText.ts b/packages/text-bitmap/src/BitmapText.ts index ac4ded84f1..a4a4378d8f 100644 --- a/packages/text-bitmap/src/BitmapText.ts +++ b/packages/text-bitmap/src/BitmapText.ts @@ -14,7 +14,8 @@ import { Container } from '@pixi/display'; import type { IDestroyOptions } from '@pixi/display'; import { BLEND_MODES } from '@pixi/constants'; -interface PageMeshData { +interface PageMeshData +{ index: number; indexCount: number; vertexCount: number; @@ -25,7 +26,8 @@ interface PageMeshData { uvs?: Float32Array; indices?: Uint16Array; } -interface CharRenderData { +interface CharRenderData +{ texture: Texture; line: number; charCode: number; diff --git a/packages/text-bitmap/src/BitmapTextStyle.ts b/packages/text-bitmap/src/BitmapTextStyle.ts index c995d0de53..f0fa4a046d 100644 --- a/packages/text-bitmap/src/BitmapTextStyle.ts +++ b/packages/text-bitmap/src/BitmapTextStyle.ts @@ -1,6 +1,7 @@ import type { TextStyleAlign } from '@pixi/text'; -export interface IBitmapTextStyle { +export interface IBitmapTextStyle +{ fontName: string; fontSize: number; tint: number; @@ -9,7 +10,8 @@ export interface IBitmapTextStyle { maxWidth: number; } -export interface IBitmapTextFontDescriptor { +export interface IBitmapTextFontDescriptor +{ name: string; size: number; } diff --git a/packages/text-bitmap/src/formats/TextFormat.ts b/packages/text-bitmap/src/formats/TextFormat.ts index e93b253fa4..045cf5e1df 100644 --- a/packages/text-bitmap/src/formats/TextFormat.ts +++ b/packages/text-bitmap/src/formats/TextFormat.ts @@ -4,7 +4,8 @@ import { BitmapFontData } from '../BitmapFontData'; * Internal data format used to convert to BitmapFontData. * @private */ -interface IBitmapFontRawData { +interface IBitmapFontRawData +{ info: { face: string; size: string; diff --git a/packages/text-bitmap/src/utils/generateFillStyle.ts b/packages/text-bitmap/src/utils/generateFillStyle.ts index d33734833d..a98b71d65f 100644 --- a/packages/text-bitmap/src/utils/generateFillStyle.ts +++ b/packages/text-bitmap/src/utils/generateFillStyle.ts @@ -17,12 +17,12 @@ export function generateFillStyle( resolution: number, lines: string[], metrics: TextMetrics -): string|CanvasGradient|CanvasPattern +): string | CanvasGradient | CanvasPattern { // TODO: Can't have different types for getter and setter. The getter shouldn't have the number type as // the setter converts to string. See this thread for more details: // https://github.com/microsoft/TypeScript/issues/2521 - const fillStyle: string|string[]|CanvasGradient|CanvasPattern = style.fill as any; + const fillStyle: string | string[] | CanvasGradient | CanvasPattern = style.fill as any; if (!Array.isArray(fillStyle)) { @@ -35,7 +35,7 @@ export function generateFillStyle( // the gradient will be evenly spaced out according to how large the array is. // ['#FF0000', '#00FF00', '#0000FF'] would created stops at 0.25, 0.5 and 0.75 - let gradient: string[]|CanvasGradient; + let gradient: string[] | CanvasGradient; // a dropshadow will enlarge the canvas and result in the gradient being // generated with the incorrect dimensions diff --git a/packages/text/src/Text.ts b/packages/text/src/Text.ts index 3a8ceb068f..54010857c4 100644 --- a/packages/text/src/Text.ts +++ b/packages/text/src/Text.ts @@ -18,11 +18,12 @@ const defaultDestroyOptions: IDestroyOptions = { baseTexture: true, }; -interface ModernContext2D extends CanvasRenderingContext2D { - // for chrome less 94 - textLetterSpacing?: number; - // for chrome greater 94 - letterSpacing?: number; +interface ModernContext2D extends CanvasRenderingContext2D +{ + // for chrome less 94 + textLetterSpacing?: number; + // for chrome greater 94 + letterSpacing?: number; } /** @@ -123,7 +124,7 @@ export class Text extends Sprite * @param {object|PIXI.TextStyle} [style] - The style parameters * @param canvas - The canvas element for drawing text */ - constructor(text: string, style?: Partial|TextStyle, canvas?: HTMLCanvasElement) + constructor(text: string, style?: Partial | TextStyle, canvas?: HTMLCanvasElement) { let ownCanvas = false; @@ -501,12 +502,14 @@ export class Text extends Sprite * @param lines - The lines of text. * @return The fill style */ - private _generateFillStyle(style: TextStyle, lines: string[], metrics: TextMetrics): string|CanvasGradient|CanvasPattern + private _generateFillStyle( + style: TextStyle, lines: string[], metrics: TextMetrics + ): string | CanvasGradient | CanvasPattern { // TODO: Can't have different types for getter and setter. The getter shouldn't have the number type as // the setter converts to string. See this thread for more details: // https://github.com/microsoft/TypeScript/issues/2521 - const fillStyle: string|string[]|CanvasGradient|CanvasPattern = style.fill as any; + const fillStyle: string | string[] | CanvasGradient | CanvasPattern = style.fill as any; if (!Array.isArray(fillStyle)) { @@ -519,7 +522,7 @@ export class Text extends Sprite // the gradient will be evenly spaced out according to how large the array is. // ['#FF0000', '#00FF00', '#0000FF'] would created stops at 0.25, 0.5 and 0.75 - let gradient: string[]|CanvasGradient; + let gradient: string[] | CanvasGradient; // a dropshadow will enlarge the canvas and result in the gradient being // generated with the incorrect dimensions @@ -656,7 +659,7 @@ export class Text extends Sprite * @param {boolean} [options.texture=true] - Should it destroy the current texture of the sprite as well * @param {boolean} [options.baseTexture=true] - Should it destroy the base texture of the sprite as well */ - public destroy(options?: IDestroyOptions|boolean): void + public destroy(options?: IDestroyOptions | boolean): void { if (typeof options === 'boolean') { @@ -722,7 +725,7 @@ export class Text extends Sprite * * Set up an event listener to listen for changes on the style object and mark the text as dirty. */ - get style(): TextStyle|Partial + get style(): TextStyle | Partial { // TODO: Can't have different types for getter and setter. The getter shouldn't have the ITextStyle // since the setter creates the TextStyle. See this thread for more details: @@ -730,7 +733,7 @@ export class Text extends Sprite return this._style; } - set style(style: TextStyle|Partial) + set style(style: TextStyle | Partial) { style = style || {}; diff --git a/packages/text/src/TextMetrics.ts b/packages/text/src/TextMetrics.ts index bb86fe3f37..1668d078d0 100644 --- a/packages/text/src/TextMetrics.ts +++ b/packages/text/src/TextMetrics.ts @@ -1,6 +1,7 @@ import { TextStyle, TextStyleWhiteSpace } from './TextStyle'; -interface IFontMetrics { +interface IFontMetrics +{ ascent: number; descent: number; fontSize: number; @@ -56,8 +57,8 @@ export class TextMetrics public static BASELINE_MULTIPLIER: number; public static HEIGHT_MULTIPLIER: number; - private static __canvas: HTMLCanvasElement|OffscreenCanvas; - private static __context: CanvasRenderingContext2D|OffscreenCanvasRenderingContext2D; + private static __canvas: HTMLCanvasElement | OffscreenCanvas; + private static __context: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D; // TODO: These should be protected but they're initialized outside of the class. public static _fonts: { [font: string]: IFontMetrics }; @@ -388,7 +389,7 @@ export class TextMetrics * @return The from cache. */ private static getFromCache(key: string, letterSpacing: number, cache: CharacterWidthCache, - context: CanvasRenderingContext2D|OffscreenCanvasRenderingContext2D): number + context: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D): number { let width = cache[key]; @@ -722,11 +723,11 @@ export class TextMetrics * * @ignore */ - public static get _canvas(): HTMLCanvasElement|OffscreenCanvas + public static get _canvas(): HTMLCanvasElement | OffscreenCanvas { if (!TextMetrics.__canvas) { - let canvas: HTMLCanvasElement|OffscreenCanvas; + let canvas: HTMLCanvasElement | OffscreenCanvas; try { @@ -759,7 +760,7 @@ export class TextMetrics * * @ignore */ - public static get _context(): CanvasRenderingContext2D|OffscreenCanvasRenderingContext2D + public static get _context(): CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D { if (!TextMetrics.__context) { diff --git a/packages/text/src/const.ts b/packages/text/src/const.ts index 028a90055f..eae33ed174 100644 --- a/packages/text/src/const.ts +++ b/packages/text/src/const.ts @@ -9,7 +9,9 @@ * @property {number} LINEAR_VERTICAL Vertical gradient * @property {number} LINEAR_HORIZONTAL Linear gradient */ -export enum TEXT_GRADIENT { +export enum TEXT_GRADIENT +// eslint-disable-next-line @typescript-eslint/indent +{ LINEAR_VERTICAL = 0, LINEAR_HORIZONTAL = 1 } diff --git a/packages/ticker/src/const.ts b/packages/ticker/src/const.ts index be6b47c1e1..2fb0c41db6 100644 --- a/packages/ticker/src/const.ts +++ b/packages/ticker/src/const.ts @@ -14,7 +14,9 @@ * @property {number} LOW=-25 Low priority used for {@link PIXI.Application} rendering. * @property {number} UTILITY=-50 Lowest priority used for {@link PIXI.BasePrepare} utility. */ -export enum UPDATE_PRIORITY { +export enum UPDATE_PRIORITY +// eslint-disable-next-line @typescript-eslint/indent +{ INTERACTION = 50, HIGH = 25, NORMAL = 0, diff --git a/packages/unsafe-eval/src/install.ts b/packages/unsafe-eval/src/install.ts index a54495ea07..0a8f485b25 100644 --- a/packages/unsafe-eval/src/install.ts +++ b/packages/unsafe-eval/src/install.ts @@ -2,7 +2,8 @@ import { syncUniforms } from './syncUniforms'; import type { ShaderSystem, Program, UniformGroup } from '@pixi/core'; -interface PIXICore { +interface PIXICore +{ ShaderSystem: typeof ShaderSystem; } diff --git a/packages/utils/src/browser/isWebGLSupported.ts b/packages/utils/src/browser/isWebGLSupported.ts index 18890a1ef3..f1710e4548 100644 --- a/packages/utils/src/browser/isWebGLSupported.ts +++ b/packages/utils/src/browser/isWebGLSupported.ts @@ -1,6 +1,6 @@ import { settings } from '../settings'; -let supported: boolean|undefined; +let supported: boolean | undefined; /** * Helper for checking for WebGL support. diff --git a/packages/utils/src/color/premultiply.ts b/packages/utils/src/color/premultiply.ts index 06cee17946..27cc42c499 100644 --- a/packages/utils/src/color/premultiply.ts +++ b/packages/utils/src/color/premultiply.ts @@ -69,7 +69,7 @@ export function correctBlendMode(blendMode: number, premultiplied: boolean): num * @returns {Float32Array} vec4 rgba */ export function premultiplyRgba( - rgb: Float32Array|number[], + rgb: Float32Array | number[], alpha: number, out?: Float32Array, premultiply?: boolean diff --git a/packages/utils/src/data/createIndicesForQuads.ts b/packages/utils/src/data/createIndicesForQuads.ts index 8a15ef52ee..b3a1bbc8e2 100644 --- a/packages/utils/src/data/createIndicesForQuads.ts +++ b/packages/utils/src/data/createIndicesForQuads.ts @@ -7,7 +7,7 @@ * @param {Uint16Array|Uint32Array} [outBuffer] - Buffer for output, length has to be `6 * size` * @return {Uint16Array|Uint32Array} - Resulting index buffer */ -export function createIndicesForQuads(size: number, outBuffer: Uint16Array|Uint32Array = null): Uint16Array|Uint32Array +export function createIndicesForQuads(size: number, outBuffer: Uint16Array | Uint32Array = null): Uint16Array | Uint32Array { // the total number of indices in our array, there are 6 points per quad. const totalIndices = size * 6; diff --git a/packages/utils/src/data/getBufferType.ts b/packages/utils/src/data/getBufferType.ts index bc103ae6f5..094edf270c 100644 --- a/packages/utils/src/data/getBufferType.ts +++ b/packages/utils/src/data/getBufferType.ts @@ -1,6 +1,8 @@ import type { ITypedArray } from '@pixi/core'; -export function getBufferType(array: ITypedArray): 'Float32Array'|'Uint32Array'|'Int32Array'|'Uint16Array'|'Uint8Array'|null +export function getBufferType( + array: ITypedArray +): 'Float32Array' | 'Uint32Array' | 'Int32Array' | 'Uint16Array' | 'Uint8Array' | null { if (array.BYTES_PER_ELEMENT === 4) { diff --git a/packages/utils/src/data/interleaveTypedArrays.ts b/packages/utils/src/data/interleaveTypedArrays.ts index 54ae80d5d2..4e9c49d7ef 100644 --- a/packages/utils/src/data/interleaveTypedArrays.ts +++ b/packages/utils/src/data/interleaveTypedArrays.ts @@ -3,7 +3,7 @@ import { getBufferType } from './getBufferType'; /* eslint-disable object-shorthand */ const map = { Float32Array: Float32Array, Uint32Array: Uint32Array, Int32Array: Int32Array, Uint8Array: Uint8Array }; -type PackedArray = Float32Array|Uint32Array|Int32Array|Uint8Array; +type PackedArray = Float32Array | Uint32Array | Int32Array | Uint8Array; export function interleaveTypedArrays(arrays: PackedArray[], sizes: number[]): Float32Array { diff --git a/packages/utils/src/data/sign.ts b/packages/utils/src/data/sign.ts index 4e41c0d4eb..e6dc187650 100644 --- a/packages/utils/src/data/sign.ts +++ b/packages/utils/src/data/sign.ts @@ -6,7 +6,7 @@ * @param {number} n - the number to check the sign of * @returns {number} 0 if `n` is 0, -1 if `n` is negative, 1 if `n` is positive */ -export function sign(n: number): -1|0|1 +export function sign(n: number): -1 | 0 | 1 { if (n === 0) return 0; diff --git a/packages/utils/src/media/trimCanvas.ts b/packages/utils/src/media/trimCanvas.ts index 5c1ef32a43..76b659c41e 100644 --- a/packages/utils/src/media/trimCanvas.ts +++ b/packages/utils/src/media/trimCanvas.ts @@ -1,4 +1,5 @@ -interface Inset { +interface Inset +{ top?: number; left?: number; right?: number; diff --git a/packages/utils/src/network/decomposeDataUri.ts b/packages/utils/src/network/decomposeDataUri.ts index 3664242311..e0ba0b8254 100644 --- a/packages/utils/src/network/decomposeDataUri.ts +++ b/packages/utils/src/network/decomposeDataUri.ts @@ -1,6 +1,7 @@ import { DATA_URI } from '../const'; -export interface DecomposedDataUri { +export interface DecomposedDataUri +{ mediaType: string; subType: string; charset: string; diff --git a/packages/utils/src/network/determineCrossOrigin.ts b/packages/utils/src/network/determineCrossOrigin.ts index 0a73ffbfea..c38d3021d5 100644 --- a/packages/utils/src/network/determineCrossOrigin.ts +++ b/packages/utils/src/network/determineCrossOrigin.ts @@ -1,6 +1,6 @@ import { url as _url } from '../url'; -let tempAnchor: HTMLAnchorElement|undefined; +let tempAnchor: HTMLAnchorElement | undefined; /** * Sets the `crossOrigin` property for this resource based on if the url diff --git a/packages/utils/src/url.ts b/packages/utils/src/url.ts index 57c0e9d48c..1763e98846 100644 --- a/packages/utils/src/url.ts +++ b/packages/utils/src/url.ts @@ -7,15 +7,18 @@ import { parse as _parse, format as _format, resolve as _resolve } from 'url'; -interface ParsedUrlQuery { +interface ParsedUrlQuery +{ [key: string]: string | string[]; } -interface ParsedUrlQueryInput { +interface ParsedUrlQueryInput +{ [key: string]: unknown; } -interface UrlObjectCommon { +interface UrlObjectCommon +{ auth?: string; hash?: string; host?: string; @@ -29,26 +32,31 @@ interface UrlObjectCommon { } // Input to `url.format` -interface UrlObject extends UrlObjectCommon { +interface UrlObject extends UrlObjectCommon +{ port?: string | number; query?: string | null | ParsedUrlQueryInput; } // Output of `url.parse` -interface Url extends UrlObjectCommon { +interface Url extends UrlObjectCommon +{ port?: string; query?: string | null | ParsedUrlQuery; } -interface UrlWithParsedQuery extends Url { +interface UrlWithParsedQuery extends Url +{ query: ParsedUrlQuery; } -interface UrlWithStringQuery extends Url { +interface UrlWithStringQuery extends Url +{ query: string | null; } -interface URLFormatOptions { +interface URLFormatOptions +{ auth?: boolean; fragment?: boolean; search?: boolean; diff --git a/test/index.ts b/test/index.ts index 209a823c2f..ea0faf785d 100644 --- a/test/index.ts +++ b/test/index.ts @@ -7,7 +7,8 @@ import type { FlossOptions } from 'floss'; import type { PackageResult } from './packages'; // Support for global otpions -declare global { +declare global +{ let options: FlossOptions; } diff --git a/test/packages.ts b/test/packages.ts index 94eda84403..1c5cb8555f 100644 --- a/test/packages.ts +++ b/test/packages.ts @@ -2,7 +2,8 @@ import path from 'path'; import fs from 'fs'; import workspacesRun from 'workspaces-run'; -interface PackageResult { +interface PackageResult +{ name: string; location: string; tests: string; diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json new file mode 100644 index 0000000000..13f235d8ee --- /dev/null +++ b/tsconfig.eslint.json @@ -0,0 +1,22 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "target": "es6", + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "module": "commonjs", + "baseUrl": "./", + "paths": { + "@pixi/*": [ + "packages/*/src", + "packages/filters/*/src", + "packages/canvas/*/src" + ] + }, + }, + "exclude": [ + "node_modules", + "**/dist/**", + "**/lib/**", + ] +}