-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: initial commit, setup react project with vite, typescript, tail…
…wind, eslint, prettier, husky
- Loading branch information
0 parents
commit 30ef60d
Showing
54 changed files
with
11,483 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"path": "cz-conventional-changelog" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,207 @@ | ||
{ | ||
"root": true, | ||
"env": { | ||
"browser": true, | ||
"node": true, | ||
"es2021": true | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 2020, | ||
"sourceType": "module", | ||
"ecmaFeatures": { | ||
"jsx": true | ||
}, | ||
"projectService": true, | ||
"tsconfigRootDir": "./", | ||
"project": ["tsconfig.json"] | ||
}, | ||
"plugins": ["react-prefer-function-component"], | ||
"extends": [ | ||
"eslint:all", | ||
"plugin:@typescript-eslint/all", | ||
"plugin:import/recommended", | ||
"plugin:import/typescript", | ||
"plugin:react/all", | ||
"plugin:jsx-a11y/recommended", | ||
"airbnb", | ||
"airbnb-typescript", | ||
"airbnb/hooks", | ||
"plugin:react/jsx-runtime", | ||
"plugin:unicorn/all", | ||
"plugin:react-prefer-function-component/recommended", | ||
"prettier" | ||
], | ||
"rules": { | ||
"import/prefer-default-export": "off", | ||
|
||
"no-dupe-else-if": "error", | ||
"no-promise-executor-return": "error", | ||
"no-unreachable-loop": "error", | ||
"no-useless-backreference": "error", | ||
"require-atomic-updates": "error", | ||
"default-case-last": "error", | ||
"grouped-accessor-pairs": "error", | ||
"no-constructor-return": "error", | ||
"no-implicit-coercion": "error", | ||
"prefer-regex-literals": "error", | ||
"capitalized-comments": "error", | ||
"no-restricted-syntax": [ | ||
"error", | ||
{ | ||
"selector": "ForInStatement", | ||
"message": "for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array." | ||
}, | ||
{ | ||
"selector": "LabeledStatement", | ||
"message": "Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand." | ||
}, | ||
{ | ||
"selector": "WithStatement", | ||
"message": "`with` is disallowed in strict mode because it makes code impossible to predict and optimize." | ||
} | ||
], | ||
"no-void": "off", | ||
|
||
"@typescript-eslint/padding-line-between-statements": "off", | ||
"@typescript-eslint/prefer-enum-initializers": "off", | ||
"@typescript-eslint/prefer-readonly-parameter-types": "off", | ||
"@typescript-eslint/prefer-regexp-exec": "off", | ||
"@typescript-eslint/no-magic-numbers": [ | ||
"error", | ||
{ | ||
"ignoreEnums": true, | ||
"ignore": [0], | ||
"enforceConst": true, | ||
"detectObjects": true | ||
} | ||
], | ||
"@typescript-eslint/explicit-module-boundary-types": "off", | ||
"@typescript-eslint/init-declarations": "off", | ||
"@typescript-eslint/no-confusing-void-expression": [ | ||
"error", | ||
{ "ignoreArrowShorthand": true } | ||
], | ||
"@typescript-eslint/non-nullable-type-assertion-style": "off", | ||
"@typescript-eslint/strict-boolean-expressions": "off", | ||
"@typescript-eslint/no-implicit-any-catch": "off", | ||
"@typescript-eslint/member-ordering": "off", | ||
"@typescript-eslint/prefer-includes": "off", | ||
"@typescript-eslint/no-restricted-imports": "off", | ||
|
||
"import/no-deprecated": "error", | ||
"import/order": "off", | ||
"import/no-extraneous-dependencies": [ | ||
"error", | ||
{ | ||
"devDependencies": [ | ||
"cypress.config.ts", | ||
"vite.config.ts", | ||
"src/setupTests.ts", | ||
"src/testUtils.tsx", | ||
"src/mocks/**", | ||
"**/__tests__/*.{ts,tsx}" | ||
] | ||
} | ||
], | ||
|
||
"react/no-did-update-set-state": "off", | ||
"react/no-find-dom-node": "off", | ||
"react/no-is-mounted": "off", | ||
"react/no-redundant-should-component-update": "off", | ||
"react/no-render-return-value": "off", | ||
"react/no-string-refs": "off", | ||
"react/no-this-in-sfc": "off", | ||
"react/no-will-update-set-state": "off", | ||
"react/prefer-es6-class": "off", | ||
"react/no-unused-state": "off", | ||
"react/prefer-stateless-function": "off", | ||
"react/require-render-return": "off", | ||
"react/sort-comp": "off", | ||
"react/state-in-constructor": "off", | ||
"react/static-property-placement": "off", | ||
|
||
"react/boolean-prop-naming": [ | ||
"error", | ||
{ | ||
"validateNested": true | ||
} | ||
], | ||
"react/function-component-definition": [ | ||
"error", | ||
{ | ||
"namedComponents": "function-declaration" | ||
} | ||
], | ||
"react/no-unstable-nested-components": "error", | ||
"react/jsx-handler-names": [ | ||
"error", | ||
{ | ||
"eventHandlerPrefix": "on", | ||
"eventHandlerPropPrefix": "on", | ||
"checkLocalVariables": true, | ||
"checkInlineFunction": true | ||
} | ||
], | ||
"react/jsx-key": "error", | ||
"react/jsx-no-bind": [ | ||
"error", | ||
{ | ||
"ignoreRefs": false, | ||
"allowArrowFunctions": true, | ||
"allowFunctions": true, | ||
"allowBind": false, | ||
"ignoreDOMComponents": false | ||
} | ||
], | ||
"react/jsx-no-constructed-context-values": "error", | ||
"react/jsx-no-script-url": "error", | ||
"react/jsx-no-useless-fragment": "error", | ||
|
||
"unicorn/filename-case": [ | ||
"error", | ||
{ | ||
"cases": { | ||
"camelCase": true, | ||
"pascalCase": true | ||
} | ||
} | ||
], | ||
"unicorn/no-nested-ternary": ["error"] | ||
}, | ||
"settings": { | ||
"react": { | ||
"version": "detect" | ||
} | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": ["src/**/*.ts?(x)"], | ||
"parserOptions": { | ||
"project": ["./tsconfig.json"] | ||
} | ||
}, | ||
{ | ||
"files": ["vite.config.ts", "cypress.config.ts", "tailwind.config.ts"], | ||
"parserOptions": { | ||
"project": ["./tsconfig.node.json"] | ||
} | ||
}, | ||
{ | ||
"files": ["**/__tests__/**/*.ts?(x)"], | ||
"extends": ["plugin:testing-library/react"], | ||
"rules": { | ||
"@typescript-eslint/no-magic-numbers": ["off"], | ||
"testing-library/no-await-sync-events": [ | ||
"error", | ||
{ | ||
"eventModules": ["fire-event"] | ||
} | ||
], | ||
"testing-library/no-manual-cleanup": "error", | ||
"testing-library/prefer-explicit-assert": "error", | ||
"testing-library/prefer-user-event": "error" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: CodeQL | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
analyze: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
security-events: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: javascript | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
Test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: pnpm/[email protected] | ||
with: | ||
version: latest | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
cache: 'pnpm' | ||
|
||
- name: Install dependencies | ||
run: pnpm i && pnpm cypress install | ||
|
||
- name: Validate | ||
run: pnpm run-p lint test:ci test:e2e:ci | ||
env: | ||
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | ||
|
||
- name: Upload coverage | ||
uses: codecov/codecov-action@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
node_modules | ||
.DS_Store | ||
dist | ||
dist-ssr | ||
*.local | ||
.eslintcache | ||
coverage | ||
.nyc_output | ||
.stylelintcache | ||
cypress/videos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
pnpm lint-staged |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.