diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 09c2f4d..db1fb57 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -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, + }, + }, + }, +}; diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..dedf896 --- /dev/null +++ b/.pre-commit-config.yaml @@ -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: + - eslint-config-prettier@9.0.0 + - eslint-import-resolver-typescript@3.6.1 + - eslint-plugin-import@2.29.0 + - eslint-plugin-react-hooks@4.6.0 + - eslint-plugin-react-refresh@0.4.3 + - eslint-plugin-simple-import-sort@10.0.0 + + - 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'] diff --git a/README.md b/README.md index 6716246..b120f98 100644 --- a/README.md +++ b/README.md @@ -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. \ No newline at end of file +You can create an [issue](https://github.com/Pointauc/pointauc_frontend/issues) if you want to suggest something or tell about a bug. diff --git a/index.html b/index.html index f972887..5636e31 100644 --- a/index.html +++ b/index.html @@ -7,10 +7,7 @@