Skip to content

Commit

Permalink
fix test eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeny Maximov committed Nov 26, 2023
1 parent 7c855c1 commit 4d7dcce
Show file tree
Hide file tree
Showing 12 changed files with 753 additions and 784 deletions.
12 changes: 11 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ module.exports = {
}
],
rules: {
'@typescript-eslint/no-var-requires': 'off'
'@typescript-eslint/no-var-requires': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_'
}
],
'object-curly-spacing': ['error', 'always']
}
}
2 changes: 1 addition & 1 deletion .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20

- name: Install dependencies
run: |
Expand Down
1 change: 1 addition & 0 deletions apps/backend/src/plugins/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ declare module 'fastify' {
}
}

// eslint-disable-next-line
export default fp<FastifyEnvOptions>(async (server, opts) => {
server.register(fastifyEnv, { schema: ConfigSchema })
})
3 changes: 2 additions & 1 deletion apps/backend/src/plugins/jwt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { User } from '@prisma/client'
import fastifyJwt, { FastifyJWTOptions } from '@fastify/jwt'
import { FastifyReply, FastifyRequest } from 'fastify'

// eslint-disable-next-line
export default fp<FastifyJWTOptions>(async (server, opts) => {
server.register(fastifyJwt, {
secret: server.JWT_SECRET
secret: server.config.JWT_SECRET
})

server.decorate('authenticate', async (request: FastifyRequest, reply: FastifyReply) => {
Expand Down
2 changes: 2 additions & 0 deletions apps/backend/src/plugins/swagger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import fp from 'fastify-plugin'
import fastifySwagger, { SwaggerOptions } from '@fastify/swagger'
import fastifySwaggerUI, { FastifySwaggerUiOptions } from '@fastify/swagger-ui'

// eslint-disable-next-line
export default fp(async (fastify, opts) => {
await fastify.register<SwaggerOptions>(fastifySwagger, {
swagger: {
Expand Down Expand Up @@ -29,6 +30,7 @@ export default fp(async (fastify, opts) => {
},
staticCSP: true,
transformStaticCSP: (header) => header,
// eslint-disable-next-line
transformSpecification: (swaggerObject, request, reply) => {
return swaggerObject
},
Expand Down
2 changes: 2 additions & 0 deletions apps/backend/src/routes/example/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { FastifyPluginAsync } from 'fastify'

// eslint-disable-next-line
const example: FastifyPluginAsync = async (fastify, opts): Promise<void> => {
// eslint-disable-next-line
fastify.get('/', async function (request, reply) {
return 'this is an example'
})
Expand Down
2 changes: 2 additions & 0 deletions apps/backend/src/routes/root.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { FastifyPluginAsync } from 'fastify'

// eslint-disable-next-line
const root: FastifyPluginAsync = async (fastify, opts): Promise<void> => {
// eslint-disable-next-line
fastify.get('/', async function (request, reply) {
const allUsers = await fastify.prisma.user.findMany()

Expand Down
1 change: 1 addition & 0 deletions apps/backend/src/routes/users/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const usersRoute: FastifyPluginAsync = async (server) => {
})

// TEST
// eslint-disable-next-line
server.get('/', { onRequest: server.authenticate }, async (request, reply) => request.user)
}

Expand Down
2 changes: 1 addition & 1 deletion libs/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "",
"main": "index.js",
"scripts": {
"lint": "prettier --check . && eslint .--ext .ts,.svelte"
"lint": "prettier --check . && eslint . --ext .ts,.svelte"
},
"keywords": [],
"author": "",
Expand Down
2 changes: 1 addition & 1 deletion libs/ui/src/components/Icon/Icon.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</script>

<div class="icon" style:--size={`${size}px`}>
{@html iconContent}
{iconContent}
</div>

<style lang="postcss">
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"scripts": {
"frontend:dev": "pnpm --filter @gym-mate/frontend run dev",
"dev": "pnpm --parallel --filter \"@gym-mate/frontend\" --filter \"@gym-mate/backend\" run dev",
"lint": "pnpm --parallel --filter \"@gym-mate/frontend\" --filter \"@gym-mate/backend\" run lint",
"lint:ts": "pnpm --parallel --filter \"@gym-mate/frontend\" --filter \"@gym-mate/backend\" run lint:ts"
"lint": "pnpm recursive run lint",
"lint:ts": "pnpm recursive run lint:ts"
},
"keywords": [],
"author": "",
Expand Down
Loading

0 comments on commit 4d7dcce

Please sign in to comment.