Skip to content

Commit

Permalink
Add lint ci/cd, fix lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
s1owjke committed Nov 26, 2024
1 parent a5d0f36 commit 4dee741
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@ jobs:
- name: Install dependencies
run: yarn --frozen-lockfile

- name: Run lint
run: yarn lint

- name: Check types
run: yarn typecheck
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"javascript": {
"formatter": {
"quoteStyle": "double",
"trailingComma": "all",
"trailingCommas": "all",
"semicolons": "always"
}
}
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
"scripts": {
"build": "rm -rf dist && tsc",
"build:watch": "rm -rf dist && tsc --watch",
"lint": "yarn biome check",
"lint:fix": "yarn biome check --write",
"typecheck": "tsc --noEmit",
"test": "jest"
},
Expand Down
2 changes: 1 addition & 1 deletion tests/create.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { resolveDb, executeAndRollback } from "./utils";
import { executeAndRollback, resolveDb } from "./utils";

describe("model creating", () => {
describe("create", () => {
Expand Down
3 changes: 2 additions & 1 deletion tests/delete.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { executeAndRollback, resolveDb } from "./utils";
import { PrismaClientKnownRequestError } from "@prisma/client/runtime/library";

import { executeAndRollback, resolveDb } from "./utils";

describe("model deletion", () => {
describe("delete", () => {
test("if delete is denied it throw an error", async () => {
Expand Down
3 changes: 2 additions & 1 deletion tests/read.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { resolveDb } from "./utils";
import { PrismaClientKnownRequestError } from "@prisma/client/runtime/library";

import { resolveDb } from "./utils";

describe("model reading", () => {
describe("find unique", () => {
test("if read is denied it return null", async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PrismaTypeMap, PrismaModelName, ModelPermissionsConfig } from "../src/types";
import { ModelPermissionsConfig, PrismaModelName, PrismaTypeMap } from "../src/types";

export type PartialPermissionsConfig<TypeMap extends PrismaTypeMap, Context extends unknown> = Partial<{
[ModelName in PrismaModelName<TypeMap>]: Partial<ModelPermissionsConfig<TypeMap, ModelName, Context>>;
Expand Down
1 change: 1 addition & 0 deletions tests/update.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { PrismaClientKnownRequestError } from "@prisma/client/runtime/library";

import { executeAndRollback, resolveDb } from "./utils";

describe("model updating", () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Prisma, PrismaClient } from "@prisma/client";
import { ITXClientDenyList } from "@prisma/client/runtime/library";

import { createRlsExtension, PermissionsConfig } from "../src";
import { PermissionsConfig, createRlsExtension } from "../src";

import { denyPermissions } from "./consts";
import { PartialPermissionsConfig } from "./types";
Expand Down

0 comments on commit 4dee741

Please sign in to comment.