Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore/merge sync template #55

Closed
wants to merge 273 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
273 commits
Select commit Hold shift + click to select a range
f3997c9
feat: add naming conventions rule
0x4007 Nov 25, 2023
805224f
feat: easy ui support
0x4007 Nov 29, 2023
7ffbda1
feat: easy ui support
0x4007 Nov 29, 2023
4880237
fix: prettier for css
0x4007 Nov 29, 2023
885d820
chore: add .env file to .gitignore
0x4007 Nov 29, 2023
937630e
fix: lint staged
0x4007 Dec 7, 2023
9cad989
fix: lint staged
0x4007 Dec 7, 2023
7ff54df
chore: remove tabs
0x4007 Jan 23, 2024
4e8bf2b
feat: reusable deploy script
0x4007 Jan 23, 2024
e674345
feat: ban non null assertions
0x4007 Jan 23, 2024
db2e0e0
Update README.md
0x4007 Jan 23, 2024
53bfa02
feat: spell check on commit
0x4007 Jan 29, 2024
86cb568
feat: copy typescript rules
0x4007 Jan 31, 2024
25e0e26
Merge pull request #11 from ubiquity/feat/typestrict-eslint
0x4007 Jan 31, 2024
b6de893
chore: remove no unnecessary condition for false positives
0x4007 Jan 31, 2024
3e67376
Merge branch 'feat/typestrict-eslint' into development
0x4007 Jan 31, 2024
4026845
fix: forgot to include cspell
0x4007 Feb 2, 2024
8ee208a
fix: cspell ci
0x4007 Feb 2, 2024
48b4419
fix(ci): cspell
0x4007 Feb 2, 2024
49fc65f
chore: remove deprecated
0x4007 Feb 2, 2024
27786d7
feat(cspell): support colors
0x4007 Feb 2, 2024
ea8c924
fix(ci): cspell
0x4007 Feb 2, 2024
821f81e
feat: production deploys
0x4007 Feb 16, 2024
b99831c
chore: set up build for cd
0x4007 Feb 19, 2024
d9bbe47
chore(deps): upgrade all
0x4007 Feb 19, 2024
d3b5d08
chore: test on another brnach
0x4007 Feb 19, 2024
d117e10
chore: bump ci
0x4007 Feb 19, 2024
8b25785
chore: bump ci
0x4007 Feb 19, 2024
3ad759b
chore: bump ci
0x4007 Feb 19, 2024
ad2564c
chore: bump ci
0x4007 Feb 19, 2024
56a8cf8
chore: bump ci
0x4007 Feb 19, 2024
0002fec
chore: bump ci
0x4007 Feb 19, 2024
dc336a9
feat: workflow dispatch
0x4007 Feb 19, 2024
dcca21f
Merge branch 'test/cd'
0x4007 Feb 19, 2024
de20331
chore: debug cd
0x4007 Feb 19, 2024
ea72c5e
chore: debug cd
0x4007 Feb 19, 2024
9a8fc77
chore: debug cd
0x4007 Feb 19, 2024
d61f01e
chore: debug cd
0x4007 Feb 19, 2024
83b6cb6
feat: add knip CI configuration
gitcoindev Feb 19, 2024
dbec9e3
feat: commit or pr
0x4007 Feb 19, 2024
126e819
feat: workflow dispatch
0x4007 Feb 19, 2024
1dcef50
chore: test env vars
0x4007 Feb 19, 2024
b30272d
Squashed commit of the following:
0x4007 Feb 19, 2024
1f80af6
fix: whitespace
0x4007 Feb 19, 2024
83c2e29
fix: transport secrets
0x4007 Feb 19, 2024
059487c
fix: app installation if
0x4007 Feb 19, 2024
9fbac16
feat: cd
0x4007 Feb 19, 2024
6eb4ace
feat: new github env style
0x4007 Feb 19, 2024
0c76a58
chore: update Knip yaml actions
gitcoindev Feb 20, 2024
8674928
Merge pull request #13 from gitcoindev/feature-knip-ci
0x4007 Feb 20, 2024
29e8432
chore: update supabase key name
0x4007 Feb 20, 2024
84b4a91
Merge branch 'development' of https://github.com/ubiquity/ts-template…
0x4007 Feb 20, 2024
f2fea11
fix(ci): on prs
0x4007 Feb 20, 2024
783e786
fix: change dist to static
0x4007 Feb 20, 2024
a8f8df5
Update esbuild-server.ts
0x4007 Feb 20, 2024
16da5f5
Merge branch 'chore/fix-build' into development
0x4007 Feb 21, 2024
4818b15
fix: gitignore
0x4007 Feb 21, 2024
a1e88ed
Merge remote-tracking branch 'origin/chore/fix-build' into development
0x4007 Feb 21, 2024
2393807
fix: commit sha
0x4007 Feb 27, 2024
d7670f4
feat: default Jest testing configuration
gentlementlegen Mar 4, 2024
d787bb6
Update .github/workflows/jest-testing.yml
0x4007 Mar 4, 2024
693b8a9
chore: moved jest config from js to ts
gentlementlegen Mar 4, 2024
d7a1b1a
chore: removed unused check to trigger Jest Action
gentlementlegen Mar 4, 2024
92cad2c
feat: cypress testing suite
gentlementlegen Mar 4, 2024
f0c06fb
feat: default Jest testing configuration (#19)
Mar 4, 2024
92e9e92
Merge remote-tracking branch 'ubi/development' into feat/cypress-defa…
gentlementlegen Mar 5, 2024
c96273b
chore: updated yarn.lock
gentlementlegen Mar 5, 2024
51afec5
chore: removed checks for warn messages in the console
gentlementlegen Mar 5, 2024
438da50
Merge pull request #22 from FernandVEYRIER/feat/cypress-default-conf
0x4007 Mar 5, 2024
419442c
fix: disabled comments on every push, and added default value for cov…
gentlementlegen Mar 6, 2024
860695d
chore: moved knip configuration
gentlementlegen Mar 6, 2024
80a8717
chore: workflow dispatch for knip
gentlementlegen Mar 6, 2024
79c9b1c
chore: workflow dispatch for knip
gentlementlegen Mar 6, 2024
0ac9d65
chore: changed action target to pull_request_target
gentlementlegen Mar 6, 2024
aebfe0e
Merge pull request #24 from FernandVEYRIER/development
0x4007 Mar 6, 2024
6a14695
chore: added test section to README.md
gentlementlegen Mar 6, 2024
03d0506
Merge pull request #26 from FernandVEYRIER/development
0x4007 Mar 6, 2024
93194db
Merge remote-tracking branch 'ubi/development' into fix/permissions
gentlementlegen Mar 6, 2024
85f20d4
ci(cspell): fix
0x4007 Mar 6, 2024
ced64ca
Merge pull request #25 from FernandVEYRIER/fix/permissions
0x4007 Mar 6, 2024
5ee55cb
Create CODEOWNERS
0x4007 Mar 6, 2024
0ba1342
chore: added missing dep
gentlementlegen Mar 8, 2024
9222b71
chore: added ignore rules to knip
gentlementlegen Mar 8, 2024
aaf83b0
chore: removed ts-node dep and changed jest config
gentlementlegen Mar 8, 2024
ffa570d
Merge remote-tracking branch 'ubi/development' into fix/knip
gentlementlegen Mar 8, 2024
7695c37
Merge pull request #29 from FernandVEYRIER/fix/knip
Mar 8, 2024
1b471a2
chore: added ternary rules for eslint
gentlementlegen Mar 8, 2024
a05352e
chore: fixed trailing space in conf
gentlementlegen Mar 8, 2024
f680079
Merge pull request #30 from FernandVEYRIER/feat/eslint-rules
0x4007 Mar 8, 2024
252fbb8
ci: add init workflow
rndquu Mar 10, 2024
52b0b50
Merge pull request #32 from rndquu/ci/add-init-workflow
0x4007 Mar 10, 2024
f667d6e
feat: release please Action
gentlementlegen Mar 12, 2024
f0328de
chore: changed release to target default branch
gentlementlegen Mar 12, 2024
698c4cc
chore: changed release to target default branch
gentlementlegen Mar 12, 2024
b341ccc
chore: added permissions to release please
gentlementlegen Mar 12, 2024
4759d69
chore: removed npm env variable
gentlementlegen Mar 12, 2024
37452f5
Update release-please.yml
0x4007 Mar 12, 2024
9f658e9
Merge pull request #34 from FernandVEYRIER/feat/release
0x4007 Mar 12, 2024
397bf99
Update CODEOWNERS
0x4007 Mar 13, 2024
6235868
ci: pass cloudflare credentials
rndquu Mar 13, 2024
c8ca164
Merge pull request #35 from ubiquity/rndquu-patch-1
rndquu Mar 13, 2024
7ff0ab7
ci: add reusable cloudflare deploy
rndquu Mar 18, 2024
90671ef
ci: use single action
rndquu Mar 18, 2024
84d03ca
Merge pull request #37 from rndquu/ci/add-cf-deploy
rndquu Mar 19, 2024
4fc4cb0
ci: update deploy.yml
rndquu Mar 19, 2024
1e2ac44
chore: add pascal case linter to enforce Erc20Permit and Erc721Permit…
jordan-ae Apr 19, 2024
66e9fe8
chore: enable StrictPascalCase on all Identifiers
jordan-ae Apr 23, 2024
9385bab
chore: undo unnecessary changes
Apr 29, 2024
3d239c8
chore: add eslint-filename plugin
Keyrxng May 2, 2024
850886a
revert camelCase deletions and change to strictCamelCase
May 2, 2024
bad8429
Merge pull request #40 from jordan-ae/PascalCaseLinter
0x4007 May 3, 2024
bf59bee
Merge branch 'development' of https://github.com/ubiquity/ts-template…
Keyrxng May 13, 2024
67e0375
fix: use regex and ignore e2e.ts
Keyrxng May 13, 2024
b92db67
chore: eslint config type inference
Keyrxng May 13, 2024
0f9acf6
Merge pull request #23 from Keyrxng/development
gentlementlegen May 13, 2024
269bd86
chore: update knip configuration in the template to run on pull_request
gitcoindev May 24, 2024
c99c565
Merge pull request #43 from gitcoindev/refactor-knip-to-run-on-pull-r…
rndquu May 27, 2024
b9c377c
fix: moved eslint from js to json and accept numbers in file names
gentlementlegen May 28, 2024
1874bc7
Merge pull request #44 from gentlementlegen/fix/eslint-format
0x4007 May 28, 2024
5dd1302
fix: workflow release please
gentlementlegen Jun 3, 2024
0499dcb
fix: workflow cypress
gentlementlegen Jun 3, 2024
0bf1b43
chore: test reporting lib
gentlementlegen Jun 3, 2024
3f35a2d
Merge pull request #1 from Meniole/development
gentlementlegen Jun 3, 2024
d9acdb0
chore: test reporting lib
gentlementlegen Jun 3, 2024
fd14c9e
chore: test reporting lib
gentlementlegen Jun 3, 2024
d408bc1
Merge pull request #2 from Meniole/development
gentlementlegen Jun 3, 2024
befe97f
chore: test reporting lib
gentlementlegen Jun 3, 2024
4af0e66
Update jest-testing.yml
gentlementlegen Jun 3, 2024
a45d976
chore: find PR number
gentlementlegen Jun 3, 2024
6b9fa4f
chore: remove event
gentlementlegen Jun 3, 2024
a20d25e
Merge branch 'refs/heads/meniole-main' into meniole-development
gentlementlegen Jun 3, 2024
e9cbd15
Merge pull request #3 from Meniole/development
gentlementlegen Jun 3, 2024
dee5235
chore: test pr number
gentlementlegen Jun 3, 2024
b3505f7
chore: test pr number
gentlementlegen Jun 3, 2024
e3d694d
Merge branch 'main' into development
gentlementlegen Jun 3, 2024
ad1d7c4
chore: test pr number
gentlementlegen Jun 3, 2024
eb4cc0d
Merge pull request #4 from Meniole/development
gentlementlegen Jun 3, 2024
e219ea0
chore: test comment
gentlementlegen Jun 3, 2024
fe828f4
chore: test comment
gentlementlegen Jun 3, 2024
62f0d87
Merge pull request #5 from Meniole/development
gentlementlegen Jun 3, 2024
720b091
chore: revert default branch for release-please.yml
gentlementlegen Jun 3, 2024
976252d
Merge branch 'refs/heads/development'
gentlementlegen Jun 3, 2024
16b3090
chore: revert default branch for release-please.yml
gentlementlegen Jun 3, 2024
f19366e
Merge pull request #45 from gentlementlegen/development
gentlementlegen Jun 5, 2024
9def289
chore(development): release 1.0.0
github-actions[bot] Jun 5, 2024
109dfd3
Merge pull request #47 from ubiquity/release-please--branches--develo…
gentlementlegen Jun 5, 2024
b355f3a
ci: run knip reporter on failure
rndquu Jun 19, 2024
0e1cf4d
Merge pull request #49 from rndquu/ci/run-knip-on-fail
gitcoindev Jun 21, 2024
079b1ab
Update README.md
gentlementlegen Jun 21, 2024
51f8dcd
Update README.md
gentlementlegen Jun 21, 2024
2ef2a06
chore: adding untested function
gentlementlegen Jun 21, 2024
1df6e5d
feat: changed tests to yarn with coverage
gentlementlegen Jun 21, 2024
4b48fe0
Merge branch 'main' into development
gentlementlegen Jun 21, 2024
6bc9202
chore: added yarn install
gentlementlegen Jun 21, 2024
8354c0b
Merge remote-tracking branch 'refs/remotes/origin/fix/disable-jest-co…
gentlementlegen Jun 21, 2024
2dd4343
chore: removed untested function
gentlementlegen Jun 21, 2024
cecb44b
chore: test report on action
gentlementlegen Jun 21, 2024
9021467
Merge branch 'refs/heads/fix/disable-jest-comments'
gentlementlegen Jun 22, 2024
9fdf38e
Merge pull request #51 from gentlementlegen/main
0x4007 Jun 24, 2024
3c83a8d
chore: manifest.json
gentlementlegen Jul 11, 2024
9729b15
chore: manifest.json
gentlementlegen Jul 11, 2024
997e61b
Delete CHANGELOG.md
0x4007 Jul 19, 2024
ef2a565
Update README.md
0x4007 Jul 19, 2024
151de15
Merge pull request #53 from ubiquity/0x4007-patch-1
0x4007 Jul 19, 2024
83c9c21
Delete CHANGELOG.md
0x4007 Jul 19, 2024
a952bdd
Update README.md
0x4007 Jul 19, 2024
61aff8a
fix: release-please.yml uses the latest version of the Action
gentlementlegen Aug 18, 2024
c7e78ab
fix: conventional-commits.yml uses the latest version of the Action
gentlementlegen Aug 18, 2024
ed76e95
chore: removed manifest.json and updated README.md
gentlementlegen Aug 18, 2024
c52a413
Merge pull request #55 from gentlementlegen/development
gentlementlegen Aug 18, 2024
0e9b021
feat: add sync.yml which runs every month
zyrafal Aug 20, 2024
a9fde24
feat: create a pull request
zyrafal Aug 21, 2024
4c71cdf
feat: create add-sync-to-repos.yml
zyrafal Aug 21, 2024
5e80ccd
fix: some typos
zyrafal Aug 21, 2024
0a13430
fix: github token
zyrafal Aug 21, 2024
0a23113
fix: disable substitution
zyrafal Aug 21, 2024
7b80b79
fix: git auth
zyrafal Aug 21, 2024
ec92464
fix: uncomment push and pr
zyrafal Aug 21, 2024
547de5f
fix: use sed
zyrafal Aug 21, 2024
426e349
fix: move git config
zyrafal Aug 21, 2024
747d03d
fix: change pr title
zyrafal Aug 21, 2024
9b0e70b
fix: add original_remote variable
zyrafal Aug 21, 2024
3d04254
fix: add debug prints
zyrafal Aug 21, 2024
b006f48
fix: remove push
zyrafal Aug 21, 2024
f5e88a8
fix: typo
zyrafal Aug 21, 2024
42c69b6
fix: copy the file
zyrafal Aug 21, 2024
cf09a00
fix: typo
zyrafal Aug 21, 2024
a969b82
fix: typo
zyrafal Aug 21, 2024
626269f
fix: create a branch in this repository
zyrafal Aug 21, 2024
1d9a0dc
fix: typo
zyrafal Aug 21, 2024
7f261f9
fix: add git config url
zyrafal Aug 21, 2024
edf90e8
fix: try on this repo
zyrafal Aug 21, 2024
ab9d76d
fix: quotes
zyrafal Aug 21, 2024
3174b20
fix: replace repo
zyrafal Aug 21, 2024
63530cc
fix: try forking the repo
zyrafal Aug 21, 2024
fddee05
fix: add write permission to sync.yml
zyrafal Aug 21, 2024
de08e6f
fix: delete add-sync-to-repos.yml
zyrafal Aug 21, 2024
67f39ba
fix: add pull-requests permission to sync.yml
zyrafal Aug 21, 2024
89a8e54
fix: avoid merge conflicts and rename sync.yml to sync-template.yml
zyrafal Aug 30, 2024
b5235dc
Update sync-template.yml
0x4007 Sep 1, 2024
4356e5c
feat: add a list of ignored files
zyrafal Sep 4, 2024
89b942e
feat: auth as the bot
zyrafal Sep 4, 2024
d08a54e
Merge pull request #56 from zyrafal/development
0x4007 Sep 8, 2024
ed02340
Update deploy.yml
0x4007 Sep 30, 2024
949a54c
Merge pull request #59 from ubiquity/0x4007-patch-1
0x4007 Sep 30, 2024
858ab74
Update deploy.yml
0x4007 Oct 1, 2024
499b57b
refactor: esbuild scripts
0x4007 Oct 8, 2024
1d45505
chore: clean up eslintrc
0x4007 Oct 8, 2024
0b97b0e
feat: no empty strings
0x4007 Oct 8, 2024
712aa53
Merge branch 'feat/no-empty-strings' into development
0x4007 Oct 8, 2024
1cff7e2
chore: empty string test
0x4007 Oct 8, 2024
3addf6b
chore: empty string test
0x4007 Oct 8, 2024
d2dc0f9
chore: empty string test
0x4007 Oct 8, 2024
37d8bd4
chore: empty string test
0x4007 Oct 8, 2024
f156cbf
chore: empty string test
0x4007 Oct 8, 2024
3fd4895
chore: empty string test
0x4007 Oct 8, 2024
03d926b
chore: empty string test
0x4007 Oct 8, 2024
2ff231c
chore: empty string test
0x4007 Oct 8, 2024
1a0963a
chore: empty string test
0x4007 Oct 8, 2024
cfee412
chore: empty string test
0x4007 Oct 8, 2024
b03f298
chore: empty string test
0x4007 Oct 8, 2024
c27d5e7
chore: empty string test
0x4007 Oct 8, 2024
6fb7132
chore: empty string test
0x4007 Oct 8, 2024
26e265b
chore: empty string test
0x4007 Oct 8, 2024
2c8fc07
chore: empty string test
0x4007 Oct 8, 2024
c372b6e
chore: empty string test
0x4007 Oct 8, 2024
c8eaf08
chore: empty string test
0x4007 Oct 8, 2024
629f351
chore: empty string test
0x4007 Oct 8, 2024
6f16e90
chore: empty string test
0x4007 Oct 8, 2024
f13fae7
chore: empty string test
0x4007 Oct 8, 2024
9c5da5e
fix: ensure no linkback
0x4007 Oct 8, 2024
5813aef
fix: knip
0x4007 Oct 8, 2024
19b73b2
chore: annotations
0x4007 Oct 8, 2024
57077f6
chore: annotations
0x4007 Oct 8, 2024
b003b80
chore: annotations
0x4007 Oct 8, 2024
61261e4
chore: annotations
0x4007 Oct 8, 2024
7a35f74
Merge branch 'chore/test-empty-string-2' of https://github.com/ubiqui…
0x4007 Oct 8, 2024
a9b93e5
chore: fix empty string checker to correctly count violations
0x4007 Oct 8, 2024
1f2e6d4
chore: fix empty string checker to correctly count violations
0x4007 Oct 8, 2024
bbfb46f
chore: fix empty string checker to correctly count violations
0x4007 Oct 8, 2024
e7149c3
chore: fix empty string checker to correctly count violations
0x4007 Oct 8, 2024
d7312bf
chore: fix empty string checker to correctly count violations
0x4007 Oct 8, 2024
cdc89ca
chore: fix empty string checker to correctly count violations
0x4007 Oct 8, 2024
ea798ab
chore: fix empty string checker to correctly count violations
0x4007 Oct 8, 2024
9e2370b
chore: formatting
0x4007 Oct 8, 2024
e956bec
fix: remove dummy empty strings
0x4007 Oct 9, 2024
0deed0e
Merge pull request #66 from ubiquity/chore/test-empty-string-2
0x4007 Oct 9, 2024
0d070c7
Merge remote-tracking branch 'template/development' into chore/merge-…
0x4007 Oct 10, 2024
b1a84b2
chore: remove unused
0x4007 Oct 10, 2024
f64d220
chore: update configurations and refactor RPC service references
0x4007 Oct 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 22 additions & 127 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,10 @@
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": [
"./tsconfig.json"
]
"project": ["./tsconfig.json"]
},
"plugins": [
"@typescript-eslint",
"sonarjs"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:sonarjs/recommended"
],
"plugins": ["@typescript-eslint", "sonarjs", "filename-rules"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:sonarjs/recommended"],
"ignorePatterns": [
"**/*.js",
"**/*.d.ts",
Expand All @@ -24,35 +15,22 @@
"jest.config.ts",
"knip.ts",
"build",
"./lib",
"./dist"
"./dist",
"lib/**/*"
],
"rules": {
"prefer-arrow-callback": [
"warn",
{
"allowNamedFunctions": true
}
],
"func-style": [
"warn",
"declaration",
{
"allowArrowFunctions": false
}
],
"filename-rules/match": [2, "/^(e2e\\.ts$|.*\\/e2e\\.ts$|[a-z0-9]+(?:[-._a-z0-9]+)*\\.ts|\\.[a-z0-9]+)$/"],
"prefer-arrow-callback": ["warn", { "allowNamedFunctions": true }],
"func-style": ["warn", "declaration", { "allowArrowFunctions": false }],
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-non-null-assertion": "error",
"constructor-super": "error",
"no-invalid-this": "off",
"@typescript-eslint/no-invalid-this": [
"error"
],
"no-restricted-syntax": [
"error",
"ForInStatement"
],
"@typescript-eslint/no-invalid-this": "error",
"no-restricted-syntax": ["error", "ForInStatement"],
"use-isnan": "error",
"no-unneeded-ternary": "error",
"no-nested-ternary": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{
Expand All @@ -74,98 +52,15 @@
"sonarjs/no-identical-expressions": "error",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "interface",
"format": [
"PascalCase"
],
"custom": {
"regex": "^I[A-Z]",
"match": false
}
},
{
"selector": "memberLike",
"modifiers": [
"private"
],
"format": [
"camelCase"
],
"leadingUnderscore": "require"
},
{
"selector": "typeLike",
"format": [
"PascalCase"
]
},
{
"selector": "typeParameter",
"format": [
"PascalCase"
],
"prefix": [
"T"
]
},
{
"selector": "variable",
"format": [
"camelCase",
"UPPER_CASE"
],
"leadingUnderscore": "allow",
"trailingUnderscore": "allow"
},
{
"selector": "variable",
"format": [
"camelCase"
],
"leadingUnderscore": "allow",
"trailingUnderscore": "allow"
},
{
"selector": "variable",
"modifiers": [
"destructured"
],
"format": null
},
{
"selector": "variable",
"types": [
"boolean"
],
"format": [
"PascalCase"
],
"prefix": [
"is",
"should",
"has",
"can",
"did",
"will",
"does"
]
},
{
"selector": "variableLike",
"format": [
"camelCase"
]
},
{
"selector": [
"function",
"variable"
],
"format": [
"camelCase"
]
}
{ "selector": "interface", "format": ["StrictPascalCase"], "custom": { "regex": "^I[A-Z]", "match": false } },
{ "selector": "memberLike", "modifiers": ["private"], "format": ["strictCamelCase"], "leadingUnderscore": "require" },
{ "selector": "typeLike", "format": ["StrictPascalCase"] },
{ "selector": "typeParameter", "format": ["StrictPascalCase"], "prefix": ["T"] },
{ "selector": "variable", "format": ["strictCamelCase", "UPPER_CASE"], "leadingUnderscore": "allow", "trailingUnderscore": "allow" },
{ "selector": "variable", "modifiers": ["destructured"], "format": null },
{ "selector": "variable", "types": ["boolean"], "format": ["StrictPascalCase"], "prefix": ["is", "should", "has", "can", "did", "will", "does"] },
{ "selector": "variableLike", "format": ["strictCamelCase"] },
{ "selector": ["function", "variable"], "format": ["strictCamelCase"] }
]
}
}
}
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

