Merge branch 'feature/5-add-eslint-to-gitlab-project-ci' into 'master'

Add aslant to gitlab project ci

Closes #5

See merge request Vylpes/random-bunny!2
This commit is contained in:
Vylpes 2021-01-13 21:08:47 +00:00
commit c57cf7831c
5 changed files with 538 additions and 5360 deletions

48
.eslintrc Normal file
View file

@ -0,0 +1,48 @@
{
"parserOptions": {
"ecmaVersion": 6
},
"extends": [
"eslint:recommended"
],
"rules": {
"camelcase": "error",
"brace-style": [
"error",
"1tbs"
],
"comma-dangle": [
"error",
"never"
],
"comma-spacing": [
"error",
{
"before": false,
"after": true
}
],
"comma-style": [
"error",
"last"
],
"arrow-body-style": [
"error",
"as-needed"
],
"arrow-parens": [
"error",
"as-needed"
],
"arrow-spacing": "error",
"no-var": "error",
"prefer-template": "error"
},
"globals": {
"exports": "writable",
"module": "writable",
"require": "writable",
"process": "writable",
"console": "writable"
}
}

10
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,10 @@
image: node
stages:
- lint
eslint:
stage: lint
script:
- npm install
- npm run lint

View file

@ -1,6 +1,6 @@
const fetch = require('node-fetch'); const fetch = require('node-fetch');
sortable = [ const sortable = [
'new', 'new',
'hot', 'hot',
'top' 'top'
@ -14,9 +14,6 @@ function randomBunny(subreddit, sortBy, cb) {
const data = res.data.children; const data = res.data.children;
const size = data.length; const size = data.length;
const random = getRandom(0, size - 1);
const image = data[random];
let found = false; let found = false;
while (!found) { while (!found) {

5826
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -17,9 +17,12 @@
"node-fetch": "^2.6.1" "node-fetch": "^2.6.1"
}, },
"scripts": { "scripts": {
"test": "echo \"No tests\"" "lint": "eslint ."
}, },
"bugs": "https://gitlab.vylpes.com/Vylpes/random-bunny/-/issues", "bugs": "https://gitlab.vylpes.com/Vylpes/random-bunny/-/issues",
"homepage": "https://gitlab.vylpes.com/Vylpes/random-bunny", "homepage": "https://gitlab.vylpes.com/Vylpes/random-bunny",
"funding": "https://ko-fi.com/gravitysoftware" "funding": "https://ko-fi.com/gravitysoftware",
"devDependencies": {
"eslint": "^7.17.0"
}
} }