Skip to content

Commit

Permalink
chore: sync config files
Browse files Browse the repository at this point in the history
  • Loading branch information
unicornware committed Mar 28, 2023
1 parent f54d814 commit 8061fee
Show file tree
Hide file tree
Showing 16 changed files with 125 additions and 320 deletions.
3 changes: 3 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@
"**/.gitconfig",
"**/CHANGELOG.md",
"**/LICENSE.md",
"**/RELEASE_NOTES.md",
".cspell.json",
".dictionary.txt",
".git/",
".husky/_/",
".vscode/settings.json",
".yarn/",
"dist/",
"patches/",
"yarn.lock"
],
Expand Down
2 changes: 0 additions & 2 deletions .dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ larsgw
lcov
lintstagedrc
memfs
micnncim
mkbuild
mlly
nocheck
Expand All @@ -36,7 +35,6 @@ pathe
pkgs
pnpm
preid
syncer
toodles
tribonacci
tscu
Expand Down
4 changes: 3 additions & 1 deletion .env.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# References:
#
# - https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/dotenv
# - https://homebrew-file.readthedocs.io/en/latest/usage.html

[ -f $PWD/.env.local ] && source $PWD/.env.local
[ -f $PWD/.env.repo ] && source $PWD/.env.repo
HOMEBREW_BREWFILE=./Brewfile
NODE_NO_WARNINGS=1
59 changes: 24 additions & 35 deletions .eslintrc.base.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,8 @@ const config = {
BufferEncoding: 'readonly',
Chai: 'readonly',
Console: 'readonly',
GetFormatHook: 'readonly',
GetFormatHookContext: 'readonly',
GetSourceHook: 'readonly',
GetSourceHookContext: 'readonly',
JSX: jsx ? 'readonly' : false,
LoadHook: 'readonly',
LoadHookContext: 'readonly',
LoadHookResult: 'readonly',
LoaderHookFormat: 'readonly',
NodeJS: 'readonly',
ResolveHook: 'readonly',
ResolveHookContext: 'readonly',
ResolveHookResult: 'readonly',
TransformSourceHook: 'readonly',
TransformSourceHookContext: 'readonly'
NodeJS: 'readonly'
},
parser: '@typescript-eslint/parser',
parserOptions: {
Expand Down Expand Up @@ -153,23 +140,15 @@ const config = {
default: {
memberTypes: [
'static-field',
'decorated-field',
'instance-field',
'abstract-field',
'constructor',
'signature',
'static-get',
'static-set',
'static-method',
'decorated-get',
'decorated-set',
'decorated-method',
'instance-get',
'instance-set',
'instance-method',
'abstract-get',
'abstract-set',
'abstract-method'
'instance-method'
],
order: 'alphabetically'
}
Expand Down Expand Up @@ -437,7 +416,13 @@ const config = {
'jsdoc/check-tag-names': [
1,
{
definedTags: ['experimental', 'next', 'visibleName'],
definedTags: [
'experimental',
'maximum',
'minimum',
'next',
'visibleName'
],
jsxTags: false
}
],
Expand Down Expand Up @@ -585,6 +570,7 @@ const config = {
'no-empty': [2, { allowEmptyCatch: true }],
'no-empty-function': 0,
'no-ex-assign': 0,
'no-extra-parens': 0,
'no-implied-eval': 0,
'no-invalid-this': 0,
'no-loop-func': 0,
Expand Down Expand Up @@ -694,7 +680,7 @@ const config = {
],
'unicorn/new-for-builtins': 2,
'unicorn/no-abusive-eslint-disable': 2,
'unicorn/no-array-callback-reference': 2,
'unicorn/no-array-callback-reference': 0,
'unicorn/no-array-for-each': 2,
'unicorn/no-array-method-this-argument': 2,
'unicorn/no-array-push-push': 2,
Expand Down Expand Up @@ -772,14 +758,7 @@ const config = {
'unicorn/relative-url-style': [2, 'never'],
'unicorn/require-array-join-separator': 2,
'unicorn/require-number-to-fixed-digits-argument': 2,
'unicorn/string-content': [
2,
{
patterns: {
'^http:\\/\\/': '^https:\\/\\/'
}
}
],
'unicorn/string-content': [2, { patterns: {} }],
'unicorn/template-indent': [2, { indent: 2 }],
'unicorn/text-encoding-identifier-case': 2,
'unicorn/throw-new-error': 2
Expand Down Expand Up @@ -828,8 +807,9 @@ const config = {
}
},
{
files: '**/__mocks__/*.ts',
files: '**/__mocks__/**/*.ts',
rules: {
'@typescript-eslint/no-unused-vars': 0,
'@typescript-eslint/require-await': 0
}
},
Expand Down Expand Up @@ -892,7 +872,8 @@ const config = {
expectTypeOf: true
},
rules: {
'@typescript-eslint/ban-types': 0
'@typescript-eslint/ban-types': 0,
'@typescript-eslint/no-redundant-type-constituents': 0
}
},
{
Expand Down Expand Up @@ -1189,10 +1170,18 @@ const config = {
name: 'namepath-defining',
required: ['type']
},
maximum: {
name: 'text',
required: ['name']
},
member: {
name: 'namepath-defining',
required: ['name', 'type']
},
minimum: {
name: 'text',
required: ['name']
},
next: {
name: 'namepath-defining',
required: ['type']
Expand Down
2 changes: 1 addition & 1 deletion .github/.gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pou = "!f() { git push origin --no-verify -u $@; }; f"
restart = "!f() { rm -rf .git; echo \"removed .git directory.\"; }; f"

# create new local repo and perform initial commit
setup = "!f() { git init && git config branch.autosetuprebase always && git config core.ignorecase false && git config pull.rebase true && git config rebase.autoStash true && git ac \"initial commit\"; }; f"
setup = "!f() { git init && git config branch.autosetuprebase always && git config core.ignorecase false && git config pull.rebase true && git config rebase.autoStash true && git ac \"chore: initial commit\"; }; f"

# undo last commit
ulc = "!f() { git reset head~1 --soft; }; f"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ yarn-error.log*
# ------------------------------------------------------------------------------
**/.env
**/.env*.local
**/.env.repo

# TypeScript
# ------------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@
#
# - https://typicode.github.io/husky/?id=husky_git_params-ie-commitlint-#/?id=husky_git_params-ie-commitlint-

yarn build
yarn commitlint --edit $1
6 changes: 5 additions & 1 deletion .lintstagedrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@
],
"**/*.{cts,mts,ts}": "vitest typecheck --changed --run",
"**/yarn.lock": "yarn dedupe --check",
"src/**/*.ts": "vitest --changed --coverage --run"
"src/**/*.ts": [
"vitest --changed --coverage --run",
"yarn build",
"yarn check:types:build"
]
}
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
"debug.showBreakpointsInOverviewRuler": true,
"diffEditor.ignoreTrimWhitespace": false,
"diffEditor.renderSideBySide": false,
"dotenv.enableAutocloaking": false,
"editor.acceptSuggestionOnEnter": "smart",
"editor.autoClosingBrackets": "always",
"editor.bracketPairColorization.enabled": true,
Expand Down
38 changes: 22 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,26 @@ Follow the steps below to setup your local development environment:
[ -d $PWD/node_modules/.bin ] && export PATH=$PWD/node_modules/.bin:$PATH

# DOTENV ZSH PLUGIN
# - https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/dotenv
# https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/dotenv
export ZSH_DOTENV_FILE=.env.zsh

# GIT
# https://gist.github.com/troyfontaine/18c9146295168ee9ca2b30c00bd1b41e
export GIT_EMAIL=$(git config user.email)
export GIT_NAME=$(git config user.name)
export GIT_USERNAME=$(git config user.username)
export GPG_TTY=$(tty)

# HOMEBREW
# https://brew.sh
export HOMEBREW_PREFIX=$(brew --prefix)

# NVM
# - https://github.com/nvm-sh/nvm
# https://github.com/nvm-sh/nvm
export NVM_DIR=$HOME/.nvm

# ---------------------------------------------------------------------------

# LOAD ENVIRONMENT VARIABLES IN CURRENT WORKING DIRECTORY
# 1. $GITHUB_WORKSPACE
[ -d $PWD/.git ] && export GITHUB_WORKSPACE=$(git rev-parse --show-toplevel)
# YARN
export YARN_RC_FILENAME=.yarnrc.yml
```

9. Load `dotenv` plugin via `$ZDOTDIR/.zshrc`:
Expand All @@ -93,12 +101,11 @@ Follow the steps below to setup your local development environment:

### Environment Variables

#### Development

| name |
| ----------------------- |
| `CODECOV_TOKEN` |
| `GITHUB_TOKEN` |
| `HOMEBREW_BREWFILE` |
| `NODE_ENV` |
| `NODE_NO_WARNINGS` |
| `PAT_BOT` |
Expand Down Expand Up @@ -162,7 +169,7 @@ This means every commit must conform to the following format:
β”‚ β”‚ β”‚
β”‚ β”‚ └─⫸ optional breaking change flag
β”‚ β”‚
β”‚ └─⫸ see commitlintrc.json
β”‚ └─⫸ see .commitlintrc.cts
β”‚
└─⫸ build|ci|chore|docs|feat|fix|perf|refactor|revert|style|test|wip

Expand Down Expand Up @@ -193,7 +200,7 @@ e.g:
- `build(deps-dev): bump cspell from 6.7.0 to 6.8.0`
- `perf: lighten initial load`

See [`.commitlintrc.json`](.commitlintrc.json) to view all commit guidelines.
See [`.commitlintrc.cts`](.commitlintrc.cts) to view all commit guidelines.

### Code Style

Expand Down Expand Up @@ -232,7 +239,6 @@ Be sure to use [`it.skip`][15] or [`it.todo`][16] where appropriate.

- `yarn test`
- `yarn test:cov`
- See terminal for coverage output

#### Code Coverage

Expand All @@ -242,15 +248,15 @@ To manually upload coverage reports:

1. Retrieve `CODECOV_TOKEN` from a maintainer

2. Add `CODECOV_TOKEN` to `.env.local`
2. Add `CODECOV_TOKEN` to `.env.repo`

3. Reload shell

```sh
exec $SHELL
```

4. Install the [Codecov Uploader][18]
4. Install [Codecov Uploader][18]

5. Run `yarn codecov`

Expand All @@ -265,7 +271,7 @@ Q&A category][19].
This project uses a well-defined list of labels to organize issues and pull requests. Most labels are scoped (i.e:
`status:`).

A list of labels can be found in [`.github/labels.yml`](.github/labels.yml).
A list of labels can be found in [`.github/infrastructure.yml`](.github/infrastructure.yml).

## Opening Issues

Expand Down Expand Up @@ -331,7 +337,7 @@ When squashing, be sure to follow [commit message standards](#commit-messages):
β”‚ β”‚ β”‚
β”‚ β”‚ └─⫸ optional breaking change flag
β”‚ β”‚
β”‚ └─⫸ see .commitlintrc.json
β”‚ └─⫸ see .commitlintrc.cts
β”‚
└─⫸ build|ci|chore|docs|feat|fix|perf|refactor|release|revert|style|test
```
Expand Down
Loading

0 comments on commit 8061fee

Please sign in to comment.