Skip to content

Commit b7d673a

Browse files
author
Walker Leite
committed
fix(lint): fix lint errors
1 parent b550d32 commit b7d673a

File tree

16 files changed

+71
-36
lines changed

16 files changed

+71
-36
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# http://editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
indent_style = space
9+
indent_size = 2
10+
end_of_line = lf
11+
charset = utf-8
12+
trim_trailing_whitespace = true
13+
insert_final_newline = true

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
test-project
2-
template
2+
template

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
"require": true,
2121
"request": true
2222
}
23-
}
23+
}

template/.eslintrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
"gulp-tasks/**/*.js"
2626
]
2727
}
28-
]
28+
],
29+
"import/extensions": "off",
30+
"no-param-reassign": "off"
2931
},
3032
"globals": {
3133
"expect": true,

template/client/store/modules/auth/actions.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ export function syncToken({commit, dispatch}) {
1414
/**
1515
* Sync router for auth
1616
*/
17-
export function syncRouter({state, dispatch}, router) {
17+
export function syncRouter({state, dispatch}, myRouter) {
1818
dispatch('syncToken');
1919

20-
router.beforeEach((to, from, next) => {
20+
myRouter.beforeEach((to, from, next) => {
2121
if (to.matched.some(record => record.meta.requiresAuth)) {
2222
// this route requires auth, check if logged in
2323
// if not, redirect to login page (except when it's profile route and
@@ -103,7 +103,7 @@ export function loadAccount({commit}, userId) {
103103
* @param {String} newPassword new password
104104
* @return {Promise} promise of the password reset
105105
*/
106-
export function resetPassword({commit, state}, {oldPassword, newPassword}) {
106+
export function resetPassword(ctx, {oldPassword, newPassword}) {
107107
return loopback
108108
.post(
109109
'/Accounts/change-password',
@@ -117,7 +117,7 @@ export function resetPassword({commit, state}, {oldPassword, newPassword}) {
117117
* @param {String} email user email
118118
* @return {Promise} promise of the sent email
119119
*/
120-
export function rememberPassword({commit}, email) {
120+
export function rememberPassword(ctx, email) {
121121
return loopback
122122
.post('/Accounts/reset', {email});
123123
}

template/client/view/mixins/notification.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-unused-vars */
12
export default {
23
methods: {
34
notifySuccess(msg) {

template/common/models/message.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-param-reassign */
12
export default function(Message) {
23
Message.greet = (msg, cb) => {
34
process.nextTick(() => {

template/gulp-tasks/build.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,13 @@ gulp.task('build:client', ['copy:client'], () => {
6565
.pipe(gulp.dest(dirs.buildClient));
6666
});
6767

68-
gulp.task('build:common', () => gulp.src(path.resolve(dirs.srcCommon, '**/*.js'))
69-
.pipe(sourcemaps.init())
70-
.pipe(babel())
71-
.pipe(sourcemaps.write('.'))
72-
.pipe(gulp.dest(dirs.buildCommon)));
68+
gulp.task('build:common', () => {
69+
return gulp.src(path.resolve(dirs.srcCommon, '**/*.js'))
70+
.pipe(sourcemaps.init())
71+
.pipe(babel())
72+
.pipe(sourcemaps.write('.'))
73+
.pipe(gulp.dest(dirs.buildCommon));
74+
})
7375

7476
gulp.task('build:server', ['copy:server'], () => gulp.src([
7577
path.resolve(dirs.srcServer, '**/*.js'),

template/gulp-tasks/compilers.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint no-useless-escape: 0, import/prefer-default-export: 0 */
12
import path from 'path';
23
import sass from 'vueify/lib/compilers/sass';
34
import {dirs} from './config';
@@ -12,19 +13,20 @@ function replaceCuringas(content) {
1213
}
1314

1415
export function customSass(content, callback, compiler, filePath) {
16+
let myContent = content
1517
const relativePath = path.relative(
1618
path.dirname(filePath),
1719
path.resolve(dirs.srcClient, 'style/global.scss')
1820
);
1921

2022
// Global SCSS
2123
//
22-
content = `@import "${relativePath}";${content}`;
24+
myContent = `@import "${relativePath}";${myContent}`;
2325

24-
content = replaceCuringas(content);
26+
myContent = replaceCuringas(myContent);
2527

2628
sass(
27-
content,
29+
myContent,
2830
callback,
2931
compiler,
3032
filePath

template/gulp-tasks/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable import/prefer-default-export */
12
import path from 'path';
23

34
export const dirs = {};

template/gulp-tasks/copy.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,24 @@ import gulp from 'gulp';
22
import path from 'path';
33
import {dirs} from './config';
44

5-
gulp.task('copy:client:fa', () => gulp.src(path.resolve(dirs.modules, 'font-awesome/fonts/*'))
6-
.pipe(gulp.dest(path.resolve(dirs.buildClient, 'static/fonts'))));
5+
gulp.task('copy:client:fa', () => {
6+
return gulp
7+
.src(path.resolve(dirs.modules, 'font-awesome/fonts/*'))
8+
.pipe(gulp.dest(path.resolve(dirs.buildClient, 'static/fonts')));
9+
})
710

8-
gulp.task('copy:client', ['copy:client:fa'], () => gulp.src(`${dirs.srcClient}/**/!(*.vue|*.js)`)
9-
.pipe(gulp.dest(path.resolve(dirs.buildClient))));
11+
gulp.task('copy:client', ['copy:client:fa'], () => {
12+
return gulp
13+
.src(`${dirs.srcClient}/**/!(*.vue|*.js)`)
14+
.pipe(gulp.dest(path.resolve(dirs.buildClient)));
15+
})
1016

11-
gulp.task('copy:package', () => gulp.src(`${dirs.root}/package.json`)
12-
.pipe(gulp.dest(path.resolve(dirs.build))));
17+
gulp.task('copy:package', () => {
18+
return gulp.src(`${dirs.root}/package.json`)
19+
.pipe(gulp.dest(path.resolve(dirs.build)));
20+
})
1321

14-
gulp.task('copy:server', () => gulp.src(`${dirs.srcServer}/**/*.json`)
15-
.pipe(gulp.dest(path.resolve(dirs.buildServer))));
22+
gulp.task('copy:server', () => {
23+
return gulp.src(`${dirs.srcServer}/**/*.json`)
24+
.pipe(gulp.dest(path.resolve(dirs.buildServer)));
25+
})

template/gulp-tasks/serve.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ gulp.task('serve:client', ['build:client', 'watch:client'], () => {
4141
name: 'Client App',
4242
root: dirs.buildClient,
4343
livereload: true,
44-
middleware: (connect, opt) => [historyApiFallback()],
44+
middleware: () => [historyApiFallback()],
4545
});
4646
});
4747

template/gulp-tasks/test.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@ import {Server} from 'karma';
44
import path from 'path';
55
import {dirs} from './config';
66

7-
gulp.task('test:server', () => gulp.src(path.resolve(dirs.testServer, '**/*.spec.js'))
8-
.pipe(mocha({
9-
compilers: 'js:babel-core/register',
10-
require: path.resolve(dirs.test, 'mocha.conf.js'),
11-
})));
7+
gulp.task(
8+
'test:server',
9+
() =>
10+
gulp.src(path.resolve(dirs.testServer, '**/*.spec.js'))
11+
.pipe(mocha({
12+
compilers: 'js:babel-core/register',
13+
require: path.resolve(dirs.test, 'mocha.conf.js'),
14+
}))
15+
);
1216

1317
gulp.task('test:client', (done) => {
1418
new Server({

template/server/boot/create-admin.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function createAdmin(server) {
1717
if (accounts.length < 1) {
1818
return Account.create({email, password});
1919
}
20-
return null
20+
return null;
2121
})
2222
.then((account) => {
2323
if (account) {
@@ -37,11 +37,11 @@ export default function createAdmin(server) {
3737
({account, role})
3838
);
3939
}
40-
return null
40+
return null;
4141
})
4242
.then((payload) => { // get account and role from payload
4343
if (payload && payload.account && payload.role) {
44-
const myPayload = {...payload}
44+
const myPayload = {...payload};
4545
return myPayload.role.principals.create({
4646
principalType: RoleMapping.USER,
4747
principalId: myPayload.account.id,
@@ -50,6 +50,6 @@ export default function createAdmin(server) {
5050
return myPayload;
5151
});
5252
}
53-
return null
53+
return null;
5454
});
5555
}

template/server/models/account.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default function(Account) {
1515
}, (err) => {
1616
if (err) return console.log(err);
1717
console.log('> sending password reset email to:', info.email);
18-
return
18+
return null;
1919
});
2020
});
2121
}

template/test/client/app.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import Vue from 'vue';
22
import App from '@/App.vue';
33

44
describe('App.vue', () => {
5-
let Constructor;
6-
let vm;
5+
let Constructor, vm;
76
{{#extended}}
87
const routerView = {
98
render: r => r('div', 'mocked component'),

0 commit comments

Comments
 (0)