-
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.
- Loading branch information
0 parents
commit 28046a7
Showing
27 changed files
with
596 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,22 @@ | ||
|
||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
max_line_length = 80 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
max_line_length = 0 | ||
trim_trailing_whitespace = false | ||
|
||
[*.{js,jsx,ts,tsx}] | ||
charset = utf-8 | ||
|
||
[{package.json}] | ||
indent_style = space | ||
indent_size = 2 |
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,27 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es2021: true, | ||
}, | ||
extends: [ | ||
'airbnb', | ||
'airbnb-typescript', | ||
'airbnb/hooks', | ||
'plugin:react/recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:prettier/recommended', | ||
], | ||
ignorePatterns: ['node_modules/'], | ||
overrides: [], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
project: './tsconfig.json', | ||
}, | ||
plugins: ['react', '@typescript-eslint', 'prettier'], | ||
rules: { | ||
'react/react-in-jsx-scope': 0, | ||
'react-hooks/exhaustive-deps': 'warn', | ||
}, | ||
}; |
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,26 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
# Linter cache files | ||
.eslintcache | ||
.stylelintcache |
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 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npm run lint-staged |
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,6 @@ | ||
{ | ||
"syntax": "postcss-scss", | ||
"plugins": { | ||
"autoprefixer": {} | ||
} | ||
} |
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,6 @@ | ||
.vscode/ | ||
node_modules/ | ||
package-lock.json | ||
package.json | ||
README.md | ||
.eslintignore |
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 @@ | ||
module.exports = { | ||
printWidth: 60, | ||
tabWidth: 2, | ||
useTabs: false, | ||
semi: true, | ||
singleQuote: true, | ||
trailingComma: 'all', | ||
bracketSpacing: true, | ||
arrowParens: 'avoid', | ||
}; |
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,23 @@ | ||
{ | ||
"plugins": ["stylelint-scss"], | ||
"extends": [ | ||
"stylelint-config-standard-scss", | ||
"stylelint-config-prettier-scss" | ||
], | ||
"rules": { | ||
"font-family-name-quotes": null, | ||
"scss/at-rule-no-unknown": [ | ||
true, | ||
{ | ||
"ignoreAtRules": ["layer"] | ||
} | ||
], | ||
"selector-class-pattern": null | ||
}, | ||
"overrides": [ | ||
{ | ||
"customSyntax": "postcss-scss", | ||
"files": ["**/*.scss"] | ||
} | ||
] | ||
} |
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,8 @@ | ||
{ | ||
"recommendations": [ | ||
"esbenp.prettier-vscode", | ||
"dbaeumer.vscode-eslint", | ||
"Syler.sass-indented", | ||
"ZixuanChen.vitest-explorer" | ||
] | ||
} |
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,36 @@ | ||
{ | ||
"editor.quickSuggestions": { | ||
"strings": true | ||
}, | ||
"[javascript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true, | ||
"editor.formatOnPaste": true | ||
}, | ||
"[json]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true, | ||
"editor.formatOnPaste": true | ||
}, | ||
"[jsonc]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true, | ||
"editor.formatOnPaste": true | ||
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true, | ||
"editor.formatOnPaste": true | ||
}, | ||
"[typescriptreact]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true, | ||
"editor.formatOnPaste": true | ||
}, | ||
"[markdown]": { | ||
"editor.wordWrap": "on", | ||
"editor.formatOnSave": true, | ||
"editor.renderWhitespace": "all", | ||
"editor.acceptSuggestionOnEnter": "off" | ||
} | ||
} |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 Gabriel Pereira Woitechen | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,65 @@ | ||
# ⚡ [Reactivite](https://github.com/armanatz/Reactivite) ⚡ | ||
|
||
A minimal starter for React with TypeScript support with out of the box formatting and linting. Utilizes the blazing fast Vite build tool. | ||
|
||
## Features | ||
|
||
- [React](https://reactjs.org) with [TypeScript](https://www.typescriptlang.org) using the [Vite](https://vitejs.dev) build tool. | ||
- Supports [Sass](https://sass-lang.com/) with [automatic type declaration file creation](https://github.com/activeguild/vite-plugin-sass-dts) when using SCSS Modules. | ||
- Utilizes [PostCSS](https://postcss.org/) with the [Autoprefixer](https://github.com/postcss/autoprefixer) plugin to optimize CSS and SCSS code. | ||
- Supports TypeScript [absolute imports](https://github.com/aleclarson/vite-tsconfig-paths). | ||
- Uses [ESLint](https://eslint.org) (with ESLint AirBnB Config), [stylelint](https://stylelint.io) and [Prettier](https://prettier.io) for code linting and formatting. | ||
- Runs pre-commit command using [Husky](https://github.com/typicode/husky) to run [lint-staged](https://github.com/okonet/lint-staged). | ||
- Unit and integration testing using [Vitest](https://vitest.dev/) and [Testing Library](https://testing-library.com/). | ||
- Comes with a light VSCode setting file to enable formatting on save for JSON, JavaScript, TypeScript, TypeScript React, and Markdown files. | ||
- Recommends useful extensions to install when using VSCode as your editor. | ||
|
||
## Getting Started | ||
|
||
Either use this repo as a [GitHub template](https://github.com/armanatz/Reactivite) or use [degit](https://github.com/Rich-Harris/degit) to make a clean copy of this repo: | ||
|
||
``` | ||
npx degit armanatz/Reactivite#master my-app | ||
``` | ||
|
||
After that, navigate to your project folder and install dependencies: | ||
|
||
``` | ||
// If using NPM as your package manager | ||
npm i | ||
// If using Yarn as your package manager | ||
yarn | ||
``` | ||
|
||
Then you can run the local development server using: | ||
|
||
``` | ||
// If using NPM as your package manager | ||
npm run dev | ||
// If using Yarn as your package manager | ||
yarn dev | ||
``` | ||
|
||
To build your application, run: | ||
|
||
``` | ||
// If using NPM as your package manager | ||
npm build | ||
// If using Yarn as your package manager | ||
yarn build | ||
``` | ||
|
||
Build files will be located in the `dist` folder once generated. | ||
|
||
## Available Scripts | ||
|
||
- `format`: Formats all files with Prettier. | ||
- `lint`: Type-checks all files with TypeScript, and then lints all files using ESLint and StyleLint. | ||
- `preview`: Allows for a local preview of the production build of the application. | ||
- `test`: Runs unit and integration tests based on file changes tracked in git using Vitest. | ||
- `test:ci`: Runs all unit and integration tests in CI mode using Vitest. | ||
- `test:watch`: Runs Vitest test runner in watch mode. | ||
- `validate`: Runs all linting commands defined in `lint`, and then runs `test:ci` for testing. |
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,29 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link | ||
rel="icon" | ||
type="image/svg+xml" | ||
href="/favicon.svg" | ||
/> | ||
<meta | ||
name="viewport" | ||
content="width=device-width, initial-scale=1.0" | ||
/> | ||
<meta name="theme-color" content="#000000" /> | ||
<meta | ||
name="description" | ||
content="My App's Description" | ||
/> | ||
<title>My App</title> | ||
</head> | ||
<body> | ||
<noscript | ||
>You need to enable JavaScript to run this | ||
app.</noscript | ||
> | ||
<div id="root"></div> | ||
<script type="module" src="/src/index.tsx"></script> | ||
</body> | ||
</html> |
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,82 @@ | ||
{ | ||
"name": "my-app", | ||
"private": true, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"scripts": { | ||
"build": "tsc && vite build", | ||
"dev": "vite --port 3000 --strictPort --host", | ||
"format": "prettier -uw --cache --ignore-path .gitignore \"./**/*.{js,ts,tsx,json,cjs}\"", | ||
"lint": "run-p run-tsc run-eslint run-stylelint", | ||
"lint-staged": "lint-staged", | ||
"prepare": "husky install", | ||
"preview": "vite preview", | ||
"run-eslint": "eslint --cache --fix --ignore-path .gitignore --ext .js,.cjs,.ts,.tsx .", | ||
"run-stylelint": "stylelint --cache --fix --ignore-path .gitignore **/*.{css,scss}", | ||
"run-tsc": "tsc", | ||
"test": "vitest", | ||
"test:ci": "vitest run", | ||
"test:watch": "vitest watch", | ||
"validate": "run-p lint test:ci" | ||
}, | ||
"dependencies": { | ||
"classnames": "^2.3.2", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0" | ||
}, | ||
"devDependencies": { | ||
"@nabla/vite-plugin-eslint": "^1.4.1", | ||
"@testing-library/jest-dom": "^5.16.5", | ||
"@testing-library/react": "^13.4.0", | ||
"@testing-library/user-event": "^14.4.3", | ||
"@types/react": "^18.0.17", | ||
"@types/react-dom": "^18.0.6", | ||
"@typescript-eslint/eslint-plugin": "^5.38.1", | ||
"@typescript-eslint/parser": "^5.38.1", | ||
"@vitejs/plugin-react": "^2.1.0", | ||
"autoprefixer": "^10.4.12", | ||
"eslint": "^8.24.0", | ||
"eslint-config-airbnb": "^19.0.4", | ||
"eslint-config-airbnb-typescript": "^17.0.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-jsx-a11y": "^6.6.1", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"eslint-plugin-react": "^7.31.8", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"husky": "^8.0.1", | ||
"jsdom": "^20.0.0", | ||
"lint-staged": "^13.0.3", | ||
"npm-run-all": "^4.1.5", | ||
"postcss": "^8.4.16", | ||
"postcss-scss": "^4.0.5", | ||
"postcss-syntax": "^0.36.2", | ||
"prettier": "^2.7.1", | ||
"sass": "^1.55.0", | ||
"stylelint": "^14.13.0", | ||
"stylelint-config-prettier-scss": "^0.0.1", | ||
"stylelint-config-standard-scss": "^5.0.0", | ||
"stylelint-scss": "^4.3.0", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^4.6.4", | ||
"vite": "^3.1.0", | ||
"vite-plugin-sass-dts": "^1.1.42", | ||
"vite-tsconfig-paths": "^3.5.1", | ||
"vitest": "^0.23.4" | ||
}, | ||
"browserslist": { | ||
"production": "Edge >= 18, Firefox >= 60, Chrome >= 61, Safari >= 11, Opera >= 48", | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version" | ||
] | ||
}, | ||
"lint-staged": { | ||
"*": "prettier -uw --cache", | ||
"*.{css,scss}": "stylelint --cache --fix", | ||
"*.{ts,tsx}": [ | ||
"eslint --cache --fix", | ||
"vitest related --run --coverage=false" | ||
] | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.