Skip to content

Commit

Permalink
Bump standard from 14.3.4 to 16.0.3
Browse files Browse the repository at this point in the history
Along with some fixes and deactivating no-var where necessary...
  • Loading branch information
carhartl committed Jul 23, 2021
1 parent 74c56ef commit 309a4eb
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 11 deletions.
6 changes: 3 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
function encodingMiddleware (request, response, next) {
const URL = require('url').URL
var url = new URL(request.url, 'http://localhost')
const url = new URL(request.url, 'http://localhost')

if (url.pathname !== '/encoding') {
next()
return
}

var cookieName = url.searchParams.get('name')
var cookieValue = url.searchParams.get('value')
const cookieName = url.searchParams.get('name')
const cookieValue = url.searchParams.get('value')

response.setHeader('content-type', 'application/json')
response.end(
Expand Down
6 changes: 3 additions & 3 deletions examples/webpack/server.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var nodeStatic = require('node-static')
var file = new nodeStatic.Server('./dist')
var port = 8080
const nodeStatic = require('node-static')
const file = new nodeStatic.Server('./dist')
const port = 8080

require('http')
.createServer(function (request, response) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"rollup-plugin-filesize": "^9.1.1",
"rollup-plugin-license": "^2.5.0",
"rollup-plugin-terser": "^7.0.2",
"standard": "^14.1.0"
"standard": "^16.0.3"
},
"engines": {
"node": ">=12"
Expand Down
2 changes: 2 additions & 0 deletions src/api.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-var */
import assign from './assign.mjs'
import defaultConverter from './converter.mjs'

Expand Down Expand Up @@ -105,3 +106,4 @@ function init (converter, defaultAttributes) {
}

export default init(defaultConverter, { path: '/' })
/* eslint-enable no-var */
2 changes: 2 additions & 0 deletions src/assign.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-var */
export default function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i]
Expand All @@ -7,3 +8,4 @@ export default function (target) {
}
return target
}
/* eslint-enable no-var */
2 changes: 2 additions & 0 deletions src/converter.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-var */
export default {
read: function (value) {
return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent)
Expand All @@ -9,3 +10,4 @@ export default {
)
}
}
/* eslint-enable no-var */
3 changes: 3 additions & 0 deletions test/encoding.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* global QUnit, lifecycle, using */
/* eslint-disable no-var */

QUnit.module('cookie-value', lifecycle)

Expand Down Expand Up @@ -1231,3 +1232,5 @@ QUnit.test('cookie-name - 4 bytes characters', function (assert) {
)
})
})

/* eslint-enable no-var */
8 changes: 4 additions & 4 deletions test/node.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
exports.node = {
shouldLoadApi: function (test) {
test.expect(1)
var Cookies = require('../dist/js.cookie.min.js')
const Cookies = require('../dist/js.cookie.min.js')
test.ok(!!Cookies.get, 'should load the Cookies API')
test.done()
},
shouldNotThrowErrorForSetCallInNode: function (test) {
test.expect(0)
var Cookies = require('../dist/js.cookie.min.js')
const Cookies = require('../dist/js.cookie.min.js')
Cookies.set('anything')
Cookies.set('anything', { path: '' })
test.done()
},
shouldNotThrowErrorForGetCallInNode: function (test) {
test.expect(0)
var Cookies = require('../dist/js.cookie.min.js')
const Cookies = require('../dist/js.cookie.min.js')
Cookies.get('anything')
test.done()
},
shouldNotThrowErrorForRemoveCallInNode: function (test) {
test.expect(0)
var Cookies = require('../dist/js.cookie.min.js')
const Cookies = require('../dist/js.cookie.min.js')
Cookies.remove('anything')
Cookies.remove('anything', { path: '' })
test.done()
Expand Down
3 changes: 3 additions & 0 deletions test/tests.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* global Cookies, QUnit, lifecycle, quoted */
/* eslint-disable no-var */

QUnit.module('setup', lifecycle)

Expand Down Expand Up @@ -659,3 +660,5 @@ QUnit.test('do not conflict with existent globals', function (assert) {
)
window.Cookies = Cookies
})

/* eslint-enable no-var */
3 changes: 3 additions & 0 deletions test/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* global Cookies, QUnit */
/* eslint-disable no-var */

;(function () {
window.lifecycle = {
Expand Down Expand Up @@ -80,3 +81,5 @@
return '"' + input + '"'
}
})()

/* eslint-enable no-var */

0 comments on commit 309a4eb

Please sign in to comment.