129 changes: 129 additions & 0 deletions .github/empty-string-checker.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
import * as core from "@actions/core";
import { Octokit } from "@octokit/rest";
import simpleGit from "simple-git";

const token = process.env.GITHUB_TOKEN;
const [owner, repo] = process.env.GITHUB_REPOSITORY?.split("/") || [];
const pullNumber = process.env.GITHUB_PR_NUMBER || process.env.PULL_REQUEST_NUMBER || "0";
const baseRef = process.env.GITHUB_BASE_REF;

if (!token || !owner || !repo || pullNumber === "0" || !baseRef) {
core.setFailed("Missing required environment variables.");
process.exit(1);
}

const octokit = new Octokit({ auth: token });
const git = simpleGit();

async function main() {
try {
const { data: pullRequest } = await octokit.pulls.get({
owner,
repo,
pull_number: parseInt(pullNumber, 10),
});

const baseSha = pullRequest.base.sha;
const headSha = pullRequest.head.sha;

await git.fetch(["origin", baseSha, headSha]);

const diff = await git.diff([`${baseSha}...${headSha}`]);

core.info("Checking for empty strings...");
const violations = parseDiffForEmptyStrings(diff);

if (violations.length > 0) {
violations.forEach(({ file, line, content }) => {
core.warning(
"Detected an empty string.\n\nIf this is during variable initialization, consider using a different approach.\nFor more information, visit: https://www.github.com/ubiquity/ts-template/issues/31",
{
file,
startLine: line,
}
);
});

// core.setFailed(`${violations.length} empty string${violations.length > 1 ? "s" : ""} detected in the code.`);

await octokit.rest.checks.create({
owner,
repo,
name: "Empty String Check",
head_sha: headSha,
status: "completed",
conclusion: violations.length > 0 ? "failure" : "success",
output: {
title: "Empty String Check Results",
summary: `Found ${violations.length} violation${violations.length !== 1 ? "s" : ""}`,
annotations: violations.map((v) => ({
path: v.file,
start_line: v.line,
end_line: v.line,
annotation_level: "warning",
message: "Empty string found",
raw_details: v.content,
})),
},
});
} else {
core.info("No empty strings found.");
}
} catch (error) {
core.setFailed(`An error occurred: ${error instanceof Error ? error.message : String(error)}`);
}
}

