Skip to content

Commit

Permalink
rework project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperchupuDev committed Mar 7, 2024
1 parent d63480b commit 50fa990
Show file tree
Hide file tree
Showing 32 changed files with 2,921 additions and 3,893 deletions.
23 changes: 8 additions & 15 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,55 +6,48 @@
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"next"
"next",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2022,
"ecmaVersion": 2023,
"sourceType": "module",
"project": ["./tsconfig.json"]
"project": true
},
"plugins": ["@typescript-eslint"],
"ignorePatterns": ["node_modules", ".next", "out"],
"rules": {
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-base-to-string": "off",
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/prefer-nullish-coalescing": ["error", { "ignorePrimitives": { "boolean": true } }],
"@typescript-eslint/restrict-template-expressions": "off",
"curly": "error",
"default-case-last": "error",
"dot-notation": "error",
"eqeqeq": "error",
"line-comment-position": ["error", { "position": "above" }],
"lines-around-comment": "error",
"no-alert": "error",
"no-confusing-arrow": "error",
"no-duplicate-imports": ["error", { "includeExports": true }],
"no-else-return": ["error", { "allowElseIf": false }],
"no-empty-function": "error",
"no-extra-label": "error",
"no-floating-decimal": "error",
"no-implicit-coercion": "error",
"no-implied-eval": "error",
"no-labels": "error",
"no-lone-blocks": "error",
"no-loss-of-precision": "error",
"no-multi-assign": "error",
"no-multi-str": "error",
"no-negated-condition": "error",
"no-nested-ternary": "error",
"no-new-wrappers": "error",
"no-octal-escape": "error",
"no-return-await": "error",
"no-sequences": ["error", { "allowInParentheses": false }],
"no-shadow": "off",
"no-template-curly-in-string": "error",
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-unneeded-ternary": "error",
"no-unreachable-loop": "error",
"no-unsafe-optional-chaining": ["error", { "disallowArithmeticOperators": true }],
"no-useless-backreference": "error",
"no-useless-call": "error",
"no-useless-computed-key": "error",
"no-useless-concat": "error",
Expand Down
60 changes: 30 additions & 30 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,59 +5,59 @@ on:
pull_request:
branches: [master]
jobs:
lint:
name: ESLint
biome:
name: Biome
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Node v18
uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
uses: actions/checkout@v4

- name: Install dependencies
run: npm ci
- name: Setup Biome
uses: biomejs/setup-biome@v2

- name: Run ESLint
run: npm run lint
- name: Run Biome
run: biome ci .

prettier:
name: Prettier
lint:
name: ESLint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v3

- name: Install Node v18
uses: actions/setup-node@v3
- name: Install Node 20
uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
node-version: 20
cache: 'pnpm'

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Run Prettier
run: npm run check
- name: Run ESLint
run: pnpm run lint

typescript:
name: TypeScript
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v3

- name: Install Node v18
uses: actions/setup-node@v3
- name: Install Node 20
uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
node-version: 20
cache: 'pnpm'

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Run TypeScript compiler
run: npm run typecheck
run: pnpm run typecheck
23 changes: 17 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,32 @@
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/.next
/out
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
9 changes: 0 additions & 9 deletions .prettierrc.json

This file was deleted.

10 changes: 6 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": false
"source.fixAll": "explicit",
"source.organizeImports.biome": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"files.eol": "\n",
"files.insertFinalNewline": true,
"typescript.tsdk": "node_modules\\typescript\\lib"
"npm.packageManager": "pnpm",
"typescript.tsdk": "node_modules/typescript/lib"
}
28 changes: 28 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"defaultBranch": "main",
"useIgnoreFile": true
},
"formatter": {
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 120
},
"javascript": {
"formatter": {
"arrowParentheses": "asNeeded",
"quoteStyle": "single",
"semicolons": "always",
"trailingComma": "none"
}
},
"linter": {
"enabled": false
},
"organizeImports": {
"enabled": true
}
}
Loading

0 comments on commit 50fa990

Please sign in to comment.