Skip to content

Commit

Permalink
chore: 🎉 initialize repo
Browse files Browse the repository at this point in the history
  • Loading branch information
BroKun committed Oct 17, 2023
0 parents commit 001e3c7
Show file tree
Hide file tree
Showing 584 changed files with 55,143 additions and 0 deletions.
1 change: 1 addition & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length=88

[Makefile]
indent_style = tab
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
!.dumi
.dumi/tmp
.dumi/tmp-production

**/dist/**/*.js
**/dist/**/*.cjs
**/dist/**/*.mjs
97 changes: 97 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:promise/recommended',
'prettier',
],
plugins: ['import'],

env: {
node: true,
},
settings: {
react: {
version: '18',
},
},

rules: {
// common pitfalls
eqeqeq: 'error',
curly: 'error',

// stricter type correctness
'no-unused-vars': [
'warn',
{
vars: 'local',
args: 'none',
destructuredArrayIgnorePattern: '^_',
ignoreRestSiblings: true,
argsIgnorePattern: '^_',
caughtErrors: 'none',
},
],
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-explicit-any': ['warn', { ignoreRestArgs: true }],
'@typescript-eslint/no-shadow': [
'warn',
{
ignoreTypeValueShadow: true,
},
],

// react rules
'react-hooks/exhaustive-deps': 'error',
'react-hooks/rules-of-hooks': 'error',
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',

// no sloppiness
'no-console': ['error', { allow: ['error', 'warn', 'info'] }],

// import rules and fixes
'@typescript-eslint/consistent-type-imports': 'error',
'import/newline-after-import': 'warn',
'import/order': [
'warn',
{
pathGroups: [
{
pattern: '@/**',
group: 'internal',
position: 'before',
},
],
distinctGroup: false,
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
'object',
],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
},

overrides: [
{
files: ['*.js', '*.cjs', '*.mjs', '*.jsx'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
},
],
};
7 changes: 7 additions & 0 deletions .eslintrc.node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
root: true,
extends: [require.resolve('./.eslintrc.js')],
rules: {
'no-console': 'off',
},
};
46 changes: 46 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Fix end-of-lines in Git versions older than 2.10
# https://github.com/git/git/blob/master/Documentation/RelNotes/2.10.0.txt#L248 # https://github.com/git/git/blob/master/Documentation/RelNotes/2.10.0.txt#L248
* text=auto eol=lf

# ===
# Binary Files (don't diff, don't fix line endings)
# ===

# Images
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.tiff binary

# Fonts
*.oft binary
*.ttf binary
*.eot binary
*.woff binary
*.woff2 binary

# Videos
*.mov binary
*.mp4 binary
*.webm binary
*.ogg binary
*.mpg binary
*.3gp binary
*.avi binary
*.wmv binary
*.flv binary
*.asf binary

# Audio
*.mp3 binary
*.wav binary
*.flac binary

# Compressed
*.gz binary
*.zip binary
*.7z binary
*.tar.gz binary
*.tgz binary
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: 'Code: CI'

on:
pull_request:
types:
- opened
- edited
- reopened
- synchronize
push:
branches:
- main

jobs:
ci:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: ['16.20.x']
python-version: ['3.8.16', '3.9.x', '3.10.x']

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: nrwl/nx-set-shas@v3
with:
main-branch-name: 'main'

- name: Use PNPM
uses: pnpm/action-setup@v2
with:
version: ^8.6.0
run_install: false

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Cache Nx output
uses: actions/cache@v3
with:
path: node_modules/.cache/nx
key: |
cache-nx
-${{ runner.os }}
-${{ matrix.node-version }}
-${{ github.ref }}
- name: Setup projects
run: pnpm bootstrap

- name: Run linters and tests
run: pnpm run ci:affected
Loading

0 comments on commit 001e3c7

Please sign in to comment.