function parseDiffForEmptyStrings(diff: string) {
const violations: Array<{ file: string; line: number; content: string }> = [];
const diffLines = diff.split("\n");

let currentFile: string;
let headLine = 0;
let inHunk = false;

diffLines.forEach((line) => {
const hunkHeaderMatch = /^@@ -\d+(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(line);
if (hunkHeaderMatch) {
headLine = parseInt(hunkHeaderMatch[1], 10);
inHunk = true;
return;
}

if (line.startsWith("--- a/") || line.startsWith("+++ b/")) {
currentFile = line.slice(6);
inHunk = false;
return;
}

// Only process TypeScript files
if (!currentFile?.endsWith(".ts")) {
return;
}

if (inHunk && line.startsWith("+")) {
// Check for empty strings in TypeScript syntax
if (/^\+.*""/.test(line)) {

Check warning on line 106 in .github/empty-string-checker.ts

View workflow job for this annotation

GitHub Actions / check-for-empty-strings

Detected an empty string. If this is during variable initialization, consider using a different approach. For more information, visit: https://www.github.com/ubiquity/ts-template/issues/31
// Ignore empty strings in comments
if (!line.trim().startsWith("//") && !line.trim().startsWith("*")) {
// Ignore empty strings in template literals
if (!/`[^`]*\$\{[^}]*\}[^`]*`/.test(line)) {
violations.push({
file: currentFile,
line: headLine,
content: line.substring(1).trim(),
});
}
}
}
headLine++;
} else if (!line.startsWith("-")) {
headLine++;
}
});

return violations;
}
main().catch((error) => {
core.setFailed(`Error running empty string check: ${error instanceof Error ? error.message : String(error)}`);
});
13 changes: 13 additions & 0 deletions .github/knip.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { KnipConfig } from "knip";

