Skip to content

Commit ea0eeaf

Browse files
Bump scaffold (#24)
* Bump scaffold * Fix * Add ESLint * Fix tests * Fix precommit * Add resolve-cwd --------- Co-authored-by: @compulim <@compulim> Co-authored-by: William Wong <compulim@users.noreply.github.com>
1 parent b67878d commit ea0eeaf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+5911
-7455
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM --platform=linux/amd64 mcr.microsoft.com/devcontainers/typescript-node:dev-22-bookworm

.devcontainer/devcontainer.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"build": {
3+
"dockerfile": "Dockerfile"
4+
},
5+
"features": {
6+
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
7+
},
8+
"forwardPorts": [
9+
8000
10+
],
11+
"remoteUser": "node",
12+
"updateContentCommand": "npm clean-install && npm run build"
13+
}

.eslintrc.production.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
extends:
2+
- plugin:import/recommended
3+
plugins:
4+
- import
5+
rules:
6+
import/no-deprecated: error
7+
import/no-empty-named-blocks: error
8+
import/no-extraneous-dependencies: error
9+
import/no-mutable-exports: error
10+
import/no-named-as-default: error
11+
import/no-named-as-default-member: error
12+
import/no-unused-modules: error
13+
import/no-amd: error
14+
import/no-commonjs: error
15+
import/no-absolute-path: error
16+
import/no-cycle: error
17+
import/no-dynamic-require: error
18+
import/no-self-import: error
19+
import/no-useless-path-segments: error
20+
import/no-webpack-loader-syntax: error
21+
import/consistent-type-specifier-style:
22+
- error
23+
- prefer-inline
24+
import/exports-last: error
25+
import/extensions:
26+
- error
27+
- ignorePackages # eslint-plugin-import does not understand named import
28+
import/first: error
29+
import/newline-after-import: error
30+
import/no-anonymous-default-export: error
31+
import/no-duplicates: error
32+
import/no-namespace: error
33+
import/no-unassigned-import:
34+
- error
35+
- allow:
36+
- '**/*.css'
37+
- dotenv/config
38+
settings:
39+
import/resolver:
40+
node:
41+
extensions:
42+
- .cjs
43+
- .mjs
44+
- .js
45+
- .jsx
46+
- .cts
47+
- .mts
48+
- .ts
49+
- .tsx
50+
typescript: true

.eslintrc.react.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extends:
2+
- plugin:react/recommended
3+
- plugin:react-hooks/recommended
4+
plugins:
5+
- react
6+
- react-hooks
7+
rules:
8+
react-hooks/refs: off # We use refs intensively
9+
react-hooks/preserve-manual-memoization: off # Does not know `valibot.parseProps`

.eslintrc.test.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
env:
2+
commonjs: true
3+
es2021: true
4+
es2022: true
5+
jest: true
6+
rules:
7+
# Disable for convenience
8+
react/display-name: off
9+
# Disable for convenience
10+
react/prop-types: off
11+
'@typescript-eslint/no-require-imports': off

.eslintrc.typescript.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
extends:
2+
- plugin:@typescript-eslint/recommended
3+
parser: '@typescript-eslint/parser'
4+
plugins:
5+
- '@typescript-eslint'
6+
rules:
7+
# Shortening if-statement into &&, ||, or ternary operators.
8+
'@typescript-eslint/no-unused-expressions': off
9+
10+
'@typescript-eslint/no-unused-vars':
11+
- error
12+
- argsIgnorePattern: ^_
13+
caughtErrorsIgnorePattern: ^_
14+
destructuredArrayIgnorePattern: ^_
15+
varsIgnorePattern: ^_

