https://github.com/devbyray/es6-travis-ci-example
https://github.com/devbyray/es6-travis-ci-example
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/devbyray/es6-travis-ci-example
- Owner: devbyray
- Created: 2018-07-30T14:13:13.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-04T08:35:57.000Z (over 7 years ago)
- Last Synced: 2025-06-05T05:40:51.455Z (10 months ago)
- Language: JavaScript
- Size: 343 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ES6 Travis CI example [](https://travis-ci.org/raymonschouwenaar/ES6-travis-ci-example)
The main purpose of this project is to make the feedback loop of your work as smooth as possible. You can use Gulp to lint your CSS and JavaScript.
It's also created to do automatic linting when you connected your repository to [Travis-CI](https://travis-ci.org). When connected Gulp will automatically be started when you create a Pull-request.
Use this project as an example or inspiration. Please let me know if you got problems with it or if you got a big success 👍
# Installation
1. Run `npm install` or `yarn`
2. Install [Gulp globally](https://gulpjs.com)
## Connect your Github Repo to Travis-CI
1. Go to [Travis-CI](https://travis-ci.org) website and sign-up with your Github Account.
2. After the sign-up process, go to *profile settings*
3. Find your repo and turn on the switch.
4. Now Travis-CI will detect any push and pull-requests and run Gulp.
5. In order to get a comment on your PR when the linting was a success, create a *Personal access token* on Github.
6. Go to Github, click on your avatar -> settings -> Developer settings -> Personal access token. Create a token and check the box *public_repo* and create the token.
7. Copy the token and go to your repo on Travis-CI, click on the right *More options*, scroll down to *Environment Variables* and create a new one. Name: GITHUB_TOKEN, Value:
8. Now you get a success comment on your PR when all the JavaScript and CSS is good by the linters.
# How-to-use
Run `gulp` to run the Eslint and Stylelint task and get your JavaScript and CSS/Scss/Sass tested.
If you run you have added Travis CI to your repository, then these tasks will automatically run on Travis.
## Ignoring files from dependencies
In the `lint-ignore.json` you can specify which files and directories needed to be ignored. Think about JS and CSS from dependencies.
```
{
"eslint": ["!tests/**/*.js", "!./*.js"],
"stylelint" : []
}
```
## Pull-request
If you create a pull-request, Travis will run the Gulp tasks and put the errors in a PR comment so you get the feedback and error reports on 1 place.
## Push
If you push a commit to your repository, then Travis will give your commit a status.
- Pending
- Error
- Failure
- Success
This helps you to see if the Eslint or Stylelint find errors on your commit. So you can have feedback early.
# Todo
- Make JSON file to declare the main folders to look for CSS and JavaScript files.
- Optimize for better scalable architecture.