Skip to content

Commit

Permalink
Merge branch 'master' into Kiselev_Jaroslav_Denisovich
Browse files Browse the repository at this point in the history
  • Loading branch information
jskonst committed Oct 5, 2024
2 parents 3b19be2 + 58b5956 commit d77a0a6
Show file tree
Hide file tree
Showing 28 changed files with 13,439 additions and 26,586 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/onlineshop_backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Onlineshop backend

on: [push, pull_request]

jobs:
backend:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 20.11.x
cache: yarn
cache-dependency-path: ./onlineshop/source/server/yarn.lock
- name: Lint backend
run: |
cd ./onlineshop/source/server/
yarn install --immutable --immutable-cache --check-cache
yarn run lint
- name: Test server
run: |
cd ./onlineshop/source/server/
yarn install --immutable --immutable-cache --check-cache
yarn run test
27 changes: 27 additions & 0 deletions .github/workflows/onlineshop_frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

name: onlineshop frontend

on: [push, pull_request]

jobs:
frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 20.11.x
cache: yarn
cache-dependency-path: ./onlineshop/source/client/yarn.lock
- name: Lint frontend
run: |
cd ./onlineshop/source/client/
yarn install --immutable --immutable-cache --check-cache
yarn run lint
- name: Test client
run: |
cd ./onlineshop/source/client/
yarn install --immutable --immutable-cache --check-cache
yarn run test
26 changes: 26 additions & 0 deletions .github/workflows/rpgsaga.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

name: rpg saga
on: [push, pull_request]

jobs:
saga-ci:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 20.11.x
cache: yarn
cache-dependency-path: ./rpgsaga/saga/yarn.lock
- name: Lint Saga
run: |
cd ./rpgsaga/saga
yarn install --immutable --immutable-cache --check-cache
yarn run lint
- name: Test Saga
run: |
cd ./rpgsaga/saga
yarn install --immutable --immutable-cache --check-cache
yarn run test
152 changes: 0 additions & 152 deletions onlineshop/source/client/.eslintrc.js

This file was deleted.

157 changes: 157 additions & 0 deletions onlineshop/source/client/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
import { fixupConfigRules, fixupPluginRules } from "@eslint/compat";
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import prettier from "eslint-plugin-prettier";
import _import from "eslint-plugin-import";
import globals from "globals";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [{
ignores: ["**/.eslintrc.js", "**/react-app-env.d.ts"],
}, ...fixupConfigRules(compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:prettier/recommended",
)), {
plugins: {
"@typescript-eslint": fixupPluginRules(typescriptEslint),
prettier: fixupPluginRules(prettier),
import: fixupPluginRules(_import),
},

languageOptions: {
globals: {
...globals.browser,
},

parser: tsParser,
ecmaVersion: 12,
sourceType: "module",

parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},

settings: {
"import/resolver": {
node: {
extensions: [".js", ".jsx", ".ts", ".tsx"],
moduleDirectory: ["node_modules", "."],
},
},
},

rules: {
"no-param-reassign": ["error"],

"prettier/prettier": ["error", {
endOfLine: "auto",
}],

"linebreak-style": 0,

"arrow-body-style": ["error", "as-needed", {
requireReturnForObjectLiteral: false,
}],

curly: ["error", "all"],
"no-implicit-coercion": ["error"],
"spaced-comment": ["error", "always"],
eqeqeq: ["error", "always"],
"prefer-template": "error",
"no-useless-concat": "error",

"prefer-destructuring": ["error", {
VariableDeclarator: {
array: false,
object: true,
},

AssignmentExpression: {
array: false,
object: true,
},
}, {
enforceForRenamedProperties: false,
}],

"import/extensions": ["error", "ignorePackages", {
ts: "never",
tsx: "never",
}],

"import/no-extraneous-dependencies": ["error", {
devDependencies: true,
}],

"import/order": ["error", {
"newlines-between": "always",
groups: ["builtin", "external", "parent", "sibling", "index"],

pathGroups: [{
pattern: "src/**",
group: "parent",
position: "after",
}],
}],

"import/newline-after-import": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-empty-object-type": ["error"],
"@typescript-eslint/no-unsafe-function-type": ["error"],
"@typescript-eslint/no-wrapper-object-types": ["error"],
"@typescript-eslint/no-shadow": ["error"],

"@typescript-eslint/naming-convention": ["error", {
selector: "default",
format: ["camelCase"],
}, {
selector: ["memberLike"],
modifiers: ["private"],
format: ["camelCase"],
leadingUnderscore: "allow",
}, {
selector: ["enumMember", "variable"],
format: ["camelCase", "PascalCase", "UPPER_CASE"],
}, {
selector: "parameter",
format: ["camelCase"],
leadingUnderscore: "allow",
modifiers: ["unused"],
}, {
selector: "objectLiteralProperty",

filter: {
regex: "^[a-z]([a-z0-9-]+)?(__([a-z0-9]+-?)+)?(--([a-z0-9]+-?)+){0,2}$",
match: true,
},

format: null,
}, {
selector: "typeLike",
format: ["PascalCase"],
}, {
selector: "typeProperty",
format: ["snake_case", "camelCase"],
}],
},
}];
Loading

0 comments on commit d77a0a6

Please sign in to comment.