lint: Disallow utils index imports

This keeps leading to issues due to circular imports.
Import from specific files instead, index just reexports
This commit is contained in:
Vendicated 2022-11-07 23:34:14 +01:00
parent 955573d31b
commit f7d9be9140
No known key found for this signature in database
GPG key ID: EC781ADFB93EFFA3
22 changed files with 217 additions and 30 deletions

View file

@ -2,7 +2,12 @@
"root": true, "root": true,
"parser": "@typescript-eslint/parser", "parser": "@typescript-eslint/parser",
"ignorePatterns": ["dist", "browser"], "ignorePatterns": ["dist", "browser"],
"plugins": ["header", "simple-import-sort", "unused-imports"], "plugins": [
"@typescript-eslint",
"header",
"simple-import-sort",
"unused-imports"
],
"rules": { "rules": {
// Since it's only been a month and Vencord has already been stolen // Since it's only been a month and Vencord has already been stolen
// by random skids who rebranded it to "AlphaCord" and erased all license // by random skids who rebranded it to "AlphaCord" and erased all license
@ -88,6 +93,46 @@
"simple-import-sort/imports": "error", "simple-import-sort/imports": "error",
"simple-import-sort/exports": "error", "simple-import-sort/exports": "error",
"unused-imports/no-unused-imports": "error" "unused-imports/no-unused-imports": "error",
"@typescript-eslint/no-restricted-imports": [
"error",
{
"paths": [
// shrug, couldn't find a better way since the pattern one doesn't work:
// ["utils", "!utils/*"]
{
"name": "./utils",
"message": "Do not import from index. This might cause issues. Import from the specific file instead.",
"allowTypeImports": true
},
{
"name": "../utils",
"message": "Do not import from index. This might cause issues. Import from the specific file instead.",
"allowTypeImports": true
},
{
"name": "../../utils",
"message": "Do not import from index. This might cause issues. Import from the specific file instead.",
"allowTypeImports": true
},
{
"name": "../../../utils",
"message": "Do not import from index. This might cause issues. Import from the specific file instead.",
"allowTypeImports": true
},
{
"name": "../../../../utils",
"message": "Do not import from index. This might cause issues. Import from the specific file instead.",
"allowTypeImports": true
},
{
"name": "../../../../../utils",
"message": "Do not import from index. This might cause issues. Import from the specific file instead.",
"allowTypeImports": true
}
]
}
]
} }
} }

View file

@ -39,6 +39,7 @@
"@types/react": "^18.0.17", "@types/react": "^18.0.17",
"@types/react-dom": "^18.0.8", "@types/react-dom": "^18.0.8",
"@types/yazl": "^2.4.2", "@types/yazl": "^2.4.2",
"@typescript-eslint/eslint-plugin": "^5.42.1",
"@typescript-eslint/parser": "^5.39.0", "@typescript-eslint/parser": "^5.39.0",
"discord-types": "^1.3.26", "discord-types": "^1.3.26",
"esbuild": "^0.15.5", "esbuild": "^0.15.5",

View file