.eslintrc.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
extends:
2+
- eslint:recommended
3+
overrides:
4+
- extends: .eslintrc.react.yml
5+
files:
6+
- '**/*.jsx'
7+
- '**/*.tsx'
8+
- extends: .eslintrc.typescript.yml
9+
files:
10+
- '**/*.cts'
11+
- '**/*.mts'
12+
- '**/*.ts'
13+
- '**/*.tsx'
14+
- extends: .eslintrc.test.yml
15+
files:
16+
- '**/__tests__/**'
17+
- '**/*.spec.cjs'
18+
- '**/*.spec.mjs'
19+
- '**/*.spec.js'
20+
- '**/*.spec.jsx'
21+
- '**/*.spec.cts'
22+
- '**/*.spec.mts'
23+
- '**/*.spec.ts'
24+
- '**/*.spec.tsx'
25+
- '**/*.test.cjs'
26+
- '**/*.test.mjs'
27+
- '**/*.test.js'
28+
- '**/*.test.jsx'
29+
- '**/*.test.cts'
30+
- '**/*.test.mts'
31+
- '**/*.test.ts'
32+
- '**/*.test.tsx'
33+
- '**/test/**'
34+
- extends: .eslintrc.production.yml
35+
excludedFiles:
36+
- '**/__tests__/**'
37+
- '**/*.spec.cjs'
38+
- '**/*.spec.mjs'
39+
- '**/*.spec.js'
40+
- '**/*.spec.jsx'
41+
- '**/*.spec.cts'
42+
- '**/*.spec.mts'
43+
- '**/*.spec.ts'
44+
- '**/*.spec.tsx'
45+
- '**/*.test.cjs'
46+
- '**/*.test.mjs'
47+
- '**/*.test.js'
48+
- '**/*.test.jsx'
49+
- '**/*.test.cts'
50+
- '**/*.test.mts'
51+
- '**/*.test.ts'
52+
- '**/*.test.tsx'
53+
- '**/test/**'
54+
files:
55+
- '**/*.cjs'
56+
- '**/*.mjs'
57+
- '**/*.js'
58+
- '**/*.jsx'
59+
- '**/*.cts'
60+
- '**/*.mts'
61+
- '**/*.ts'
62+
- '**/*.tsx'
63+
parserOptions:
64+
ecmaVersion: latest
65+
sourceType: module
66+
plugins:
67+
- prettier
68+
root: true
69+
rules:
70+
prettier/prettier: error
71+
no-empty:
72+
- error
73+
- allowEmptyCatch: true

.github/pull_request_template.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## Changelog
2+
3+
> Please copy and paste new entries from `CHANGELOG.md` here.
4+
5+
## Specific changes
6+
7+
> Please list each individual specific change in this pull request.
8+
9+
-
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: 🧼 Bump dependencies
2+
3+
on:
4+
workflow_dispatch: {}
5+
6+
jobs:
7+
call-workflow:
8+
permissions:
9+
contents: write
10+
id-token: write
11+
secrets:
12+
WORKFLOW_BOT_APP_ID: ${{ secrets.WORKFLOW_BOT_APP_ID }}
13+
WORKFLOW_BOT_PRIVATE_KEY: ${{ secrets.WORKFLOW_BOT_PRIVATE_KEY }}
14+
uses: compulim/workflows/.github/workflows/bump-dependencies.yml@main
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Continuous deployment
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths-ignore:
7+
- '.devcontainer/**'
8+
- '.github/**'
9+
workflow_dispatch: {}
10+
11+
jobs:
12+
call-workflow:
13+
permissions:
14+
attestations: write
15+
contents: write
16+
id-token: write
17+
pages: write
18+
secrets:
19+
WORKFLOW_BOT_APP_ID: ${{ secrets.WORKFLOW_BOT_APP_ID }}
20+
WORKFLOW_BOT_PRIVATE_KEY: ${{ secrets.WORKFLOW_BOT_PRIVATE_KEY }}
21+
uses: compulim/workflows/.github/workflows/continuous-deployment-oidc.yml@main
22+
with:
23+
package-name: 'has-resolved'

0 commit comments

Comments
 (0)