Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aleksandarivezic/javascript-linters
This repo contains JavaScript-Linters built with Ruby
https://github.com/aleksandarivezic/javascript-linters
Last synced: 1 day ago
JSON representation
This repo contains JavaScript-Linters built with Ruby
- Host: GitHub
- URL: https://github.com/aleksandarivezic/javascript-linters
- Owner: AleksandarIvezic
- Created: 2021-05-07T10:03:51.000Z (over 3 years ago)
- Default Branch: develop
- Last Pushed: 2021-05-12T12:45:01.000Z (over 3 years ago)
- Last Synced: 2024-12-07T18:12:04.834Z (22 days ago)
- Language: Ruby
- Size: 43.9 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![](https://img.shields.io/badge/Microverse-blueviolet)
# JavaScript Linters
> The main goal of this project is to create a linters that can check JavaScript files and provide feedback about errors. The project was built completely by using Ruby.
In this project we are looking for the following errors:
- Wrong indentation
- Trailing spaces
- New line errors
- Missing tags - (), [], and {}
- Multiple variable declaration## Built With
- Ruby
- RSpec for Ruby Testing## Getting Started
### Prerequisites
- Installed Ruby
### Download the repoTo get a local copy of the repository please run the following commands on your terminal:
cd
git clone https://github.com/ShinobiWarior/JavaScript-Linters.git
To check for errors on a file:
ruby ./bin/main js_test.js
### Install RSpec
To instal RSpec for testing please run the following command on your terminal:
gem install rspec### Run tests
To test the code, run `rspec` from root of the folder using terminal.
- Please keep in mind that modifying the js_test.js file will affect the test results.## Good and bad code examples
### Wrong indentation
~~~javascript
//Good Codeconst person = {
firstName: "john",
lastName: "doe",
age: 30,
hobbies: ["music", "movies", "sports"],
address: {
street: "50 main st",
city: "boston",
state: "ma"
}
}//Bad code
const person = {
firstName: "john",
lastName: "doe",
age: 30,
hobbies: ["music", "movies", "sports"],
address: {
street: "50 main st",
city: "boston",
state: "ma"
}
}~~~
### Trailing spaces (Pipe `|` stands instead of cursor)
~~~javascript
//Good Codeconst score = 10;|
//Bad code
const score = 10; |
~~~
### New line errors
~~~javascript
//Good Codeconst score = 10;
const person = {
firstName: "john",
lastName: "doe",
age: 30,
hobbies: ["music", "movies", "sports"],
address: {
street: "50 main st",
city: "boston",
state: "ma"
}
}//Bad code
const score = 10;
const person = {
firstName: "john",
lastName: "doe",
age: 30,
hobbies: ["music", "movies", "sports"],
address: {
street: "50 main st",
city: "boston",
state: "ma"
}
}~~~
### Missing tags - (), [], and {}
~~~javascript
//Good Codeconst person = {
firstName: "john",
lastName: "doe",
age: 30,
hobbies: ["music", "movies", "sports"],
address: {
street: "50 main st",
city: "boston",
state: "ma"
}
}//Bad code
const person = {
firstName: "john",
lastName: "doe",
age: 30,
hobbies: "music", "movies", "sports"],
address: {
street: "50 main st",
city: "boston",
state: "ma"
}~~~
### Multiple variable declaration
~~~javascript
//Good Codelet age = 30;
const old = 31;
const score = 10;//Bad code
let age = 30;
const age = 31;
const score = 10;
~~~## Author
👤 **Aleksandar Ivezic**
- Twitter: [@AIvezic](https://twitter.com/AIvezic/)
- LinkedIn: [Aleksandar Ivezic](https://www.linkedin.com/in/aleksandar-ivezi%C4%87-1a6b0391/)
- GitHub: [@ShinobiWarior](https://github.com/ShinobiWarior/)## 🤝 Contributing
Contributions, issues, and feature requests are welcome!
Feel free to check the [issues page](https://github.com/ShinobiWarior/JavaScript-Linters/issues).
## Show your support
Give a ⭐️ if you like this project!
## Acknowledgments
- Project is inspired by [Microverse](https://www.microverse.org/?grsf=w9rx3c)