@ -6,6 +6,7 @@ specifiers:
'@types/react': ^18.0.17 '@types/react': ^18.0.17
'@types/react-dom': ^18.0.8 '@types/react-dom': ^18.0.8
'@types/yazl': ^2.4.2 '@types/yazl': ^2.4.2
'@typescript-eslint/eslint-plugin': ^5.42.1
'@typescript-eslint/parser': ^5.39.0 '@typescript-eslint/parser': ^5.39.0
console-menu: ^0.1.0 console-menu: ^0.1.0
diff: ^5.1.0 diff: ^5.1.0
@ -31,13 +32,14 @@ devDependencies:
'@types/react': 18.0.17 '@types/react': 18.0.17
'@types/react-dom': 18.0.8 '@types/react-dom': 18.0.8
'@types/yazl': 2.4.2 '@types/yazl': 2.4.2
'@typescript-eslint/eslint-plugin': 5.42.1_xyciw6oqjoiiono4dhv3uhn5my
'@typescript-eslint/parser': 5.39.0_ypn2ylkkyfa5i233caldtndbqa '@typescript-eslint/parser': 5.39.0_ypn2ylkkyfa5i233caldtndbqa
discord-types: 1.3.26 discord-types: 1.3.26
esbuild: 0.15.5 esbuild: 0.15.5
eslint: 8.24.0 eslint: 8.24.0
eslint-plugin-header: 3.1.1_eslint@8.24.0 eslint-plugin-header: 3.1.1_eslint@8.24.0
eslint-plugin-simple-import-sort: 8.0.0_eslint@8.24.0 eslint-plugin-simple-import-sort: 8.0.0_eslint@8.24.0
eslint-plugin-unused-imports: 2.0.0_eslint@8.24.0 eslint-plugin-unused-imports: 2.0.0_5yz3upex2kb6hbdwaq7bihlxnq
standalone-electron-types: 1.0.0 standalone-electron-types: 1.0.0
type-fest: 3.1.0 type-fest: 3.1.0
typescript: 4.8.4 typescript: 4.8.4
@ -119,6 +121,10 @@ packages:
resolution: {integrity: sha512-uw8eYMIReOwstQ0QKF0sICefSy8cNO/v7gOTiIy9SbwuHyEecJUm7qlgueOO5S1udZ5I/irVydHVwMchgzbKTg==} resolution: {integrity: sha512-uw8eYMIReOwstQ0QKF0sICefSy8cNO/v7gOTiIy9SbwuHyEecJUm7qlgueOO5S1udZ5I/irVydHVwMchgzbKTg==}
dev: true dev: true
/@types/json-schema/7.0.11:
resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==}
dev: true
/@types/node/18.7.13: /@types/node/18.7.13:
resolution: {integrity: sha512-46yIhxSe5xEaJZXWdIBP7GU4HDTG8/eo0qd9atdiL+lFpA03y8KS+lkTN834TWJj5767GbWv4n/P6efyTFt1Dw==} resolution: {integrity: sha512-46yIhxSe5xEaJZXWdIBP7GU4HDTG8/eo0qd9atdiL+lFpA03y8KS+lkTN834TWJj5767GbWv4n/P6efyTFt1Dw==}
dev: true dev: true
@ -156,12 +162,43 @@ packages:
resolution: {integrity: sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==} resolution: {integrity: sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==}
dev: true dev: true
/@types/semver/7.3.13:
resolution: {integrity: sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==}
dev: true
/@types/yazl/2.4.2: /@types/yazl/2.4.2:
resolution: {integrity: sha512-T+9JH8O2guEjXNxqmybzQ92mJUh2oCwDDMSSimZSe1P+pceZiFROZLYmcbqkzV5EUwz6VwcKXCO2S2yUpra6XQ==} resolution: {integrity: sha512-T+9JH8O2guEjXNxqmybzQ92mJUh2oCwDDMSSimZSe1P+pceZiFROZLYmcbqkzV5EUwz6VwcKXCO2S2yUpra6XQ==}
dependencies: dependencies:
'@types/node': 18.7.13 '@types/node': 18.7.13
dev: true dev: true
/@typescript-eslint/eslint-plugin/5.42.1_xyciw6oqjoiiono4dhv3uhn5my:
resolution: {integrity: sha512-LyR6x784JCiJ1j6sH5Y0K6cdExqCCm8DJUTcwG5ThNXJj/G8o5E56u5EdG4SLy+bZAwZBswC+GYn3eGdttBVCg==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
'@typescript-eslint/parser': ^5.0.0
eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
typescript: '*'
peerDependenciesMeta:
typescript:
optional: true
dependencies:
'@typescript-eslint/parser': 5.39.0_ypn2ylkkyfa5i233caldtndbqa
'@typescript-eslint/scope-manager': 5.42.1
'@typescript-eslint/type-utils': 5.42.1_ypn2ylkkyfa5i233caldtndbqa
'@typescript-eslint/utils': 5.42.1_ypn2ylkkyfa5i233caldtndbqa
debug: 4.3.4
eslint: 8.24.0
ignore: 5.2.0
natural-compare-lite: 1.4.0
regexpp: 3.2.0
semver: 7.3.7
tsutils: 3.21.0_typescript@4.8.4
typescript: 4.8.4
transitivePeerDependencies:
- supports-color
dev: true
/@typescript-eslint/parser/5.39.0_ypn2ylkkyfa5i233caldtndbqa: /@typescript-eslint/parser/5.39.0_ypn2ylkkyfa5i233caldtndbqa:
resolution: {integrity: sha512-PhxLjrZnHShe431sBAGHaNe6BDdxAASDySgsBCGxcBecVCi8NQWxQZMcizNA4g0pN51bBAn/FUfkWG3SDVcGlA==} resolution: {integrity: sha512-PhxLjrZnHShe431sBAGHaNe6BDdxAASDySgsBCGxcBecVCi8NQWxQZMcizNA4g0pN51bBAn/FUfkWG3SDVcGlA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
@ -190,11 +227,44 @@ packages:
'@typescript-eslint/visitor-keys': 5.39.0 '@typescript-eslint/visitor-keys': 5.39.0
dev: true dev: true
/@typescript-eslint/scope-manager/5.42.1:
resolution: {integrity: sha512-QAZY/CBP1Emx4rzxurgqj3rUinfsh/6mvuKbLNMfJMMKYLRBfweus8brgXF8f64ABkIZ3zdj2/rYYtF8eiuksQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies:
'@typescript-eslint/types': 5.42.1
'@typescript-eslint/visitor-keys': 5.42.1
dev: true
/@typescript-eslint/type-utils/5.42.1_ypn2ylkkyfa5i233caldtndbqa:
resolution: {integrity: sha512-WWiMChneex5w4xPIX56SSnQQo0tEOy5ZV2dqmj8Z371LJ0E+aymWD25JQ/l4FOuuX+Q49A7pzh/CGIQflxMVXg==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
eslint: '*'
typescript: '*'
peerDependenciesMeta:
typescript:
optional: true
dependencies:
'@typescript-eslint/typescript-estree': 5.42.1_typescript@4.8.4
'@typescript-eslint/utils': 5.42.1_ypn2ylkkyfa5i233caldtndbqa
debug: 4.3.4
eslint: 8.24.0
tsutils: 3.21.0_typescript@4.8.4
typescript: 4.8.4
transitivePeerDependencies:
- supports-color
dev: true
/@typescript-eslint/types/5.39.0: /@typescript-eslint/types/5.39.0:
resolution: {integrity: sha512-gQMZrnfEBFXK38hYqt8Lkwt8f4U6yq+2H5VDSgP/qiTzC8Nw8JO3OuSUOQ2qW37S/dlwdkHDntkZM6SQhKyPhw==} resolution: {integrity: sha512-gQMZrnfEBFXK38hYqt8Lkwt8f4U6yq+2H5VDSgP/qiTzC8Nw8JO3OuSUOQ2qW37S/dlwdkHDntkZM6SQhKyPhw==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dev: true dev: true
/@typescript-eslint/types/5.42.1:
resolution: {integrity: sha512-Qrco9dsFF5lhalz+lLFtxs3ui1/YfC6NdXu+RAGBa8uSfn01cjO7ssCsjIsUs484vny9Xm699FSKwpkCcqwWwA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dev: true
/@typescript-eslint/typescript-estree/5.39.0_typescript@4.8.4: /@typescript-eslint/typescript-estree/5.39.0_typescript@4.8.4:
resolution: {integrity: sha512-qLFQP0f398sdnogJoLtd43pUgB18Q50QSA+BTE5h3sUxySzbWDpTSdgt4UyxNSozY/oDK2ta6HVAzvGgq8JYnA==} resolution: {integrity: sha512-qLFQP0f398sdnogJoLtd43pUgB18Q50QSA+BTE5h3sUxySzbWDpTSdgt4UyxNSozY/oDK2ta6HVAzvGgq8JYnA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
@ -216,6 +286,47 @@ packages:
- supports-color - supports-color
dev: true dev: true
/@typescript-eslint/typescript-estree/5.42.1_typescript@4.8.4:
resolution: {integrity: sha512-qElc0bDOuO0B8wDhhW4mYVgi/LZL+igPwXtV87n69/kYC/7NG3MES0jHxJNCr4EP7kY1XVsRy8C/u3DYeTKQmw==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
typescript: '*'
peerDependenciesMeta:
typescript:
optional: true
dependencies:
'@typescript-eslint/types': 5.42.1
'@typescript-eslint/visitor-keys': 5.42.1
debug: 4.3.4
globby: 11.1.0
is-glob: 4.0.3
semver: 7.3.7
tsutils: 3.21.0_typescript@4.8.4
typescript: 4.8.4
transitivePeerDependencies:
- supports-color
dev: true
/@typescript-eslint/utils/5.42.1_ypn2ylkkyfa5i233caldtndbqa:
resolution: {integrity: sha512-Gxvf12xSp3iYZd/fLqiQRD4uKZjDNR01bQ+j8zvhPjpsZ4HmvEFL/tC4amGNyxN9Rq+iqvpHLhlqx6KTxz9ZyQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
dependencies:
'@types/json-schema': 7.0.11
'@types/semver': 7.3.13
'@typescript-eslint/scope-manager': 5.42.1
'@typescript-eslint/types': 5.42.1
'@typescript-eslint/typescript-estree': 5.42.1_typescript@4.8.4
eslint: 8.24.0
eslint-scope: 5.1.1
eslint-utils: 3.0.0_eslint@8.24.0
semver: 7.3.7
transitivePeerDependencies:
- supports-color
- typescript
dev: true
/@typescript-eslint/visitor-keys/5.39.0: /@typescript-eslint/visitor-keys/5.39.0:
resolution: {integrity: sha512-yyE3RPwOG+XJBLrhvsxAidUgybJVQ/hG8BhiJo0k8JSAYfk/CshVcxf0HwP4Jt7WZZ6vLmxdo1p6EyN3tzFTkg==} resolution: {integrity: sha512-yyE3RPwOG+XJBLrhvsxAidUgybJVQ/hG8BhiJo0k8JSAYfk/CshVcxf0HwP4Jt7WZZ6vLmxdo1p6EyN3tzFTkg==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
@ -224,6 +335,14 @@ packages:
eslint-visitor-keys: 3.3.0 eslint-visitor-keys: 3.3.0
dev: true dev: true
/@typescript-eslint/visitor-keys/5.42.1:
resolution: {integrity: sha512-LOQtSF4z+hejmpUvitPlc4hA7ERGoj2BVkesOcG91HCn8edLGUXbTrErmutmPbl8Bo9HjAvOO/zBKQHExXNA2A==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies:
'@typescript-eslint/types': 5.42.1
eslint-visitor-keys: 3.3.0
dev: true
/acorn-jsx/5.3.2_acorn@8.8.0: /acorn-jsx/5.3.2_acorn@8.8.0:
resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
peerDependencies: peerDependencies:
@ -605,7 +724,7 @@ packages:
eslint: 8.24.0 eslint: 8.24.0
dev: true dev: true
/eslint-plugin-unused-imports/2.0.0_eslint@8.24.0: /eslint-plugin-unused-imports/2.0.0_5yz3upex2kb6hbdwaq7bihlxnq:
resolution: {integrity: sha512-3APeS/tQlTrFa167ThtP0Zm0vctjr4M44HMpeg1P4bK6wItarumq0Ma82xorMKdFsWpphQBlRPzw/pxiVELX1A==} resolution: {integrity: sha512-3APeS/tQlTrFa167ThtP0Zm0vctjr4M44HMpeg1P4bK6wItarumq0Ma82xorMKdFsWpphQBlRPzw/pxiVELX1A==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies: peerDependencies:
@ -615,6 +734,7 @@ packages:
'@typescript-eslint/eslint-plugin': '@typescript-eslint/eslint-plugin':
optional: true optional: true
dependencies: dependencies:
'@typescript-eslint/eslint-plugin': 5.42.1_xyciw6oqjoiiono4dhv3uhn5my
eslint: 8.24.0 eslint: 8.24.0
eslint-rule-composer: 0.3.0 eslint-rule-composer: 0.3.0
dev: true dev: true
@ -624,6 +744,14 @@ packages:
engines: {node: '>=4.0.0'} engines: {node: '>=4.0.0'}
dev: true dev: true
/eslint-scope/5.1.1:
resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==}
engines: {node: '>=8.0.0'}
dependencies:
esrecurse: 4.3.0
estraverse: 4.3.0
dev: true
/eslint-scope/7.1.1: /eslint-scope/7.1.1:
resolution: {integrity: sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==} resolution: {integrity: sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
@ -723,6 +851,11 @@ packages:
estraverse: 5.3.0 estraverse: 5.3.0
dev: true dev: true
/estraverse/4.3.0:
resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==}
engines: {node: '>=4.0'}
dev: true
/estraverse/5.3.0: /estraverse/5.3.0:
resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==}
engines: {node: '>=4.0'} engines: {node: '>=4.0'}
@ -983,6 +1116,10 @@ packages:
resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==}
dev: true dev: true
/natural-compare-lite/1.4.0:
resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==}
dev: true
/natural-compare/1.4.0: /natural-compare/1.4.0:
resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}
dev: true dev: true

View file

@ -18,20 +18,19 @@
export * as Api from "./api"; export * as Api from "./api";
export * as Plugins from "./plugins"; export * as Plugins from "./plugins";
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
export * as Util from "./utils"; export * as Util from "./utils";
export * as QuickCss from "./utils/quickCss"; export * as QuickCss from "./utils/quickCss";
export * as Updater from "./utils/updater"; export * as Updater from "./utils/updater";
export * as Webpack from "./webpack"; export * as Webpack from "./webpack";
export { PlainSettings, Settings };
import "./utils/quickCss";
import "./webpack/patchWebpack";
import { popNotice, showNotice } from "./api/Notices"; import { popNotice, showNotice } from "./api/Notices";
import { PlainSettings, Settings } from "./api/settings"; import { PlainSettings, Settings } from "./api/settings";
import { patches, PMLogger, startAllPlugins } from "./plugins"; import { patches, PMLogger, startAllPlugins } from "./plugins";
export { PlainSettings, Settings };
import "./webpack/patchWebpack";
import "./utils/quickCss";
import { checkForUpdates, UpdateLogger } from "./utils/updater"; import { checkForUpdates, UpdateLogger } from "./utils/updater";
import { onceReady } from "./webpack"; import { onceReady } from "./webpack";
import { Router } from "./webpack/common"; import { Router } from "./webpack/common";

View file

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { LazyComponent } from "../utils";
import Logger from "../utils/logger"; import Logger from "../utils/logger";
import { LazyComponent } from "../utils/misc";
import { Margins, React } from "../webpack/common"; import { Margins, React } from "../webpack/common";
import { ErrorCard } from "./ErrorCard"; import { ErrorCard } from "./ErrorCard";

View file

@ -18,8 +18,8 @@
import monacoHtml from "~fileContent/monacoWin.html"; import monacoHtml from "~fileContent/monacoWin.html";
import { IpcEvents } from "../utils";
import { debounce } from "../utils/debounce"; import { debounce } from "../utils/debounce";
import IpcEvents from "../utils/IpcEvents";
import { Queue } from "../utils/Queue"; import { Queue } from "../utils/Queue";
import { find } from "../webpack/webpack"; import { find } from "../webpack/webpack";

View file

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { makeCodeblock } from "../utils";
import { debounce } from "../utils/debounce"; import { debounce } from "../utils/debounce";
import { makeCodeblock } from "../utils/misc";
import { Button, Clipboard, Forms, Margins, Parser, React, Switch, TextInput } from "../webpack/common"; import { Button, Clipboard, Forms, Margins, Parser, React, Switch, TextInput } from "../webpack/common";
import { search } from "../webpack/webpack"; import { search } from "../webpack/webpack";
import { CheckedTextInput } from "./CheckedTextInput"; import { CheckedTextInput } from "./CheckedTextInput";

View file

@ -21,8 +21,9 @@ import { Constructor } from "type-fest";
import { generateId } from "../../api/Commands"; import { generateId } from "../../api/Commands";
import { useSettings } from "../../api/settings"; import { useSettings } from "../../api/settings";
import { LazyComponent, lazyWebpack, proxyLazy } from "../../utils"; import { LazyComponent, lazyWebpack } from "../../utils/misc";
import { ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize } from "../../utils/modal"; import { ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize } from "../../utils/modal";
import { proxyLazy } from "../../utils/proxyLazy";
import { OptionType, Plugin } from "../../utils/types"; import { OptionType, Plugin } from "../../utils/types";
import { filters, findByCode } from "../../webpack"; import { filters, findByCode } from "../../webpack";
import { Button, FluxDispatcher, Forms, React, Text, Tooltip, UserStore, UserUtils } from "../../webpack/common"; import { Button, FluxDispatcher, Forms, React, Text, Tooltip, UserStore, UserUtils } from "../../webpack/common";

View file

@ -21,9 +21,10 @@ import Plugins from "~plugins";
import { showNotice } from "../../api/Notices"; import { showNotice } from "../../api/Notices";
import { Settings, useSettings } from "../../api/settings"; import { Settings, useSettings } from "../../api/settings";
import { startDependenciesRecursive, startPlugin, stopPlugin } from "../../plugins"; import { startDependenciesRecursive, startPlugin, stopPlugin } from "../../plugins";
import { Logger, Modals } from "../../utils";
import { ChangeList } from "../../utils/ChangeList"; import { ChangeList } from "../../utils/ChangeList";
import Logger from "../../utils/logger";
import { classes, LazyComponent, lazyWebpack } from "../../utils/misc"; import { classes, LazyComponent, lazyWebpack } from "../../utils/misc";
import { openModalLazy } from "../../utils/modal";
import { Plugin } from "../../utils/types"; import { Plugin } from "../../utils/types";
import { filters, findByCode } from "../../webpack"; import { filters, findByCode } from "../../webpack";
import { Alerts, Button, Forms, Margins, Parser, React, Select, Switch, Text, TextInput, Toasts, Tooltip } from "../../webpack/common"; import { Alerts, Button, Forms, Margins, Parser, React, Select, Switch, Text, TextInput, Toasts, Tooltip } from "../../webpack/common";
@ -88,7 +89,7 @@ function PluginCard({ plugin, disabled, onRestartNeeded, onMouseEnter, onMouseLe
} }
function openModal() { function openModal() {
Modals.openModalLazy(async () => { openModalLazy(async () => {
return modalProps => { return modalProps => {
return <PluginModal {...modalProps} plugin={plugin} onRestartNeeded={() => onRestartNeeded(plugin.name)} />; return <PluginModal {...modalProps} plugin={plugin} onRestartNeeded={() => onRestartNeeded(plugin.name)} />;
}; };

View file

@ -16,8 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { lazyWebpack } from "../utils";
import { Devs } from "../utils/constants"; import { Devs } from "../utils/constants";
import { lazyWebpack } from "../utils/misc";
import definePlugin, { OptionType } from "../utils/types"; import definePlugin, { OptionType } from "../utils/types";
import { Settings } from "../Vencord"; import { Settings } from "../Vencord";
import { filters } from "../webpack"; import { filters } from "../webpack";

View file

@ -17,8 +17,8 @@
*/ */
import { DataStore } from "../api"; import { DataStore } from "../api";
import { lazyWebpack } from "../utils";
import { Devs } from "../utils/constants"; import { Devs } from "../utils/constants";
import { lazyWebpack } from "../utils/misc";
import definePlugin from "../utils/types"; import definePlugin from "../utils/types";
import { filters } from "../webpack"; import { filters } from "../webpack";

View file

@ -17,8 +17,8 @@
*/ */
import { addClickListener, removeClickListener } from "../api/MessageEvents"; import { addClickListener, removeClickListener } from "../api/MessageEvents";
import { lazyWebpack } from "../utils";
import { Devs } from "../utils/constants"; import { Devs } from "../utils/constants";
import { lazyWebpack } from "../utils/misc";
import definePlugin from "../utils/types"; import definePlugin from "../utils/types";
import { filters } from "../webpack"; import { filters } from "../webpack";
import { UserStore } from "../webpack/common"; import { UserStore } from "../webpack/common";

View file

@ -17,9 +17,9 @@
*/ */
import { addPreEditListener, addPreSendListener, removePreEditListener, removePreSendListener } from "../api/MessageEvents"; import { addPreEditListener, addPreSendListener, removePreEditListener, removePreSendListener } from "../api/MessageEvents";
import { lazyWebpack } from "../utils";
import { Devs } from "../utils/constants"; import { Devs } from "../utils/constants";
import { ApngDisposeOp, getGifEncoder, importApngJs } from "../utils/dependencies"; import { ApngDisposeOp, getGifEncoder, importApngJs } from "../utils/dependencies";
import { lazyWebpack } from "../utils/misc";
import definePlugin, { OptionType } from "../utils/types"; import definePlugin, { OptionType } from "../utils/types";
import { Settings } from "../Vencord"; import { Settings } from "../Vencord";
import { filters } from "../webpack"; import { filters } from "../webpack";

View file

@ -17,9 +17,9 @@
*/ */
import { ApplicationCommandInputType, ApplicationCommandOptionType, Argument, CommandContext, findOption } from "../api/Commands"; import { ApplicationCommandInputType, ApplicationCommandOptionType, Argument, CommandContext, findOption } from "../api/Commands";
import { lazyWebpack, makeLazy } from "../utils";
import { Devs } from "../utils/constants"; import { Devs } from "../utils/constants";
import { getGifEncoder } from "../utils/dependencies"; import { getGifEncoder } from "../utils/dependencies";
import { lazyWebpack, makeLazy } from "../utils/misc";
import definePlugin from "../utils/types"; import definePlugin from "../utils/types";
import { filters } from "../webpack"; import { filters } from "../webpack";

View file

@ -22,8 +22,8 @@ import { classes, lazyWebpack, useAwaiter } from "../../../utils/misc";
import { Settings } from "../../../Vencord"; import { Settings } from "../../../Vencord";
import { filters } from "../../../webpack"; import { filters } from "../../../webpack";
import { UserStore } from "../../../webpack/common"; import { UserStore } from "../../../webpack/common";
import { fetchPronouns, formatPronouns } from "../pronoundbUtils";
import { PronounMapping } from "../types"; import { PronounMapping } from "../types";
import { fetchPronouns, formatPronouns } from "../utils";
const styles: Record<string, string> = lazyWebpack(filters.byProps("timestampInline")); const styles: Record<string, string> = lazyWebpack(filters.byProps("timestampInline"));

View file

@ -16,11 +16,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { useAwaiter } from "../../../utils"; import { useAwaiter } from "../../../utils/misc";
import { Settings } from "../../../Vencord"; import { Settings } from "../../../Vencord";
import { UserStore } from "../../../webpack/common"; import { UserStore } from "../../../webpack/common";
import { fetchPronouns, formatPronouns } from "../pronoundbUtils";
import { PronounMapping, UserProfileProps } from "../types"; import { PronounMapping, UserProfileProps } from "../types";
import { fetchPronouns, formatPronouns } from "../utils";
export default function PronounsProfileWrapper(props: UserProfileProps, pronounsComponent: JSX.Element) { export default function PronounsProfileWrapper(props: UserProfileProps, pronounsComponent: JSX.Element) {
// Don't bother fetching bot or system users // Don't bother fetching bot or system users

View file

@ -17,8 +17,8 @@
*/ */
import { ApplicationCommandInputType, sendBotMessage } from "../api/Commands"; import { ApplicationCommandInputType, sendBotMessage } from "../api/Commands";
import { lazyWebpack } from "../utils";
import { Devs } from "../utils/constants"; import { Devs } from "../utils/constants";
import { lazyWebpack } from "../utils/misc";
import definePlugin from "../utils/types"; import definePlugin from "../utils/types";
import { filters } from "../webpack"; import { filters } from "../webpack";
import { FluxDispatcher } from "../webpack/common"; import { FluxDispatcher } from "../webpack/common";

View file

@ -18,7 +18,8 @@
import ErrorBoundary from "../../components/ErrorBoundary"; import ErrorBoundary from "../../components/ErrorBoundary";
import { Flex } from "../../components/Flex"; import { Flex } from "../../components/Flex";
import { classes, debounce, LazyComponent, lazyWebpack } from "../../utils"; import { debounce } from "../../utils/debounce";
import { classes, LazyComponent, lazyWebpack } from "../../utils/misc";
import { ContextMenu, FluxDispatcher, Forms, Menu, React, Tooltip } from "../../webpack/common"; import { ContextMenu, FluxDispatcher, Forms, Menu, React, Tooltip } from "../../webpack/common";
import { filters, find } from "../../webpack/webpack"; import { filters, find } from "../../webpack/webpack";
import { SpotifyStore, Track } from "./SpotifyStore"; import { SpotifyStore, Track } from "./SpotifyStore";

View file

@ -18,7 +18,9 @@
import cssText from "~fileContent/styles.css"; import cssText from "~fileContent/styles.css";
import { IpcEvents, lazyWebpack, proxyLazy } from "../../utils"; import IpcEvents from "../../utils/IpcEvents";
import { lazyWebpack } from "../../utils/misc";
import { proxyLazy } from "../../utils/proxyLazy";
import { filters } from "../../webpack"; import { filters } from "../../webpack";
import { Flux, FluxDispatcher } from "../../webpack/common"; import { Flux, FluxDispatcher } from "../../webpack/common";

View file

@ -18,9 +18,9 @@
import ErrorBoundary from "../../components/ErrorBoundary"; import ErrorBoundary from "../../components/ErrorBoundary";
import { Flex } from "../../components/Flex"; import { Flex } from "../../components/Flex";
import { lazyWebpack } from "../../utils"; import { lazyWebpack } from "../../utils/misc";
import { filters } from "../../webpack";
import { Forms, React } from "../../webpack/common"; import { Forms, React } from "../../webpack/common";
import { filters } from "../../webpack/webpack";
interface AppStartPerformance { interface AppStartPerformance {
prefix: string; prefix: string;

View file

@ -17,8 +17,8 @@
*/ */
import { LazyComponent } from "../../utils";
import { Devs } from "../../utils/constants"; import { Devs } from "../../utils/constants";
import { LazyComponent } from "../../utils/misc";
import definePlugin from "../../utils/types"; import definePlugin from "../../utils/types";
export default definePlugin({ export default definePlugin({