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

Fix eslint issue #1

Merged
merged 4 commits into from
Aug 22, 2023
Merged
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
6 changes: 6 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": [
"@babel/preset-react"
],
"plugins": ["@babel/plugin-syntax-jsx"]
}
35 changes: 35 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"env": {
"browser": true,
"es6": true,
"jest": true
},
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"extends": ["airbnb", "plugin:react/recommended", "plugin:react-hooks/recommended"],
"plugins": ["react"],
"rules": {
"react/jsx-filename-extension": ["warn", { "extensions": [".js", ".jsx"] }],
"react/react-in-jsx-scope": "off",
"import/no-unresolved": "off",
"no-shadow": "off"
},
"overrides": [
{
// feel free to replace with your preferred file pattern - eg. 'src/**/*Slice.js' or 'redux/**/*Slice.js'
"files": ["src/**/*Slice.js"],
// avoid state param assignment
"rules": { "no-param-reassign": ["error", { "props": false }] }
}
],
"ignorePatterns": [
"dist/",
"build/"
]
}
45 changes: 45 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Linters

on: pull_request

env:
FORCE_COLOR: 1

jobs:
eslint:
name: ESLint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.x"
- name: Setup ESLint
run: |
npm install --save-dev eslint@7.x eslint-config-airbnb@18.x eslint-plugin-import@2.x eslint-plugin-jsx-a11y@6.x eslint-plugin-react@7.x eslint-plugin-react-hooks@4.x @babel/eslint-parser@7.x @babel/core@7.x @babel/plugin-syntax-jsx@7.x @babel/preset-env@7.x @babel/preset-react@7.x
[ -f .eslintrc.json ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/react-redux/.eslintrc.json
[ -f .babelrc ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/react-redux/.babelrc
- name: ESLint Report
run: npx eslint "**/*.{js,jsx}"
stylelint:
name: Stylelint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.x"
- name: Setup Stylelint
run: |
npm install --save-dev stylelint@13.x stylelint-scss@3.x stylelint-config-standard@21.x stylelint-csstree-validator@1.x
[ -f .stylelintrc.json ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/react-redux/.stylelintrc.json
- name: Stylelint Report
run: npx stylelint "**/*.{css,scss}"
nodechecker:
name: node_modules checker
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Check node_modules existence
run: |
if [ -d "node_modules/" ]; then echo -e "\e[1;31mThe node_modules/ folder was pushed to the repo. Please remove it from the GitHub repository and try again."; echo -e "\e[1;32mYou can set up a .gitignore file with this folder included on it to prevent this from happening in the future." && exit 1; fi
20 changes: 20 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"extends": ["stylelint-config-standard"],
"plugins": ["stylelint-scss", "stylelint-csstree-validator"],
"rules": {
"at-rule-no-unknown": [
true,
{
"ignoreAtRules": ["tailwind", "apply", "variants", "responsive", "screen"]
}
],
"scss/at-rule-no-unknown": [
true,
{
"ignoreAtRules": ["tailwind", "apply", "variants", "responsive", "screen"]
}
],
"csstree/validator": true
},
"ignoreFiles": ["build/**", "dist/**", "**/reset*.css", "**/bootstrap*.css", "**/*.js", "**/*.jsx"]
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 MD ARAFAT HOSSAIN

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.
144 changes: 106 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,70 +1,138 @@
# Getting Started with Create React App
<h1 align="center"> # Math Magicians<h1>

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
<a name="readme-top"></a>

## Available Scripts
# 📗 Table of Contents

In the project directory, you can run:
- [📖 About the Project](#about-project)

### `npm start`
- [🛠 Built With](#built-with)
- [Key Features](#key-features)
- [🛠 Tech Stack](#tech-stack)

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
- [💻 Getting Started](#getting-started)
- [Setup](#setup)
- [Prerequisites](#prerequisites)
- [👥 Authors](#authors)
- [🔭 Future Features](#future-features)
- [🤝 Contributing](#contributing)
- [⭐️ Show your support](#support)
- [🙏 Acknowledgements](#acknowledgements)
- [❓ FAQ](#faq)
- [📝 License](#license)

The page will reload when you make changes.\
You may also see any lint errors in the console.
## 📖 Math Magicians
**Math Magicians** is a front-end application which does contain different navigation for diferent pages and any person can use the calculator for calculations and generate a random quote.

### `npm test`
## 🛠 Built With <a name="built-with">React</a>

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### Tech Stack <a name="tech-stack"></a>

### `npm run build`
<ul>
<li><a href="https://developer.mozilla.org/ru/docs/Web/CSS">CSS</a></li>
<li><a href="https://react.dev/">React</a></li>
</ul>

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
### Key Features <a name="key-features">

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
- A single page front-end application.

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
<p align="right">(<a href="#readme-top">back to top</a>)</p>

### `npm run eject`
## 💻 Getting Started <a name="getting-started"></a>

**Note: this is a one-way operation. Once you `eject`, you can't go back!**
To get a local copy up and running, follow these steps:

If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
- Open your Terminal in your VSCode.
- Navigate to the desired directory [folder] to which you want to clone the repository to
- [Copy & Paste] Git clone you find in the code button https://github.com/HossainAraf/Math-Magicians

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
### Prerequisites

You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
In order to run this project you need:

## Learn More
- General Understanding of JavaScript & CSS
- basic Knowledge of Git Commands
- basic Knowledge of the Terminal Commands

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
### Setup

To learn React, check out the [React documentation](https://reactjs.org/).
Clone this repository to your desired folder:

### Code Splitting
- git clone https://github.com/HossainAraf/Math-Magicians.git

This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
Example commands:

### Analyzing the Bundle Size
```sh
cd my-folder
git clone https://github.com/HossainAraf/Math-Magicians.git

This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
```

### Making a Progressive Web App
### Install

This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
Must-Install-Project-with-the-Following-Programmes:

### Advanced Configuration
- Prettier Extention in VScode
- Git
- Node.js
- npm install

This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
<p align="right">(<a href="#readme-top">back to top</a>)</p>

### Deployment
## 👥 Authors <a name="authors"></a>

This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
👤 **Md Arafat Hossain**

### `npm run build` fails to minify
- GitHub: <a href="https://github.com/HossainAraf">HossainAraf </a>
- LinkedIn: <a href="https://linkedin.com/in/md-arafat-hossain-111403275"> Md. Arafat Hossain </a>

This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
## 🔭 Future Features <a name="future-features"></a>

- Functional Calculator
- Random Quote Generator

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## 🤝 Contributing <a name="contributing"></a>

Contributions, issues, and feature requests are welcome!

Feel free to check the [issues page](https://github.com/HossainAraf/Math-Magicians/issues).

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## ⭐️ Show your support <a name="support"></a>

If you like this project please don't hesitate to support me with your valued contribution and don't forget to star the repo to reach more
people.

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## 🙏 Acknowledgments <a name="acknowledgements"></a>

I would like to thank...

- Microverse Review Team
- My Coding Partners
- Microverse Community in Slack

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## ❓ FAQ <a name="faq"></a>

Can I clone this project?\*\*

- Of course you can as long as you fork it and star it

Can I contribute to this project?\*\*

- definitely you can

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## 📝 License <a name="license"></a>

This project is [MIT](./LICENSE) licensed.

<p align="right">(<a href="#readme-top">back to top</a>)</p>
Loading