Skip to content

Commit

Permalink
formatting supremacy
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierCHN committed Jul 18, 2023
1 parent b65d2ce commit 317c543
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 31 deletions.
39 changes: 8 additions & 31 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,34 +1,15 @@
{
"parser": "@typescript-eslint/parser",
"extends": [
"plugin:prettier/recommended",
"plugin:react-hooks/recommended"
],
"extends": ["plugin:prettier/recommended", "plugin:react-hooks/recommended"],
"settings": {
"import/resolver": {
"node": {
"extensions": [
".js",
".ts",
".jsx",
".tsx"
]
"extensions": [".js", ".ts", ".jsx", ".tsx"]
}
},
"import/extensions": [
".js",
".ts",
".jsx",
".tsx"
]
"import/extensions": [".js", ".ts", ".jsx", ".tsx"]
},
"plugins": [
"@typescript-eslint",
"import",
"prettier",
"react",
"react-hooks"
],
"plugins": ["@typescript-eslint", "import", "prettier", "react", "react-hooks"],
"rules": {
"prettier/prettier": [
"error",
Expand All @@ -42,10 +23,7 @@
"paths": [
{
"name": "@mui/material",
"importNames": [
"makeStyles",
"createMuiTheme"
],
"importNames": ["makeStyles", "createMuiTheme"],
"message": "Please import from @mui/material/styles instead. See https://material-ui.com/guides/minimizing-bundle-size/#option-2 for more information"
}
]
Expand All @@ -57,14 +35,13 @@
"prefer": "type-imports"
}
],
"lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }],
"prefer-const": "error",
"no-eval": "error",
"no-redeclare": "off",
"import/no-anonymous-default-export": "off",
"@typescript-eslint/no-redeclare": [
"off"
],
"@typescript-eslint/no-redeclare": ["off"],
"react-hooks/exhaustive-deps": "warn",
"react-hooks/rules-of-hooks": "error"
}
}
}
16 changes: 16 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"editor.codeActionsOnSave": {
"source.fixAll": true
},
"[typescript]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"[javascript]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"[json]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint",
"eslint.run": "onSave",
}
2 changes: 2 additions & 0 deletions game/scripts/src/modules/Debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ export class Debug {
OnlineDebugWhiteList = [
86815341, // Xavier
];

constructor() {
// 工具模式下开启调试
this.DebugEnabled = IsInToolsMode();
ListenToGameEvent(`player_chat`, keys => this.OnPlayerChat(keys), this);
}

OnPlayerChat(keys: GameEventProvidedProperties & PlayerChatEvent): void {
const strs = keys.text.split(' ');
const cmd = strs[0];
Expand Down
1 change: 1 addition & 0 deletions game/scripts/src/utils/dota_ts_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export class BaseModifier {
): InstanceType<T> {
return target.AddNewModifier(caster, ability, this.name, modifierTable) as unknown as InstanceType<T>;
}

public static find_on<T extends typeof BaseModifier>(this: T, target: CDOTA_BaseNPC): InstanceType<T> {
return target.FindModifierByName(this.name) as unknown as InstanceType<T>;
}
Expand Down
4 changes: 4 additions & 0 deletions game/scripts/src/utils/fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export class fs {
const request = CreateHTTPRequestScriptVM(method, `http://localhost:10384${url}`);
return request;
}

public static dir(path: string): Promise<string[]> {
return new Promise((resolve, reject) => {
fs.request('GET', path).Send(result => {
Expand All @@ -22,6 +23,7 @@ export class fs {
});
});
}

public static read(path: string): Promise<string> {
return new Promise((resolve, reject) => {
fs.request('GET', path).Send(result => {
Expand All @@ -33,6 +35,7 @@ export class fs {
});
});
}

public static write(path: string, content: string): Promise<void> {
return new Promise((resolve, reject) => {
const request = fs.request('PUT', path);
Expand All @@ -46,6 +49,7 @@ export class fs {
});
});
}

public static mkdir(path: string): Promise<void> {
return new Promise((resolve, reject) => {
fs.request('POST', path).Send(result => {
Expand Down

0 comments on commit 317c543

Please sign in to comment.