Skip to content

Commit

Permalink
chore(whole project): fixed fatal yarn errors, fixed linting
Browse files Browse the repository at this point in the history
  • Loading branch information
gearonix committed Aug 17, 2023
1 parent f605d1d commit 180e783
Show file tree
Hide file tree
Showing 34 changed files with 232 additions and 229 deletions.
24 changes: 8 additions & 16 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const {configure, presets} = require('eslint-kit')

/**
* Creates eslint config
*
* @param {string} root - define root of project (ex: __dirname)
* @param {string} tsconfig - specify tsconfig name
* @param {Object} rules - eslint additional rules
* @param {Array} ignorePatterns - eslint ignorePatterns property
* @return {Linter.Config<Linter.RulesRecord>}
*/

module.exports = configure({
mode: 'only-errors',
allowDebug: process.env.NODE_ENV !== 'production',
Expand All @@ -27,13 +16,16 @@ module.exports = configure({
root: './'
}),
presets.react(),
presets.imports({
sort: {
newline: true
}
})
// eslint runs forever because of this preset
// ---
// presets.imports({
// sort: {
// newline: true
// }
// })
],
extend: {
root: true,
ignorePatterns: ["**/*"],
plugins: ['@nx', 'prefer-arrow'],
rules: {
Expand Down
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 2
updates:
- package-ecosystem: "yarn"
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
interval: "monthly"
2 changes: 0 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
/dist
/coverage
2 changes: 1 addition & 1 deletion apps/client/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['preact'],
extends: ['./eslint-test.js'],
extends: ['../../.eslintrc.js'],
ignorePatterns: ['!**/*']
}
21 changes: 10 additions & 11 deletions apps/client/config/defineAliases.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import { resolve } from 'path'
import { AliasOptions, ResolveOptions } from 'vite'

type DefineAliases = ResolveOptions & { alias: AliasOptions }

const resolveLibs = (...args: string[]) =>
resolve(__dirname, '..', '..', '..', 'libs', ...args)

export const defineAliases = (): DefineAliases => {
return {
preserveSymlinks: true,
alias: {
'@code-gear/client-shared': resolve(
__dirname,
resolveLibs('client-shared', 'src', 'index.js')
)
}
preserveSymlinks: true
// Nx and Vite have issues with full support for yarn workspaces,
// so i just will use tsconfig paths ;)

// alias: {
// '@code-gear/client-shared': resolve(
// __dirname,
// resolveLibs('client-shared', 'src', 'index.js')
// )
// }
}
}
4 changes: 2 additions & 2 deletions apps/client/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@client",
"name": "cg-client",
"version": "0.0.1",
"packageManager": "yarn@3.6.0",
"devDependencies": {
"@config": "workspace:^"
"cg-config": "workspace:^"
}
}
5 changes: 3 additions & 2 deletions apps/client/src/app/entrypoint/application.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { RouterProvider } from '../providers/router'
import { StoreProvider } from '../providers/store'
import { ThemeProvider } from '@/app/providers/theme'
import { GlobalStyles } from '@/app/styles'

import { RouterProvider } from '../providers/router'
import { StoreProvider } from '../providers/store'

import 'normalize.css'

const App = () => {
Expand Down
3 changes: 2 additions & 1 deletion apps/client/src/shared/lib/components/page/auth-guard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ import { observer } from 'mobx-react-lite'
import { useLocation, useNavigate } from 'react-router-dom'

import { useStore } from '@/shared/hooks'

import {
PrivatePaths,
RoutePaths,
useAsyncEffect,
useBooleanState,
WithChildren
} from '@code-gear/client-shared'
} from '$/client-shared'

const AuthGuard = observer(({ children }: WithChildren) => {
const { isAuthorized, services } = useStore('auth')
Expand Down
8 changes: 4 additions & 4 deletions apps/client/src/widgets/sign-in-modal/store/auth.services.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import {UserEntity} from '$/common-types'
import {SignInResponse} from '$/common-types'
import {SignInForm} from '$/common-types'
import {AccessToken} from '$/common-types'
import { makeAutoObservable } from 'mobx'

import { AuthStore } from '@/widgets/sign-in-modal'
Expand All @@ -10,6 +6,10 @@ import { getProfileQuery } from '@/widgets/sign-in-modal/graphql/get-profile.que
import { SignInMutation } from '../graphql/sign-in.mutation'

import { ApolloMiddleware, LocalStorageClient } from '$/client-shared'
import { UserEntity } from '$/common-types'
import { SignInResponse } from '$/common-types'
import { SignInForm } from '$/common-types'
import { AccessToken } from '$/common-types'

export class AuthServices {
private state: AuthStore
Expand Down
2 changes: 0 additions & 2 deletions apps/client/src/widgets/sign-in-modal/types.ts

This file was deleted.

1 change: 0 additions & 1 deletion apps/client/src/widgets/sign-in-modal/ui/sign-in-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useNavigate } from 'react-router-dom'

import { SignInModalTemplate } from '@/entities/sign-in-modal-template'
import { useStore } from '@/shared/hooks'

import { WrongPassword } from '@/widgets/sign-in-modal/lib/exceptions'
import { SignInForm } from '@/widgets/sign-in-modal/types'

Expand Down
2 changes: 1 addition & 1 deletion apps/client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@config/tsconfig/base.json",
"extends": "cg-config/tsconfig/base.json",
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
Expand Down
4 changes: 2 additions & 2 deletions apps/server/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@server",
"name": "cg-server",
"version": "1.0.0",
"devDependencies": {
"@config": "workspace:^"
"cg-config": "workspace:^"
}
}
7 changes: 4 additions & 3 deletions apps/server/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
"cwd": "apps/server",
"envFile": ".serve.env"
},
"dependsOn": ["concat-prisma-files"]
"dependsOn": ["prisma:generate","concat-prisma-files"]
},
"migrate:prod": {
"command": "yarn dlx prisma migrate deploy",
"options": {
"cwd": "apps/server",
"envFile": ".build.env"
},
"dependsOn": ["concat-prisma-files"]
"dependsOn": ["prisma:generate","concat-prisma-files"]
},
"generate-prisma-types": {
"command": "yarn dlx @kalissaac/prisma-typegen ./../../libs/nest-common/src/types/_prisma.ts ./prisma/schema.prisma",
Expand All @@ -53,7 +53,8 @@
"tsConfig": "apps/server/tsconfig.app.json",
"assets": ["apps/server/src/assets"],
"isolatedConfig": true,
"webpackConfig": "apps/server/webpack.config.js"
"webpackConfig": "apps/server/webpack.config.js",
"skipTypeCheck": true
},
"configurations": {
"development": {},
Expand Down
2 changes: 1 addition & 1 deletion apps/server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@config/tsconfig/base.json",
"extends": "cg-config/tsconfig/base.json",
"files": [],
"include": [],
"references": [
Expand Down
2 changes: 1 addition & 1 deletion libs/client-shared/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": ["plugin:@nx/react", "../../.eslintrc.js"],
"extends": ["../../.eslintrc.js"],
"ignorePatterns": ["!**/*", "env.d.ts"]
}
4 changes: 2 additions & 2 deletions libs/client-shared/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@client-shared",
"name": "cg-client-shared",
"version": "0.0.1",
"main": "src/index.ts",
"exports": {
Expand All @@ -9,6 +9,6 @@
}
},
"devDependencies": {
"@config": "workspace:^"
"cg-config": "workspace:^"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const usePopoverAnimation = (
({ last, velocity: [, vy], direction: [, dy], offset: [, oy], cancel }) => {
if (oy < -70) cancel()
if (last) {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
oy > height * 0.5 || (vy > 0.5 && dy === 1) ? close(vy) : open()
} else api.start({ y: oy, immediate: dy === -1 })
},
Expand Down
2 changes: 1 addition & 1 deletion libs/client-shared/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
"path": "./tsconfig.spec.json"
}
],
"extends": "@config/tsconfig/base.json"
"extends": "cg-config/tsconfig/base.json"
}
2 changes: 1 addition & 1 deletion libs/config/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "@config",
"name": "cg-config",
"version": "1.0.0"
}
2 changes: 1 addition & 1 deletion libs/config/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@config/tsconfig/base.json",
"extends": "cg-config/tsconfig/base.json",
"compilerOptions": {
"module": "commonjs",
"forceConsistentCasingInFileNames": true,
Expand Down
4 changes: 2 additions & 2 deletions libs/editor/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@editor",
"name": "cg-editor",
"version": "0.0.1",
"main": "./index.js",
"types": "./index.d.ts",
Expand All @@ -10,6 +10,6 @@
}
},
"devDependencies": {
"@config": "workspace:^"
"cg-config": "workspace:^"
}
}
2 changes: 1 addition & 1 deletion libs/editor/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
"path": "./tsconfig.spec.json"
}
],
"extends": "@config/tsconfig/base.json"
"extends": "cg-config/tsconfig/base.json"
}
4 changes: 4 additions & 0 deletions libs/generator/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "cg-generator",
"version": "1.0.0"
}
36 changes: 1 addition & 35 deletions libs/nest-common/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,6 @@
"../../.eslintrc.js"
],
"ignorePatterns": [
"!**/*"
],
"overrides": [
{
"files": [
"*.ts",
"*.tsx",
"*.js",
"*.jsx"
],
"rules": {}
},
{
"files": [
"*.ts",
"*.tsx"
],
"rules": {}
},
{
"files": [
"*.js",
"*.jsx"
],
"rules": {}
},
{
"files": [
"*.json"
],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": "error"
}
}
"!**/*", "package.json", "jest.config.ts"
]
}
2 changes: 1 addition & 1 deletion libs/nest-common/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@nest-common",
"name": "nest-common",
"version": "0.0.1",
"dependencies": {
"tslib": "^2.3.0"
Expand Down
1 change: 1 addition & 0 deletions libs/nest-common/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"{options.outputPath}"
],
"options": {
"skipTypeCheck": true,
"outputPath": "dist/libs/nest-common",
"tsConfig": "libs/nest-common/tsconfig.lib.json",
"packageJson": "libs/nest-common/package.json",
Expand Down
2 changes: 1 addition & 1 deletion libs/nest-common/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@config/tsconfig/base.json",
"extends": "cg-config/tsconfig/base.json",
"compilerOptions": {
"module": "commonjs",
"forceConsistentCasingInFileNames": true,
Expand Down
4 changes: 2 additions & 2 deletions libs/nest-services/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@nest-services",
"name": "nest-services",
"version": "1.0.0",
"main": "./src/index.ts",
"devDependencies": {
"@config": "workspace:^"
"cg-config": "workspace:^"
}
}
2 changes: 1 addition & 1 deletion libs/nest-services/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@config/tsconfig/base.json",
"extends": "cg-config/tsconfig/base.json",
"compilerOptions": {
"module": "commonjs",
"forceConsistentCasingInFileNames": true,
Expand Down
2 changes: 1 addition & 1 deletion libs/nest-services/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@config/tsconfig/base.json",
"extends": "cg-config/tsconfig/base.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"declaration": true,
Expand Down
Loading

1 comment on commit 180e783

@gearonix
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fck yeah body!

Please sign in to comment.