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
- Ruby
- RSpec for Ruby Testing
- Installed Ruby
To get a local copy of the repository please run the following commands on your terminal:
cd <folder>
git clone https://github.com/ShinobiWarior/JavaScript-Linters.git
To check for errors on a file:
ruby ./bin/main js_test.js
To instal RSpec for testing please run the following command on your terminal:
gem install rspec
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 Code
const 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"
}
}
//Good Code
const score = 10;|
//Bad code
const score = 10; |
//Good 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"
}
}
//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"
}
}
//Good Code
const 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"
}
//Good Code
let age = 30;
const old = 31;
const score = 10;
//Bad code
let age = 30;
const age = 31;
const score = 10;
👤 Aleksandar Ivezic
- Twitter: @AIvezic
- LinkedIn: Aleksandar Ivezic
- GitHub: @ShinobiWarior
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!
- Project is inspired by Microverse