Skip to content

Commit

Permalink
style(#128): apply style fix lint
Browse files Browse the repository at this point in the history
+ change typescript aliases from `@<module>` to `@/<module>` (ex: `@services` -> `@/services` to distinguish them from external npm packages
  • Loading branch information
barthofu committed Feb 9, 2024
1 parent c1232b3 commit c8778b9
Show file tree
Hide file tree
Showing 117 changed files with 4,365 additions and 4,378 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
**Please describe the changes this PR makes and why it should be merged:**
**Please describe the changes this PR makes and why it should be merged:**
32 changes: 16 additions & 16 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@
"editor.formatOnSave": false,

// Auto fix
// "editor.codeActionsOnSave": {
// "source.fixAll.eslint": "explicit",
// "source.organizeImports": "never"
// },
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},

// Silent the stylistic rules in you IDE, but still auto fix them
// "eslint.rules.customizations": [
// { "rule": "style/*", "severity": "off" },
// { "rule": "format/*", "severity": "off" },
// { "rule": "*-indent", "severity": "off" },
// { "rule": "*-spacing", "severity": "off" },
// { "rule": "*-spaces", "severity": "off" },
// { "rule": "*-order", "severity": "off" },
// { "rule": "*-dangle", "severity": "off" },
// { "rule": "*-newline", "severity": "off" },
// { "rule": "*quotes", "severity": "off" },
// { "rule": "*semi", "severity": "off" }
// ],
"eslint.rules.customizations": [
{ "rule": "style/*", "severity": "off" },
{ "rule": "format/*", "severity": "off" },
{ "rule": "*-indent", "severity": "off" },
{ "rule": "*-spacing", "severity": "off" },
{ "rule": "*-spaces", "severity": "off" },
{ "rule": "*-order", "severity": "off" },
{ "rule": "*-dangle", "severity": "off" },
{ "rule": "*-newline", "severity": "off" },
{ "rule": "*quotes", "severity": "off" },
{ "rule": "*semi", "severity": "off" }
],

// Enable eslint for all supported languages
"eslint.validate": [
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
<table>
<tr>
<td align="center">

# What is TSCord

#### **TSCord** is a fully-featured **[discord bot](https://discord.com/developers/docs/intro#bots-and-apps)** *template* written in [Typescript](https://www.typescriptlang.org/), intended to provide a framework that's easy to use, extend and modify.

It uses [`discordx`](https://github.com/discordx-ts/discordx) and [`discord.js v14`](https://github.com/discordjs/discord.js) under the hood to simplify the development of discord bots.

This template was created to give developers a starting point for new Discord bots, so that much of the initial setup can be avoided and developers can instead focus on meaningful bot features. Developers can simply follow the [installation](https://tscord.discbot.app/docs/bot/get-started/installation) and the [configuration](https://tscord.discbot.app/docs/bot/get-started/configuration) instructions, and have a working bot with many boilerplate features already included!
This template was created to give developers a starting point for new Discord bots, so that much of the initial setup can be avoided and developers can instead focus on meaningful bot features. Developers can simply follow the [installation](https://tscord.discbot.app/docs/bot/get-started/installation) and the [configuration](https://tscord.discbot.app/docs/bot/get-started/configuration) instructions, and have a working bot with many boilerplate features already included!
</td>
</tr>
</table>
Expand Down Expand Up @@ -91,7 +91,6 @@ https://user-images.githubusercontent.com/66025667/196367258-94c77e23-779c-4d9b-
</a>
</div>


## 馃摐 Features

Talking about features, here are some of the core features of the template:
Expand Down
8 changes: 7 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ module.exports = antfu(
},
}],
'style/object-curly-spacing': ['error', 'always'],
'style/padded-blocks': ['error', 'always'],
'style/padded-blocks': ['error', {
blocks: 'never',
classes: 'always',
switches: 'never',
}],
'style/padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: '*', next: 'class' },
Expand Down Expand Up @@ -112,6 +116,8 @@ module.exports = antfu(
// Packages.
// Things that start with a letter (or digit or underscore), or `@` followed by a letter.
['^@\\w'],
// Internal packages.
// Things that start with `@/`.
['^\\w'],
// Absolute imports and other imports such as Vue-style `@/foo`.
// Anything not matched in another group.
Expand Down
27 changes: 15 additions & 12 deletions mikro-orm.config.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
// @ts-nocheck

import { mikroORMConfig } from "./src/configs/database"
import * as entities from "@entities"
import { PluginsManager } from "@services"
import { Options } from "@mikro-orm/core"
import { resolveDependency } from "@utils/functions"
import process from 'node:process'

import { Options } from '@mikro-orm/core'

import * as entities from '@/entities'
import { PluginsManager } from '@/services'
import { resolveDependency } from '@/utils/functions'

import { mikroORMConfig } from './src/configs/database'

export default async () => {
const pluginsManager = await resolveDependency(PluginsManager)
await pluginsManager.loadPlugins()
const pluginsManager = await resolveDependency(PluginsManager)
await pluginsManager.loadPlugins()

return {
...mikroORMConfig[process.env.NODE_ENV || 'development'] as Options<DatabaseDriver>,
entities: [...Object.values(entities), ...pluginsManager.getEntities()]
}
return {
...mikroORMConfig[process.env.NODE_ENV || 'development'] as Options<DatabaseDriver>,
entities: [...Object.values(entities), ...pluginsManager.getEntities()],
}
}

Loading

0 comments on commit c8778b9

Please sign in to comment.