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

feat: add pre-commit #9

Open
wants to merge 1 commit into
base: master
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
70 changes: 35 additions & 35 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,52 +5,52 @@ module.exports = {
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
"prettier",
'prettier',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['import', 'react-refresh'],
rules: {
// Eslint
"import/no-unresolved": "error",
'import/order': ["error", {
groups: ["builtin", "external", "internal", "parent", "sibling", "index", "object", "type"],
'newlines-between': 'always'
}],
'import/no-unresolved': 'error',
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type'],
'newlines-between': 'always',
},
],

// React
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
// Typescript
"@typescript-eslint/array-type": "error",
"@typescript-eslint/camelcase": [0],
"@typescript-eslint/unbound-method": ["off"],
"@typescript-eslint/no-floating-promises": ["off"],
"@typescript-eslint/explicit-function-return-type": ["off", { "allowExpressions": true }],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-misused-promises": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-cal": "off",
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-unsafe-enum-comparison": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unused-vars": "off",
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/camelcase': [0],
'@typescript-eslint/unbound-method': ['off'],
'@typescript-eslint/no-floating-promises': ['off'],
'@typescript-eslint/explicit-function-return-type': ['off', { allowExpressions: true }],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-cal': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': [".ts", ".tsx"]
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
'typescript': {
'alwaysTryTypes': true
}
}
}
}
typescript: {
alwaysTryTypes: true,
},
},
},
};
50 changes: 50 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
exclude: |
(?x)^(
dist|
node_modules
)$
default_language_version:
python: python3.9

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
exclude: ^.*\.md$
- id: end-of-file-fixer
- id: no-commit-to-branch
- id: mixed-line-ending
args: [--fix=lf]
- id: check-merge-conflict

- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.56.0
hooks:
- id: eslint
files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
types: [file]
additional_dependencies:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier

- repo: https://github.com/adrienverge/yamllint
rev: v1.33.0
hooks:
- id: yamllint

- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.2.3
hooks:
- id: yamlfmt
args: [--mapping, '2', --sequence, '4', --offset, '2', --width, '80']
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ This site helps streamers manage viewer requests for various types of auctions.

## Suggestions and bugreports

You can create an [issue](https://github.com/Pointauc/pointauc_frontend/issues) if you want to suggest something or tell about a bug.
You can create an [issue](https://github.com/Pointauc/pointauc_frontend/issues) if you want to suggest something or tell about a bug.
5 changes: 1 addition & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
<meta name="theme-color" content="#000000" />

<title>Поинтовый аукцион</title>
<meta
name="description"
content="Сайт для удобного проведения поинтовых аукционов"
/>
<meta name="description" content="Сайт для удобного проведения поинтовых аукционов" />
</head>
<body style="background: #242424; min-height: 100%; min-width: 100%">
<div id="root"></div>
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"react-router": "^6.18.0",
"react-router-dom": "^6.18.0",
"react-transition-group": "^4.4.5",
"react-window": "^1.8.10",
"redux": "^4.2.1",
"redux-thunk": "^2.4.2",
"socket.io-client": "^4.7.2",
Expand Down
2 changes: 1 addition & 1 deletion public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@

.nav {
&-icon {

svg {
width: 26px !important;
height: 26px !important;
fill: #fff;
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/assets/icons/DAAlert.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/icons/auction.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 6 additions & 4 deletions src/assets/index.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-515XS3RKPR"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());

gtag('config', 'G-515XS3RKPR');
</script>
<base href="/">
<base href="/" />
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
Expand All @@ -19,7 +21,7 @@
name="description"
content="Сайт для удобного проведения поинтовых или денежных аукционов. Имеет интеграции такими сервисами как Twitch, Donation Alerts и DonatePay."
/>
<!-- <link rel="apple-touch-icon" href="/logo192.png" />-->
<!-- <link rel="apple-touch-icon" href="/logo192.png" />-->
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
Expand Down
2 changes: 1 addition & 1 deletion src/assets/netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
status = 200
Loading