Skip to content

Commit

Permalink
initial-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Olubakinde committed Jun 15, 2024
0 parents commit 17950f2
Show file tree
Hide file tree
Showing 45 changed files with 11,202 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
module.exports = {
env: {
es2022: true,
node: true,
},
extends: ["eslint:recommended"],
root: true,
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
overrides: [
{
files: ["test/**/*"],
env: {
jest: true,
},
},
],
parserOptions: {
project: ["./tsconfig.json"],
},
ignorePatterns: [".eslintrc.js"],
rules: {
// https://stackoverflow.com/questions/57802057/eslint-configuring-no-unused-vars-for-typescript
// Use typescript's checker for unused vars (critical for Enums)
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error"],
// https://typescript-eslint.io/rules/no-use-before-define
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": "error",

// https://typescript-eslint.io/rules/ban-ts-comment
// Disallow @ts-<directive> comments or require descriptions after directives.
"@typescript-eslint/ban-ts-comment": "error",

// https://typescript-eslint.io/rules/no-explicit-any
// Disallow the any type.
//"@typescript-eslint/no-explicit-any": "error",

// https://typescript-eslint.io/rules/no-unsafe-assignment
// Disallow assigning a value with type any to variables and properties.
"@typescript-eslint/no-unsafe-assignment": "error",

// https://typescript-eslint.io/rules/no-unsafe-return
// Disallow returning a value with type any from a function.
"@typescript-eslint/no-unsafe-return": "error",

// https://typescript-eslint.io/rules/ban-types
// Disallow certain types.
"@typescript-eslint/ban-types": [
"error",
{
types: {
unknown: "That is not allowed in this course.",
any: "That is not allowed in this course.",
},
},
],
// https://typescript-eslint.io/rules/no-array-constructor
// Disallow generic Array constructors.
"no-array-constructor": "off",
"@typescript-eslint/no-array-constructor": "error",

// https://typescript-eslint.io/rules/no-base-to-string
// Require .toString() to only be called on objects which provide useful information when stringified.
"@typescript-eslint/no-base-to-string": "error",

// https://typescript-eslint.io/rules/no-confusing-void-expression
// Require expressions of type void to appear in statement position.
"@typescript-eslint/no-confusing-void-expression": "error",

// https://typescript-eslint.io/rules/no-for-in-array
// Disallow iterating over an array with a for-in loop. (Force for-of instead!)
"@typescript-eslint/no-for-in-array": "error",

// https://typescript-eslint.io/rules/no-unnecessary-boolean-literal-compare
// Disallow unnecessary equality comparisons against boolean literals.
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",

// https://typescript-eslint.io/rules/no-unnecessary-condition
// Disallow conditionals where the type is always truthy or always falsy.
"@typescript-eslint/no-unnecessary-condition": "error",
},
};
51 changes: 51 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# .gitattributes snippet to force users to use same line endings for project.
#
# Handle line endings automatically for files detected as text
# and leave all files detected as binary untouched.
* text=auto

#
# The above will handle all files NOT found below
# https://help.github.com/articles/dealing-with-line-endings/
# https://github.com/Danimoth/gitattributes/blob/master/Web.gitattributes



# These files are text and should be normalized (Convert crlf => lf)
*.php text
*.css text
*.js text
*.json text
*.htm text
*.html text
*.xml text
*.txt text
*.ini text
*.inc text
*.pl text
*.rb text
*.py text
*.scm text
*.sql text
.htaccess text
*.sh text
*.svg text

# These files are binary and should be left untouched
# (binary is a macro for -text -diff)
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.mov binary
*.mp4 binary
*.mp3 binary
*.flv binary
*.fla binary
*.swf binary
*.gz binary
*.zip binary
*.7z binary
*.ttf binary
*.pyc binary
78 changes: 78 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy dev build on main push

on:
# Runs on pushes targeting the default branch
push:
branches: [main]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:

# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- id: get-repo-values
run: |
url=https://$(echo "${{github.repository}}" | sed "s/\//.github.io\//")
echo "url=$url" >> $GITHUB_OUTPUT
- name: Update package.json homepage
uses: jossef/action-set-json-field@v1
with:
file: package.json
field: homepage
value: ${{ steps.get-repo-values.outputs.url }}
- name: Install
run: |
npm install
# TODO: Set up linter
- run: npm run lint
- name: Build
run: |
npm run build
- name: Create GitInspector Report
run: |
git clone https://github.com/jpwhite3/gitinspector.git
python ./gitinspector/gitinspector.py ./src/ --grading --format=html -f tsx,ts,html,css -x ./gitinspector > ./dist/report.html
- name: Copy over index.md to docs/
run: |
cp README.md docs/index.md
- name: Generate HTML from Markdown for docs
uses: ldeluigi/markdown-docs@latest
with:
src: docs
dst: dist/docs/
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
# Upload entire repository
path: "dist/"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
node_modules
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"experimentalTernaries": true,
"tabWidth": 4
}
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
25 changes: 25 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}",
"sourceMaps": true,
"sourceMapPathOverrides": {
"meteor://💻app/*": "${workspaceFolder}/*",
"webpack:///./~/*": "${workspaceFolder}/node_modules/*",
"webpack://?:*/*": "${workspaceFolder}/*"
},
"outFiles": [
"${workspaceFolder}/**/*.(m|c|)js",
"!**/node_modules/**"
]
}
]
}
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.formatOnSave": true,
"editor.formatOnPaste": true
}
3 changes: 3 additions & 0 deletions .webez.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"test":"true"
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Habit-tracker Application
Empty file added assets/.keep
Empty file.
Empty file added docs/.keep
Empty file.
6 changes: 6 additions & 0 deletions extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
Loading

0 comments on commit 17950f2

Please sign in to comment.