Skip to content

Addtests #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"env": {
"node": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"ignorePatterns": ["**/dist/*", "**/coverage/*", "node_modules"]
}
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: ci
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm run test -- --coverage

style:
name: Style
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install dependencies
run: npm ci

- name: Run formatting check
run: npm run format:check

- name: Check linting
run: npm run lint -- --max-warnings=0
18 changes: 18 additions & 0 deletions .github/workflows/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "@typescript-eslint/eslint-plugin";
import pluginSecurity from "eslint-plugin-security";

/** @type {import('eslint').Linter.Config} */
export default {
files: ["**/*.{js,mjs,cjs,ts}"],
languageOptions: {
globals: globals.browser,
},
extends: [
pluginJs.configs.recommended,
...tseslint.configs.recommended,
pluginSecurity.configs.recommended,
],
};

3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
![alt text](https://github.com/<OWNER>/<REPOSITORY>/actions/workflows/<WORKFLOW_FILE>/badge.svg)
# learn-cicd-typescript-starter (Notely)

This repo contains the typescript starter code for the "Notely" application for the "Learn CICD" course on [Boot.dev](https://boot.dev).
Expand All @@ -22,3 +23,5 @@ npm run dev
_This starts the server in non-database mode._ It will serve a simple webpage at `http://localhost:8080`.

You do _not_ need to set up a database or any interactivity on the webpage yet. Instructions for that will come later in the course!

Olegoslavavich's version of Boot.dev's Notely app.
1 change: 1 addition & 0 deletions bootdev
Submodule bootdev added at b28394
Empty file added eslint
Empty file.
29 changes: 29 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import js from "@eslint/js";
import ts from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import globals from "globals";

/** @type {import("eslint").Linter.FlatConfig[]} */
export default [
// ✅ JavaScript Recommended Rules
js.configs.recommended,

// ✅ TypeScript Rules (Flat Config)
{
files: ["**/*.{ts,tsx}"],
languageOptions: {
parser: tsParser,
globals: {
...globals.browser,
...globals.node, // 👈 Fix: Adds `process` and other Node.js globals
},
},
plugins: {
"@typescript-eslint": ts,
},
rules: {
...(ts.configs.recommended.rules ?? {}),
},
},
];

Empty file added [email protected]
Empty file.
Loading