Skip to content
This repository was archived by the owner on Jul 2, 2021. It is now read-only.

Commit 64cb20a

Browse files
committed
Fix linter issues
1 parent 1dd4362 commit 64cb20a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+90
-89
lines changed

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ module.exports = {
1010
mocha: true
1111
},
1212
rules: {
13-
'arrow-parens': 0
13+
'arrow-parens': 0,
14+
'node/no-deprecated-api': 0
1415
},
1516
globals: {
1617
__root: true,

config/build.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ const fs = require('fs')
22
const path = require('path')
33
const { exec } = require('child_process')
44

5-
let rawdata = fs.readFileSync(path.join(__dirname, '../package.json'))
6-
let packageJson = JSON.parse(rawdata)
5+
const rawdata = fs.readFileSync(path.join(__dirname, '../package.json'))
6+
const packageJson = JSON.parse(rawdata)
77

88
if (typeof packageJson['build-config'] !== 'undefined' && typeof packageJson['build-config'].exportAliases !== 'undefined') {
9-
for (let filename in packageJson['build-config'].exportAliases) {
9+
for (const filename in packageJson['build-config'].exportAliases) {
1010
exec(`cp -rf ${path.join(__dirname, '../', packageJson['build-config'].exportAliases[filename])} ${path.join(__dirname, '../', filename)}`)
1111
}
1212
}

examples/02-multiple-response-type/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const routes = require('./routes')
22
const Cherry = require('../../src/cherry')
3-
const CherryHandlebarsConnector = require('@lund-org/cherry-handlebars-connector')
3+
// const CherryHandlebarsConnector = require('@lund-org/cherry-handlebars-connector')
44
const CherryPugConnector = require('@lund-org/cherry-pug-connector')
55

66
const options = {
@@ -10,7 +10,7 @@ const options = {
1010
}
1111
],
1212
plugins: [
13-
/*CherryHandlebarsConnector,*/
13+
// CherryHandlebarsConnector,
1414
CherryPugConnector
1515
],
1616
routes

examples/02-multiple-response-type/routes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module.exports = {
3737
method: ['GET'],
3838
path: '/json-object',
3939
callback: (req, res) => {
40-
let obj = {
40+
const obj = {
4141
key: 'value'
4242
}
4343
obj.circular = obj

examples/04-orm/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const options = {
3939
port: 4005
4040
}
4141
],
42-
plugins: [ CherrySequelizeConnector, CherryTypeormConnector ],
42+
plugins: [CherrySequelizeConnector, CherryTypeormConnector],
4343
routes,
4444
database: typeormConfig
4545
// database: sequelizeConfig

examples/04-orm/typeorm/models/Model.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = class Model {
22
set (data) {
33
if (typeof data !== 'undefined') {
4-
for (let index in data) {
4+
for (const index in data) {
55
if (typeof this[index] !== 'undefined') {
66
this[index] = data[index]
77
}

src/abstract/CherryRouteManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class CherryRouteManager {
1616

1717
for (const Router of routers) {
1818
if (Router.getType() === routeConfig.type) {
19-
let router = new Router(routeConfig)
19+
const router = new Router(routeConfig)
2020

2121
this.routes = this.routes.concat(router.build())
2222
routeTypeMatch = true

src/builtins/response.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ function json (ref, refOptions = null) {
152152
*/
153153
function redirect (redirectUri, redirectionCode = 301) {
154154
const headers = {
155-
'Location': redirectUri
155+
Location: redirectUri
156156
}
157157
response.call(this, redirectionCode, headers, '')
158158
}

src/configuration/PluginConfigurator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class PluginConfigurator extends CherryConfigurator {
3333
* @return {mixed}
3434
*/
3535
getPluginInstance (name) {
36-
let PluginClass = this.getPlugin(name)
36+
const PluginClass = this.getPlugin(name)
3737

3838
if (typeof PluginClass !== 'undefined' && PluginClass) {
3939
return new PluginClass()

src/configuration/RouteConfigurator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class RouteConfigurator extends CherryConfigurator {
106106
let routeResponse = null
107107

108108
manager.getRoutes().some((publicRoute) => {
109-
let tmp = publicRoute.matchRoute(route, req, res)
109+
const tmp = publicRoute.matchRoute(route, req, res)
110110

111111
if (tmp.getMatchingRoute()) {
112112
routeResponse = tmp

0 commit comments

Comments
 (0)