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 Apr 10, 2023
1 parent 89711c5 commit 4cdfca8
Show file tree
Hide file tree
Showing 37 changed files with 870 additions and 735 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
5 changes: 1 addition & 4 deletions .dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ bdougie
bstract
cefc
commitlintrc
dawidd
dedupe
dessant
docast
Expand All @@ -18,17 +17,15 @@ keyid
larsgw
lcov
lintstagedrc
micnncim
mkbuild
mlly
nocheck
npmrc
nvmrc
pathe
pkgs
pnpm
preid
syncer
tscu
unist
unstub
vates
Expand Down
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ max_line_length = 100
[*.snap]
max_line_length = 130

# xml
[*.xml]
max_line_length = 100

# yaml
[*.yml]
max_line_length = 100
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
70 changes: 39 additions & 31 deletions .eslintrc.base.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,12 @@ const config = {
Chai: 'readonly',
Console: 'readonly',
JSX: jsx ? 'readonly' : false,
LoadHook: 'readonly',
LoadHookContext: 'readonly',
LoadHookResult: 'readonly',
LoaderHookFormat: 'readonly',
NodeJS: 'readonly',
ResolveHook: 'readonly',
ResolveHookContext: 'readonly',
ResolveHookResult: 'readonly'
NodeJS: 'readonly'
},
parser: '@typescript-eslint/parser',
parserOptions: {
extraFileExtensions: [],
project: ['./tsconfig.json', 'tsconfig.cjs.json'],
project: ['./tsconfig.json', './tsconfig.cjs.json'],
sourceType: require('./package.json').type,
tsconfigRootDir: process.cwd(),
warnOnUnsupportedTypeScriptVersion: true
Expand Down Expand Up @@ -147,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 @@ -431,7 +416,14 @@ const config = {
'jsdoc/check-tag-names': [
1,
{
definedTags: ['experimental', 'next', 'visibleName'],
definedTags: [
'experimental',
'maximum',
'minimum',
'next',
'packageManager',
'visibleName'
],
jsxTags: false
}
],
Expand Down Expand Up @@ -579,6 +571,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 @@ -688,7 +681,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 @@ -766,14 +759,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 @@ -822,8 +808,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 @@ -853,6 +840,7 @@ const config = {
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/no-unused-expressions': 0,
'@typescript-eslint/prefer-ts-expect-error': 0,
'@typescript-eslint/require-await': 0,
'@typescript-eslint/restrict-template-expressions': 0,
'@typescript-eslint/unbound-method': 0,
'chai-expect/missing-assertion': 2,
Expand Down Expand Up @@ -1141,13 +1129,17 @@ const config = {
}
},
{
files: ['.github/dependabot.yml', '.github/workflows/*.yml'],
files: [
'.github/dependabot.yml',
'.github/workflows/*.yml',
'action.yml'
],
rules: {
'yml/sort-keys': 0
}
},
{
files: ['.github/workflows/no-response-handler.yml', '.yarnrc.yml'],
files: ['.github/workflows/*.yml', '.yarnrc.yml'],
rules: {
'yml/key-name-casing': 0
}
Expand All @@ -1161,9 +1153,13 @@ const config = {
settings: {
jsdoc: {
augmentsExtendsReplacesDocs: true,
ignoreInternal: false,
ignorePrivate: false,
implementsReplacesDocs: true,
overrideReplacesDocs: true,
preferredTypes: {
'*': false
},
structuredTags: {
const: {
name: 'namepath-defining',
Expand All @@ -1184,14 +1180,26 @@ 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']
},
packageManager: {
name: 'text',
required: ['name']
},
param: {
name: 'namepath-defining',
required: ['name', '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
8 changes: 6 additions & 2 deletions .github/workflows/add-to-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
#
# References:
#
# - https://docs.github.com/actions/learn-github-actions/contexts
# - https://docs.github.com/actions/learn-github-actions/expressions
# - https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#issues
# - https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#pull_request
# - https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#issues
# - https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request
# - https://github.com/actions/add-to-project

---
Expand All @@ -22,8 +26,8 @@ jobs:
add-to-project:
runs-on: ubuntu-latest
steps:
- id: add
name: Add ${{ format('#{0}', github.event.number || github.event.issue.number) }} to project
- id: add-item
name: Add ${{ format('#{0}', github.event.number) }} to project
uses: actions/[email protected]
with:
github-token: ${{ secrets.PAT_REPO }}
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/approve-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
# Automatically approve a pull request when a review is requested from @flexdevelopment by certain
# users.
#
#
# References:
#
# - https://cli.github.com/manual/gh_pr_review
# - https://docs.github.com/actions/learn-github-actions/contexts
# - https://docs.github.com/actions/learn-github-actions/expressions
# - https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#pull_request
# - https://docs.github.com/actions/using-workflows/using-github-cli-in-workflows
# - https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions
# - https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request
# - https://github.com/actions/checkout
# - https://github.com/dependabot/fetch-metadata
# - https://github.com/hmarr/debug-action
Expand Down Expand Up @@ -40,11 +43,14 @@ jobs:
with:
persist-credentials: false
ref: ${{ github.head_ref }}
- id: requested-reviewers
name: Get requested reviewers
run: |
echo "result=${{ join(github.event.pull_request.requested_reviewers.*.login, ',') }}" >>$GITHUB_OUTPUT
- id: approve
name: Approve pull request
if: |
(github.event.requested_reviewer.login == 'flexdevelopment'
|| contains(join(github.event.requested_reviewers.*.login, ','), 'flexdevelopment'))
contains(steps.requested-reviewers.outputs.result, 'flexdevelopment')
&& (github.actor == 'dependabot[bot]' || github.actor == 'unicornware')
&& steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major'
run: gh pr review ${{ github.event.pull_request.number }} --approve --body 'lgtm 👍🏾'
run: gh pr review ${{ github.event.number }} --approve --body 'lgtm 👍🏾'
11 changes: 7 additions & 4 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
# References:
#
# - https://cli.github.com/manual/gh_pr_merge
# - https://docs.github.com/actions/learn-github-actions/contexts
# - https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#pull_request
# - https://docs.github.com/actions/using-workflows/using-github-cli-in-workflows
# - https://docs.github.com/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-auto-merge-for-pull-requests-in-your-repository
# - https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request
# - https://github.com/actions/checkout
Expand All @@ -18,6 +20,8 @@ on:
types:
- opened
- synchronize
env:
GITHUB_TOKEN: ${{ secrets.PAT_REPO }}
jobs:
auto-merge:
if: github.event.pull_request.auto_merge == null && github.event.pull_request.draft == false
Expand All @@ -30,9 +34,8 @@ jobs:
name: Checkout ${{ github.head_ref }}
uses: actions/[email protected]
with:
persist-credentials: false
ref: ${{ github.head_ref }}
- id: auto-merge
- id: enable
name: Enable auto-merge
run: gh pr merge ${{ github.event.pull_request.number }} --auto --squash
env:
GITHUB_TOKEN: ${{ secrets.PAT_REPO }}
run: gh pr merge ${{ github.event.number }} --auto --squash
Loading

0 comments on commit 4cdfca8

Please sign in to comment.