This commit is contained in:
Untone 2024-02-04 10:17:13 +03:00
parent 02de191b6d
commit 67541bef79
7 changed files with 80 additions and 2517 deletions

View File

@ -1,7 +0,0 @@
node_modules
public
*.cjs
dist/
.vercel/
src/graphql/client/*
src/graphql/schema/*

View File

@ -1,109 +0,0 @@
module.exports = {
plugins: ['@typescript-eslint', 'import', 'sonarjs', 'unicorn', 'promise', 'solid', 'jest'],
extends: [
'eslint:recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'prettier',
'plugin:sonarjs/recommended',
'plugin:unicorn/recommended',
'plugin:promise/recommended',
'plugin:solid/recommended',
'plugin:jest/recommended',
],
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2021,
ecmaFeatures: { jsx: true },
sourceType: 'module',
project: './tsconfig.json',
},
extends: [
'plugin:@typescript-eslint/recommended',
// 'plugin:@typescript-eslint/recommended-requiring-type-checking', // 30-01-2024 699 problems
],
rules: {
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-explicit-any': 'warn',
},
},
],
env: {
browser: true,
node: true,
// mocha: true,
},
globals: {},
rules: {
// Solid
'solid/reactivity': 'off',
'solid/no-innerhtml': 'off',
/** Unicorn **/
'unicorn/no-null': 'off',
'unicorn/filename-case': 'off',
'unicorn/no-array-for-each': 'off',
'unicorn/no-array-reduce': 'off',
'unicorn/prefer-string-replace-all': 'warn',
'unicorn/prevent-abbreviations': 'off',
'unicorn/prefer-module': 'off',
'unicorn/import-style': 'off',
'unicorn/numeric-separators-style': 'off',
'unicorn/prefer-node-protocol': 'off',
'unicorn/prefer-dom-node-append': 'warn',
'unicorn/prefer-top-level-await': 'warn',
'unicorn/consistent-function-scoping': 'warn',
'unicorn/no-array-callback-reference': 'warn',
'unicorn/no-array-method-this-argument': 'warn',
'unicorn/no-for-loop': 'off',
'unicorn/prefer-switch': 'warn',
'sonarjs/no-duplicate-string': ['warn', { threshold: 5 }],
'sonarjs/prefer-immediate-return': 'warn',
// Promise
'promise/catch-or-return': 'off',
'promise/always-return': 'off',
eqeqeq: 'error',
'no-param-reassign': 'error',
'no-nested-ternary': 'error',
'no-shadow': 'error',
'import/order': [
'warn',
{
groups: ['type', 'builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
distinctGroup: false,
pathGroups: [
{
pattern: '*.scss',
patternOptions: { matchBase: true },
group: 'index',
position: 'after',
},
],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
},
settings: {
'import/resolver': {
typescript: true,
node: true,
},
},
}

View File

@ -40,6 +40,14 @@ jobs:
- name: Run Biome - name: Run Biome
run: biome ci . run: biome ci .
push:
runs-on: ubuntu-latest
steps:
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: ${{ github.head_ref }}
update_mailgun_template: update_mailgun_template:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Update templates on Mailgun name: Update templates on Mailgun
@ -49,34 +57,34 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: "Email confirmation template" - name: 'Email confirmation template'
uses: gyto/mailgun-template-action@v2 uses: gyto/mailgun-template-action@v2
with: with:
html-file: "./templates/authorizer_email_confirmation.html" html-file: './templates/authorizer_email_confirmation.html'
mailgun-api-key: ${{ secrets.MAILGUN_API_KEY }} mailgun-api-key: ${{ secrets.MAILGUN_API_KEY }}
mailgun-domain: "discours.io" mailgun-domain: 'discours.io'
mailgun-template: "authorizer_email_confirmation" mailgun-template: 'authorizer_email_confirmation'
- name: "Password reset template" - name: 'Password reset template'
uses: gyto/mailgun-template-action@v2 uses: gyto/mailgun-template-action@v2
with: with:
html-file: "./templates/authorizer_password_reset.html" html-file: './templates/authorizer_password_reset.html'
mailgun-api-key: ${{ secrets.MAILGUN_API_KEY }} mailgun-api-key: ${{ secrets.MAILGUN_API_KEY }}
mailgun-domain: "discours.io" mailgun-domain: 'discours.io'
mailgun-template: "authorizer_password_reset" mailgun-template: 'authorizer_password_reset'
- name: "First publication notification" - name: 'First publication notification'
uses: gyto/mailgun-template-action@v2 uses: gyto/mailgun-template-action@v2
with: with:
html-file: "./templates/first_publication_notification.html" html-file: './templates/first_publication_notification.html'
mailgun-api-key: ${{ secrets.MAILGUN_API_KEY }} mailgun-api-key: ${{ secrets.MAILGUN_API_KEY }}
mailgun-domain: "discours.io" mailgun-domain: 'discours.io'
mailgun-template: "first_publication_notification" mailgun-template: 'first_publication_notification'
- name: "New comment notification template" - name: 'New comment notification template'
uses: gyto/mailgun-template-action@v2 uses: gyto/mailgun-template-action@v2
with: with:
html-file: "./templates/new_comment_notification.html" html-file: './templates/new_comment_notification.html'
mailgun-api-key: ${{ secrets.MAILGUN_API_KEY }} mailgun-api-key: ${{ secrets.MAILGUN_API_KEY }}
mailgun-domain: "discours.io" mailgun-domain: 'discours.io'
mailgun-template: "new_comment_notification" mailgun-template: 'new_comment_notification'

View File

@ -1,5 +1,5 @@
{ "lint-staged": {
"*.{js,ts,tsx,json,scss,css,html}": "prettier --write", "*.{js,ts,cjs,mjs,d.mts,jsx,tsx,json,jsonc}": ["biome check --apply --no-errors-on-unmatched"],
"package.json": "sort-package-json", "package.json": "sort-package-json",
"public/locales/**/*.json": "sort-json" "public/locales/**/*.json": "sort-json"
} }

View File

@ -1,6 +0,0 @@
{
"*.{js,mjs,ts,tsx,json,scss,css,html}": "prettier --write",
"package.json": "sort-package-json",
"*.{scss,css}": "stylelint",
"*.{ts,tsx,js,mjs}": "eslint --fix"
}

2413
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -11,11 +11,11 @@
"deploy": "graphql-codegen && npm run typecheck && vite build && vercel", "deploy": "graphql-codegen && npm run typecheck && vite build && vercel",
"dev": "vite", "dev": "vite",
"fix": "npm run lint:code:fix && npm run lint:styles:fix", "fix": "npm run lint:code:fix && npm run lint:styles:fix",
"format": "npx prettier \"{,!(node_modules)/**/}*.{js,ts,tsx,json,scss,css}\" --write --ignore-path .gitignore", "format": "npx @biomejs/biome format src/. --write",
"postinstall": "npm run codegen", "postinstall": "npm run codegen",
"lint": "npm run lint:code && npm run lint:styles", "lint": "npm run lint:code && npm run lint:styles",
"lint:code": "eslint .", "lint:code": "npx @biomejs/biome lint src --log-kind=pretty --verbose",
"lint:code:fix": "eslint . --fix", "lint:code:fix": "npx @biomejs/biome lint src --apply --log-kind=pretty --verbose",
"lint:styles": "stylelint **/*.{scss,css}", "lint:styles": "stylelint **/*.{scss,css}",
"lint:styles:fix": "stylelint **/*.{scss,css} --fix", "lint:styles:fix": "stylelint **/*.{scss,css} --fix",
"pre-commit": "lint-staged", "pre-commit": "lint-staged",
@ -105,16 +105,6 @@
"change-case": "5.2.0", "change-case": "5.2.0",
"clsx": "2.0.0", "clsx": "2.0.0",
"cross-env": "7.0.3", "cross-env": "7.0.3",
"eslint": "8.53.0",
"eslint-config-stylelint": "20.0.0",
"eslint-import-resolver-typescript": "3.6.1",
"eslint-plugin-import": "2.29.0",
"eslint-plugin-jest": "27.6.0",
"eslint-plugin-jsx-a11y": "6.8.0",
"eslint-plugin-promise": "6.1.1",
"eslint-plugin-solid": "0.13.0",
"eslint-plugin-sonarjs": "0.23.0",
"eslint-plugin-unicorn": "49.0.0",
"fast-deep-equal": "3.1.3", "fast-deep-equal": "3.1.3",
"graphql": "16.8.1", "graphql": "16.8.1",
"graphql-tag": "2.12.6", "graphql-tag": "2.12.6",
@ -128,8 +118,6 @@
"loglevel": "1.8.1", "loglevel": "1.8.1",
"loglevel-plugin-prefix": "0.8.4", "loglevel-plugin-prefix": "0.8.4",
"nanostores": "0.9.5", "nanostores": "0.9.5",
"prettier": "3.1.0",
"prettier-eslint": "16.1.2",
"prosemirror-history": "1.3.0", "prosemirror-history": "1.3.0",
"prosemirror-trailing-node": "2.0.3", "prosemirror-trailing-node": "2.0.3",
"prosemirror-view": "1.30.2", "prosemirror-view": "1.30.2",