About | Built with | Installing | Testing | Style Guide | Author
This is a ruby linter that helps you check for JavaScript linting errors and enforce good styling guide conventions in your code.
- Ruby
- RSpec for Ruby Testing
- Colorize gem
- Ruby installed on local machine. Check this for Installation Guide
-
Rubocop Linter installed on Machine
Install Using this command:
gem install rubocop -
Rspec for testing installed on Machine
Install Using this command:
gem install rspec -
Colorize Gem installed on Machine
Install Using this command:
gem install colorize
Clone this repository
git clone https://github.com/uimarshall/ruby-capstone-linters.git
cd ruby-capstone-linters
Type in the following command to run the linter on a JavaScript file in the folder
ruby bin/main.rb
- Clone the repository
- Change directory to the cloned directory
cd ruby-capstone-linters - Run
bundle installto install the dependencies specified in the Gemfile - Run
rspecto test
This Linter Enforces rules for the following
Checks for triple equality
```
# Bad Code
let fst = "first"
let scd = "first"
fst == scd
# Good Code
let fst = "first";
let scd = "first";
fst === scd;
```
Check for case sensitivity in naming variables.
```
# Bad Code
let FavColor = "green";
let Hobby = "football";
# Good Code
let favColor = "green";
let hobby = "football";
```
Checks for unexpected double line
```
# Bad Code
interest = FavColor + Hobby+ best_music;
function detectoffencies() {
let arr = [7, 9, 5, 4, +8];
var res = showError(arr);
}
# Good Code
interest = FavColor + Hobby+ best_music;
function detectoffencies() {
let arr = [7, 9, 5, 4, +8];
var res = showError(arr);
}
```
Checks that there is no underscore in naming
```
# Bad Code
food_things = "rice";
# Good Code
foodThings = "rice";
```
Checks that there are no spaces at end of line
```
# Bad Code
if (condition) {
"go"
# Good Code
if (condition) {
return "go"
}
```
Checks for missing closing braces
```
# Bad Code
if (condition) {
"go"
# Good Code
if (condition) {
return "go"
}
```
👤 Marshall Akpan
- Github: uimarshall
- Twitter: uimarshall
- Linkedin: Marshall Akpan
- To contribute to this project:
- Fork this repository & clone locally.
- Create an upstream remote and sync your local copy.
- create a new branch.
- Push your code to your origin repository.
- Create a new Pull Request .
- Feel free to check the issues page.
Give a ⭐️ if you like this project!
- Microverse