const config: KnipConfig = {
entry: ["build/index.ts", ".github/empty-string-checker.ts"],
project: ["src/**/*.ts"],
ignore: ["src/types/config.ts", "**/__mocks__/**", "**/__fixtures__/**"],
ignoreExportsUsedInFile: true,
// eslint can also be safely ignored as per the docs: https://knip.dev/guides/handling-issues#eslint--jest
ignoreDependencies: ["eslint-config-prettier", "eslint-plugin-prettier", "@types/jest", "@mswjs/data"],
eslint: true,
};

export default config;
33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build

on:
push:
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-22.04

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20.10.0

- name: Build
run: |
yarn
yarn build

- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: static
path: static
2 changes: 1 addition & 1 deletion .github/workflows/conventional-commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ jobs:
name: Conventional Commits
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ubiquity/action-conventional-commits@master
3 changes: 2 additions & 1 deletion .github/workflows/jest-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: "20.10.0"

- uses: actions/checkout@master
with:
fetch-depth: 0
Expand All @@ -28,7 +29,7 @@ jobs:
version: nightly

- name: Install dependencies
run: yarn install
run: yarn install --immutable --immutable-cache --check-cache

- name: Build
run: yarn build
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/knip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

# needed to use yarn v4
- name: Enable corepack
run: corepack enable

- name: Setup Node
uses: actions/setup-node@v4
with:
Expand Down
Loading
Loading