Skip to content

Commit

Permalink
refactor: configs
Browse files Browse the repository at this point in the history
  • Loading branch information
rharkor committed Mar 26, 2024
1 parent c0a84c4 commit d95c4a0
Show file tree
Hide file tree
Showing 22 changed files with 137 additions and 123 deletions.
1 change: 1 addition & 0 deletions apps/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"cross-env": "^7.0.3",
"crypto-js": "^4.2.0",
"custom-prettier-config": "*",
"dotenv": "^16.4.5",
"eslint-config-custom": "*",
"framer-motion": "^11.0.0",
"ioredis": "^5.3.2",
Expand Down
1 change: 1 addition & 0 deletions apps/cron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@types/node": "^20.11.19",
"chalk": "^5.3.0",
"custom-prettier-config": "*",
"@next-boilerplate/lib": "*",
"dotenv": "^16.4.4",
"eslint-config-custom": "*",
"tsc-alias": "^1.8.8",
Expand Down
2 changes: 1 addition & 1 deletion apps/cron/src/sample/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { exit } from "process"

import { env } from "@/lib/env"
import { prisma } from "@/lib/prisma"
import { logger } from "@lib/logger"
import { logger } from "@next-boilerplate/lib/logger"

const main = async () => {
const maxDurationWarning = 1000 * 60 * 5 // 5 minutes
Expand Down
3 changes: 1 addition & 2 deletions apps/cron/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
"incremental": true,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"],
"@lib/*": ["../../packages/lib/*"]
"@/*": ["./src/*"]
},
"outDir": "dist"
},
Expand Down
9 changes: 4 additions & 5 deletions apps/landing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,24 @@
},
"dependencies": {
"@formatjs/intl-localematcher": "^0.5.0",
"@next-boilerplate/scripts": "*",
"@next/bundle-analyzer": "^14.1.2",
"@t3-oss/env-nextjs": "^0.9.2",
"@total-typescript/ts-reset": "^0.5.0",
"@types/negotiator": "^0.6.3",
"@types/react-dom": "^18.2.7",
"autoprefixer": "^10.4.16",
"clsx": "^2.0.0",
"custom-prettier-config": "*",
"eslint-config-custom": "*",
"negotiator": "^0.6.3",
"next": "^14.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sharp": "^0.33.0",
"tailwind-merge": "^2.0.0",
"zod": "^3.22.4",
"eslint-config-custom": "*",
"tsconfig": "*",
"custom-prettier-config": "*",
"@next-boilerplate/lib": "*",
"@next-boilerplate/scripts": "*"
"zod": "^3.22.4"
},
"devDependencies": {
"@types/node": "^20",
Expand Down
26 changes: 20 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions packages/configs/eslint/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
root: true,
extends: ["prettier"],
}
3 changes: 2 additions & 1 deletion packages/configs/eslint/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = {
"max-params": ["error", 4],
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"no-console": ["error", { allow: ["warn", "error"] }],
},
overrides: [
{
Expand Down Expand Up @@ -42,4 +43,4 @@ module.exports = {
},
},
],
};
}
1 change: 1 addition & 0 deletions packages/configs/eslint/next.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module.exports = {
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"tailwindcss/no-custom-classname": "off",
"no-console": ["error", { allow: ["warn", "error"] }],
},
overrides: [
{
Expand Down
3 changes: 2 additions & 1 deletion packages/configs/eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"version": "0.0.0",
"private": true,
"files": [
"next.js"
"next.js",
"base.js"
],
"dependencies": {
"@typescript-eslint/eslint-plugin": "^7.0.0",
Expand Down
7 changes: 7 additions & 0 deletions packages/configs/eslint/prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
plugins: [],
trailingComma: "es5",
tabWidth: 2,
printWidth: 120,
semi: false,
}
5 changes: 5 additions & 0 deletions packages/configs/prettier/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
root: true,
extends: ["custom/base"],
}
4 changes: 3 additions & 1 deletion packages/configs/prettier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
"next.js",
"base.js"
],
"dependencies": {}
"dependencies": {
"eslint-config-custom": "*"
}
}
7 changes: 7 additions & 0 deletions packages/configs/prettier/prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
plugins: [],
trailingComma: "es5",
tabWidth: 2,
printWidth: 120,
semi: false,
}
5 changes: 5 additions & 0 deletions packages/configs/tsconfig/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
root: true,
extends: ["custom/base"],
}
6 changes: 5 additions & 1 deletion packages/configs/tsconfig/package.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"name": "tsconfig"
"name": "tsconfig",
"dependencies": {
"eslint-config-custom": "*",
"custom-prettier-config": "*"
}
}
1 change: 1 addition & 0 deletions packages/configs/tsconfig/prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("custom-prettier-config/base")
53 changes: 5 additions & 48 deletions packages/lib/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,54 +1,11 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const path = require("path")
const { join } = require("path")

/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ["prettier", "plugin:@typescript-eslint/recommended", "plugin:tailwindcss/recommended"],
parser: "@typescript-eslint/parser",
root: true,
parserOptions: {
project: path.join(__dirname, "/tsconfig.json"),
project: join(__dirname, "/tsconfig.json"),
},
plugins: ["@typescript-eslint", "unused-imports", "simple-import-sort"],
rules: {
"testing-library/prefer-screen-queries": "off",
"unused-imports/no-unused-imports": "error",
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
"tailwindcss/classnames-order": "off",
"max-params": ["error", 4],
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"tailwindcss/no-custom-classname": "off",
},
overrides: [
{
files: ["**/*.js", "**/*.ts", "**/*.tsx"],
rules: {
"simple-import-sort/imports": [
"error",
{
groups: [
["^[a-z]"],
// Packages starting with `@`
["^@"],
// Packages starting with `~`
["^~"],
// Imports starting with `../`
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
// Imports starting with `./`
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
// Style imports
["^.+\\.s?css$"],
// Side effect imports
["^\\u0000"],
],
},
],
},
},
],
extends: ["custom/base"],
}
Loading

0 comments on commit d95c4a0

Please sign in to comment.