Skip to content

Commit 2b94309

Browse files
authored
Merge pull request #126 from BinaryStudioAcademy/task/thjs-122-setup-project-base-starter
thjs-122: Setup project base starter
2 parents b619c65 + 2911b7e commit 2b94309

File tree

611 files changed

+10498
-23198
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

611 files changed

+10498
-23198
lines changed

.eslintrc.yml

Lines changed: 0 additions & 149 deletions
This file was deleted.

.lintstagedrc.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.ls-lint.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@ ls:
2020
ignore:
2121
- .git
2222
- node_modules
23-
- build
24-
- shared/build
25-
- shared/node_modules
26-
- client/build
27-
- client/node_modules
28-
- server/build
29-
- server/node_modules
30-
- .idea
23+
- packages/shared/build
24+
- packages/shared/node_modules
25+
- apps/frontend/build
26+
- apps/frontend/node_modules
27+
- apps/backend/build
28+
- apps/backend/node_modules

.prettierrc.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.stylelintrc.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,3 @@ DB_CLIENT=pg
2525
DB_POOL_MIN=1
2626
DB_POOL_MAX=10
2727

28-
#
29-
# AUTHENTICATION
30-
#
31-
# SECRET_KEY has to be changed to own random secret key
32-
SECRET_KEY=secretkeysecretkeysecretkey
33-
34-
# Image Storage
35-
#
36-
# GYAZO_ACCESS_TOKEN - has to be changed to a real key from Gyazo
37-
GYAZO_UPLOAD_API_URL=https://upload.gyazo.com/api/upload
38-
GYAZO_ACCESS_TOKEN=gyazoaccesstoken

apps/backend/eslint.config.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import baseConfig from '../../eslint.config.js';
2+
3+
/** @typedef {import("eslint").Linter.FlatConfig} */
4+
let FlatConfig;
5+
6+
/** @type {FlatConfig} */
7+
const ignoresConfig = {
8+
ignores: ['build']
9+
};
10+
11+
/** @type {FlatConfig[]} */
12+
const overridesConfigs = [
13+
{
14+
files: ['knexfile.ts'],
15+
rules: {
16+
'import/no-default-export': ['off']
17+
}
18+
},
19+
{
20+
files: ['jest.config.js'],
21+
rules: {
22+
'@typescript-eslint/explicit-function-return-type': ['off'],
23+
'@typescript-eslint/no-magic-numbers': ['off'],
24+
'@typescript-eslint/no-unsafe-argument': ['off'],
25+
'@typescript-eslint/no-unsafe-assignment': ['off'],
26+
'@typescript-eslint/no-unsafe-call': ['off'],
27+
'@typescript-eslint/no-unsafe-member-access': ['off'],
28+
'@typescript-eslint/no-unsafe-return': ['off'],
29+
'import/no-default-export': ['off']
30+
}
31+
},
32+
{
33+
files: ['src/db/migrations/**/*.ts'],
34+
rules: {
35+
'unicorn/filename-case': [
36+
'error',
37+
{
38+
case: 'snakeCase'
39+
}
40+
]
41+
}
42+
},
43+
{
44+
files: ['src/libs/modules/controller/controller.module.ts'],
45+
rules: {
46+
'@typescript-eslint/no-magic-numbers': ['off']
47+
}
48+
}
49+
];
50+
51+
/** @type {FlatConfig[]} */
52+
const config = [...baseConfig, ignoresConfig, ...overridesConfigs];
53+
54+
export default config;
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { join } from 'node:path';
22
import { fileURLToPath } from 'node:url';
3-
43
import { pathsToModuleNameMapper } from 'ts-jest';
54

65
import tsconfigJson from './tsconfig.json' assert { type: 'json' };
@@ -19,19 +18,19 @@ const manageMapper = mapper => ({
1918
});
2019

2120
export default {
22-
testEnvironment: 'jest-environment-node',
23-
preset: 'ts-jest/presets/default-esm',
2421
extensionsToTreatAsEsm: ['.ts'],
25-
transformIgnorePatterns: ['node_modules/'],
26-
testPathIgnorePatterns: ['node_modules/', 'dist/', 'build/'],
2722
moduleNameMapper: manageMapper(
2823
pathsToModuleNameMapper(tsconfigJson.compilerOptions.paths, {
2924
prefix: sourcePath
3025
})
3126
),
27+
preset: 'ts-jest/presets/default-esm',
28+
testEnvironment: 'jest-environment-node',
29+
testPathIgnorePatterns: ['node_modules/', 'dist/', 'build/'],
30+
testTimeout: 10_000,
3231
transform: {
3332
'^.+\\.tsx?$': ['ts-jest', { useESM: true }]
3433
},
35-
testTimeout: 10_000,
34+
transformIgnorePatterns: ['node_modules/'],
3635
workerIdleMemoryLimit: '1GB'
3736
};

apps/backend/knexfile.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { database } from '~/libs/modules/database/database.js';
2+
3+
export default database.environmentsConfig;

apps/backend/lint-staged.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { default as baseConfig } from '../../lint-staged.config.js';
2+
3+
/** @type {import('lint-staged').Config} */
4+
const config = {
5+
...baseConfig,
6+
'**/*.ts': [
7+
() => 'npm run lint:js -w apps/backend',
8+
() => 'npm run lint:type -w apps/backend'
9+
]
10+
};
11+
12+
export default config;

0 commit comments

Comments
 (0)