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

add homework to git, all worked, tests written #1

Open
wants to merge 8 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
29 changes: 29 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"env": {
"browser": true,
"es6": true,
"jest": true
},
"extends": [
"plugin:react/recommended",
"standard"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"react",
"@typescript-eslint"
],
"rules": {
}
}
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,29 @@
# react-otus-homework
# react-otus-homework

Для домашнего задания использован репозиторий
https://github.com/nickovchinnikov/react-js-tutorial/pull/3
код из папки src/lesson2


Добавлена поддержка математических операторов:

возведение в квадрат **
возведение в степень ^
факториал !

Добавлена обработка скобок, в том числе вложенных
пример: (((20 - 6!)**)/2+45^3)*12- (2^3)!

Добавлена обработка текста без пробелов, формулы можно вводить прямым текстом
Добавлены тесты

Установка зависимостей:
npm i
Запуск тестов
npm t
Запуск программы
npm run calc
Сборка
npm run-script build


18 changes: 18 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"presets": [
[
"@babel/env",
{
"targets": {
"edge": "17",
"firefox": "60",
"chrome": "67",
"safari": "11.1"
},
"useBuiltIns": "usage",
"corejs": "3.6.5"
}
],
"@babel/preset-typescript"
]
}
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"use strict";
//# sourceMappingURL=index.js.map
'use strict'
// # sourceMappingURL=index.js.map
10 changes: 5 additions & 5 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

module.exports = {
clearMocks: true,
coverageDirectory: "coverage",
testEnvironment: "node",
coverageDirectory: 'coverage',
testEnvironment: 'node',
transform: {
"^.+\\.(js|jsx|ts|tsx)$": "<rootDir>/node_modules/babel-jest",
},
};
'^.+\\.(js|jsx|ts|tsx)$': '<rootDir>/node_modules/babel-jest'
}
}
Loading