This is a simple CSS linter for beginners that checks on some syntax errors and prints an error message which also indicated the line of the specific syntax error.
- Ruby
- RSpec
- Rubocop
- VsCode
Good code:
h1 {
font-size: 2rem;
color: black;
}
Bad code:
h1 {
font-size: 2rem
color: black;
}
Error: Missing ending semicolon ";" on line:[:2:]
Bad code:
h1 {
font-size: 2rem ;
color: black;
}
Error: Unexpected white space before semicolon " ;" on line:[:2:]
Bad code:
h1 {
font-size: 2rem;
color: black;
}
Error: Expecting two spaced indentation on line:[:2:]
Bad code:
h1 {
font-size:2rem;
color: black;
}
Error: Expecting single space after colon ":") on line:[:2:]
Bad code:
h1 {
font-size : 2rem;
color: black;
}
Error: Unexpexted space before colon " :" on line:[:2:]
Bad code:
h1 {
font-size: 2rem;
color: black;
}
Error: Trailing white spaces on line:[:2:]
- Ensure you have Ruby installed on your computer.
$ git clone https://github.com/Mupa1/CSS-Linter.git
to your local computer.- Navigate to the root directory
- Run the command below on the terminal to check your file for linter errors. N.B. file_path.css should be the path to the file you want to check for linter errors
$ bin/linter file_path.css
- Run the command below to test using rspec and see the output.
$ bundle exec rspec
- Github: @mupa1
- Twitter: @mupa_mmbetsa
- Linkedin: Mupa M'mbetsa Nzaphila
Contributions, issues and feature requests are welcome!
Feel free to check the issues page
Give a ⭐️ if you like this project!
This project is MIT licensed.