Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/qol changes #117

Open
wants to merge 18 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
commitlint.config.js
89 changes: 89 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:solid/typescript",
"plugin:@typescript-eslint/recommended",
"prettier-standard"
],
"parserOptions": {
"project": "tsconfig.eslint.json",
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest"
},
"plugins": ["@typescript-eslint", "prettier", "solid", "import"],
"env": {
"browser": true,
"es6": true,
"node": true,
"jest": true
},
"rules": {
"no-redeclare": "off",
"camelcase": "off",
"no-use-before-define": "off",
"no-lone-blocks": "off",
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
}
],
"import/no-anonymous-default-export": [
"error",
{
"allowArrowFunction": true,
"allowAnonymousFunction": true
}
],
"solid/reactivity": "off",
"no-unused-vars": "off",
"prefer-const": "off",
"@typescript-eslint/ban-ts-comment": "off", // отключили до разбирательства с типами (есть туду)
"@typescript-eslint/no-explicit-any": "off", // пока что отключил, чтоб не падал деплой
"@typescript-eslint/triple-slash-reference": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
],
"import/no-named-default": "off",
"no-implicit-globals": "error",
"max-len": [
"warn",
{
"code": 140,
"ignoreComments": true
}
],
"no-useless-escape": "off",
"no-unmodified-loop-condition": "off",
"import/export": "off"
},
"overrides": [
{
"files": ["src/**/*.js", "src/**/*.ts", "src/**/*.tsx"],
"rules": {
"import/newline-after-import": "error",
"import/no-internal-modules": ["off"],
"import/order": [
"error",
{
"newlines-between": "always",
"groups": [["builtin", "external", "internal"]],
"pathGroupsExcludedImportTypes": [
["builtin", "external", "internal"]
]
}
]
}
}
]
}
40 changes: 0 additions & 40 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/backend-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ jobs:
with:
name: clippy (${{ runner.os }})
token: ${{ secrets.GITHUB_TOKEN }}
args: --manifest-path ./src-tauri/Cargo.toml --no-default-features -- -D warnings
args: --manifest-path ./src-tauri/Cargo.toml --no-default-features
42 changes: 36 additions & 6 deletions .github/workflows/frontend-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,44 @@ concurrency:
jobs:
prettier-tsc-eslint-checks:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install

- name: Install modules
run: yarn
- name: Run prettier
run: yarn prettier --check .
run: pnpm prettier --check .
- name: Run tsc
run: yarn tsc --noEmit
run: pnpm tsc --noEmit
- name: Run ESLint
run: yarn eslint src
run: pnpm eslint src
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
/.pnp
.pnp.js

.idea

# testing
/coverage

Expand Down
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

1 change: 1 addition & 0 deletions .lefthook/commit-msg/commitlint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
echo $(head -n1 $1) | pnpx commitlint --color
4 changes: 0 additions & 4 deletions .lintstagedrc.json

This file was deleted.

4 changes: 3 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
node_modules/
src-tauri/resources/
src-tauri/target/
src-tauri/WixTools/
src-tauri/WixTools/
build/
coverage/
14 changes: 14 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const prettierConfigStandard = require('prettier-config-standard');

const modifiedConfig = {
...prettierConfigStandard,
semi: true,
parser: 'typescript',
singleQuote: true,
trailingComma: 'es5',
proseWrap: 'never',
arrowParens: 'always',
tabWidth: 2,
};

module.exports = modifiedConfig;
4 changes: 0 additions & 4 deletions .prettierrc.json

This file was deleted.

3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
};
7 changes: 4 additions & 3 deletions public/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Tauri-powered anime game launcher" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="apple-touch-icon" href="/logo192.png" />
<link rel="manifest" href="/manifest.json" />
<title>Cultivation</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
18 changes: 18 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
pre-commit:
parallel: true
commands:
prettier-js:
glob: "*.{ts,js,tsx}"
run: prettier --write {staged_files}
prettier-json:
glob: "{*.json,.prettierrc,.lintstagedrc,.eslintrc}"
run: prettier --write --parser json {staged_files}
lint:
exclude: ".prettierrc.js|commitlint.config.js"
glob: "*.{ts,tsx}"
run: eslint --fix {staged_files}

commit-msg:
scripts:
'commitlint.sh':
runner: bash
Loading