Skip to content

Commit

Permalink
refactor: lint against with nuxt eslint preset
Browse files Browse the repository at this point in the history
  • Loading branch information
pooya parsa committed Aug 5, 2019
1 parent 648e785 commit aace944
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions benchmarks.js
Expand Up @@ -31,11 +31,11 @@ const consolaAsync = new Consola({

let suite
const benchmarks = {
'log': [ 'test' ],
'log with string arg': [ 'test', 'test' ],
'log with array arg': [ 'test', [ 1, 2, 3 ] ],
'log with object arg': [ 'test', { a: 1, b: 2, c: 3 } ],
'log with error': [ 'test', new Error('test') ]
log: ['test'],
'log with string arg': ['test', 'test'],
'log with array arg': ['test', [1, 2, 3]],
'log with object arg': ['test', { a: 1, b: 2, c: 3 }],
'log with error': ['test', new Error('test')]
}

function run () {
Expand Down
4 changes: 2 additions & 2 deletions examples/utils/index.js
Expand Up @@ -9,7 +9,7 @@ export function reporterDemo (reporter) {
]
})

for (let type of Object.keys(consola._types).sort()) {
for (const type of Object.keys(consola._types).sort()) {
consola[type](randomSentence())
}

Expand All @@ -22,7 +22,7 @@ export function reporterDemo (reporter) {

const tagged = consola.withTag('nuxt').withTag('router')

for (let type of Object.keys(consola._types).sort()) {
for (const type of Object.keys(consola._types).sort()) {
tagged[type](randomSentence())
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/reporters/fancy.js
Expand Up @@ -53,7 +53,7 @@ export default class FancyReporter extends BasicReporter {
}

formatLogObj (logObj, { width }) {
const [ message, ...additional ] = this.formatArgs(logObj.args).split('\n')
const [message, ...additional] = this.formatArgs(logObj.args).split('\n')

const isBadge = typeof logObj.badge !== 'undefined' ? Boolean(logObj.badge) : logObj.level < 2

Expand Down
2 changes: 1 addition & 1 deletion src/utils/error.js
Expand Up @@ -3,7 +3,7 @@ import { sep } from 'path'
export function parseStack (stack) {
const cwd = process.cwd() + sep

let lines = stack
const lines = stack
.split('\n')
.splice(1)
.map(l => l
Expand Down
2 changes: 1 addition & 1 deletion src/utils/fancy.js
@@ -1,5 +1,5 @@
export const TYPE_COLOR_MAP = {
'info': 'cyan'
info: 'cyan'
}

export const LEVEL_COLOR_MAP = {
Expand Down
8 changes: 4 additions & 4 deletions src/utils/global.js
Expand Up @@ -12,21 +12,21 @@ export function assignGlobalReference (newInstance, referenceKey) {

const oldInstance = Object.create(global[referenceKey])

for (let prop in global[referenceKey]) {
for (const prop in global[referenceKey]) {
oldInstance[prop] = global[referenceKey][prop]
delete global[referenceKey][prop]
}

for (let prop of Object.getOwnPropertySymbols(global[referenceKey])) {
for (const prop of Object.getOwnPropertySymbols(global[referenceKey])) {
oldInstance[prop] = global[referenceKey][prop]
delete global[referenceKey][prop]
}

for (let prop in newInstance) {
for (const prop in newInstance) {
global[referenceKey][prop] = newInstance[prop]
}

for (let prop of Object.getOwnPropertySymbols(newInstance)) {
for (const prop of Object.getOwnPropertySymbols(newInstance)) {
global[referenceKey][prop] = newInstance[prop]
}

Expand Down

0 comments on commit aace944

Please sign in to comment.