Skip to content
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

homework for lection #38 (Online Calendar SPA with Redux using) #15

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules
/dist
/cache
17 changes: 15 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
module.exports = {
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
env: {
browser: true,
es2021: true,
jest: true,
node: true,
},
extends: ["eslint:recommended", "prettier"],
extends: [
"plugin:jest/recommended",
"plugin:@typescript-eslint/recommended",
"eslint:recommended",
"prettier",
],
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
rules: {
indent: ["error", "tab"],
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-unused-vars": 0,
"@typescript-eslint/no-namespace": 0,
"no-import-assign": 0,
"no-unused-vars": 0,
"linebreak-style": ["error", "unix"],
quotes: ["error", "double"],
semi: ["error", "always"],
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Coverage

on: pull_request

jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v2
with:
node-version: 14
- uses: actions/checkout@v2
- uses: artiomtr/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
threshold: 60
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
node_modules
coverage/*
!coverage/badges.svg
dist
.cache
Empty file modified .husky/pre-commit
100755 → 100644
Empty file.
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/node_modules
/dist
/.cache
/.git
/coverage

7 changes: 7 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": [
"stylelint-config-standard-scss",
"stylelint-config-standard",
"stylelint-config-prettier"
]
}
6 changes: 5 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
module.exports = {
presets: [["@babel/preset-env", { targets: { node: "current" } }]],
presets: [
"@babel/preset-typescript",
["@babel/preset-env", { targets: { node: "current" } }],
],
plugins: ["@babel/plugin-transform-runtime"],
};
14 changes: 14 additions & 0 deletions coverage/badges.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
107 changes: 107 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Calendar SPA</title>
</head>
<body>
<section id="mainContainer" class="main-container">
<section
id="#navBar"
class="main-container__navigation-container navigation-container"
>
<hr class="navigation-container__hr" />
<button id="#newBtn" class="navigation-container__nav-button">
New task
</button>
<button id="#listBtn" class="navigation-container__nav-button">
List
</button>
<button id="#aboutBtn" class="navigation-container__nav-button">
About
</button>
<hr class="navigation-container__hr" />
</section>
<section
id="#record"
class="main-container__record-container record-container"
>
<label>Date:</label>
<input
type="text"
id="#datepicker1"
class="record-container__date-field"
/>
<label>ToDo:</label>
<textarea
id="#toDoText"
class="record-container__todo-field"
></textarea>
<label>Tag:</label>
<input type="text" id="#tag" class="record-container__tag-field" />
<div class="record-container__btns-contsiner btns_container">
<label id="#lblClosed" class="btns-container__lbl-closed"
>Closed</label
>
<input
id="#cbxClosed"
type="checkbox"
class="btns-container__cbx-closed"
/>
<button id="#saveBtn" class="btns-container__save-btn">Save</button>
<button id="#delBtn" class="btns-container__del-btn">Delete</button>
</div>
</section>
<section
id="#search"
class="main-container__search-container search-container"
>
<label>Show closed</label>
<input
type="checkbox"
id="#cbxSearchClosed"
class="search-container__cbx-search-closed"
/>
<label>Search:</label>
<input
type="text"
id="#search-field"
class="search-container__search-field"
/>
<label>Date:</label>
<input
type="text"
id="#datepicker2"
class="search-container__date-field"
/>
<div
id="#searchRslt"
class="search-container__search-results search-results-container"
></div>
</section>
<section
id="#about"
class="main-container__about-container about-container"
>
Simple SPA for store your everyday tasks. Let's enjoy %)
</section>
</section>
</body>
<!--MiniSearch CDN API start -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/index.min.js"></script>
<!--MiniSearch CDN API end -->

<!--datePicker CDN API start-->
<script src="https://cdn.jsdelivr.net/npm/pikaday/pikaday.js"></script>
<link
rel="stylesheet"
type="text/css"
href="https://cdn.jsdelivr.net/npm/pikaday/css/pikaday.css"
/>
<!--datePicker CDN API end-->

<script src="src/script/cdn/cdn.js"></script>

<script src="src/script/bundle.ts"></script>
</html>
12 changes: 6 additions & 6 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ module.exports = {
// coverageProvider: "babel",

// A list of reporter names that Jest uses when writing coverage reports
// coverageReporters: [
// "json",
// "text",
// "lcov",
// "clover"
// ],
coverageReporters: ["json", "text", "lcov", "json-summary", "clover"],

// An object that configures minimum threshold enforcement for coverage results
// coverageThreshold: undefined,
Expand Down Expand Up @@ -99,6 +94,8 @@ module.exports = {
// An enum that specifies notification mode. Requires { notify: true }
// notifyMode: "failure-change",

preset: "ts-jest",

// A preset that is used as a base for Jest's configuration
// preset: undefined,

Expand Down Expand Up @@ -174,6 +171,9 @@ module.exports = {

// A map from regular expressions to paths to transformers
// transform: undefined,
transform: {
"^.+\\.jsx?$": "babel-jest",
},

// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
// transformIgnorePatterns: [
Expand Down
Loading