Skip to content

Commit

Permalink
fix eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dbale-altoros committed Jan 25, 2023
1 parent 5dc1014 commit c50c429
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion lib/formatters/stylish.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function pluralize(word, count) {
// Public Interface
//------------------------------------------------------------------------------

module.exports = function (results) {
module.exports = function (results) { // eslint-disable-line
let output = '\n'
let errorCount = 0
let warningCount = 0
Expand Down
2 changes: 1 addition & 1 deletion lib/formatters/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function drawReport(results) {
// Public Interface
//------------------------------------------------------------------------------

module.exports = function (report) {
module.exports = function (report) { // eslint-disable-line
let result
let errorCount
let warningCount
Expand Down
2 changes: 1 addition & 1 deletion lib/formatters/tap.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function outputDiagnostics(diagnostic) {
// Public Interface
//------------------------------------------------------------------------------

module.exports = function (results) {
module.exports = function (results) { // eslint-disable-line
let output = `TAP version 13\n1..${results.length}\n`

results.forEach((result, id) => {
Expand Down
2 changes: 1 addition & 1 deletion lib/formatters/unix.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function getMessageType(message) {
// Public Interface
//------------------------------------------------------------------------------

module.exports = function (results) {
module.exports = function (results) { // eslint-disable-line
let output = ''
let total = 0

Expand Down
2 changes: 1 addition & 1 deletion lib/rules/best-practises/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ module.exports = function checkers(reporter, config, inputSrc) {
new NoUnusedVarsChecker(reporter),
new PayableFallbackChecker(reporter),
new ReasonStringChecker(reporter, config),
new NoConsoleLogChecker(reporter)
new NoConsoleLogChecker(reporter),
]
}
12 changes: 6 additions & 6 deletions lib/rules/best-practises/no-console.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const BaseChecker = require('./../base-checker')
const BaseChecker = require('../base-checker')

const DEFAULT_SEVERITY = 'error'

Expand All @@ -13,7 +13,7 @@ const meta = {
bad: [
{
description: 'No console.logX statements',
code: "console.log('test')"
code: "console.log('test')",
},
{
description: 'No hardhat/console.sol import statements',
Expand All @@ -22,15 +22,15 @@ const meta = {
{
description: 'No forge-std console.sol & console2.sol import statements',
code: 'import "forge-std/consoleN.sol"' // eslint-disable-line
}
]
}
},
],
},
},

isDefault: true,
recommended: true,
defaultSetup: [DEFAULT_SEVERITY],
schema: null
schema: null,
}

class NoConsoleLogChecker extends BaseChecker {
Expand Down
22 changes: 11 additions & 11 deletions test/rules/best-practises/no-console.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const assert = require('assert')
const linter = require('./../../../lib/index')
const { assertErrorMessage } = require('./../../common/asserts')
const { funcWith } = require('./../../common/contract-builder')
const linter = require('../../../lib/index')
const { assertErrorMessage } = require('../../common/asserts')
const { funcWith } = require('../../common/contract-builder')

const FUNCTION_CALL_ERROR = 'No console.logX or console2.log statements'
const IMPORT_ERROR = 'No import "hardhat/console.sol" or "forge-std/console.sol" statements'
Expand All @@ -13,7 +13,7 @@ describe('Linter - no-console', () => {
`)

const report = linter.processStr(code, {
rules: { 'no-console': ['error'] }
rules: { 'no-console': ['error'] },
})

assert.equal(report.errorCount, 1)
Expand All @@ -26,7 +26,7 @@ describe('Linter - no-console', () => {
`)

const report = linter.processStr(code, {
rules: { 'no-console': ['error'] }
rules: { 'no-console': ['error'] },
})

assert.equal(report.errorCount, 1)
Expand All @@ -39,7 +39,7 @@ describe('Linter - no-console', () => {
`)

const report = linter.processStr(code, {
rules: { 'no-console': ['error'] }
rules: { 'no-console': ['error'] },
})

assert.equal(report.errorCount, 1)
Expand All @@ -52,7 +52,7 @@ describe('Linter - no-console', () => {
`)

const report = linter.processStr(code, {
rules: { 'no-console': ['error'] }
rules: { 'no-console': ['error'] },
})

assert.equal(report.errorCount, 1)
Expand All @@ -66,7 +66,7 @@ describe('Linter - no-console', () => {
`

const report = linter.processStr(code, {
rules: { 'no-console': ['error'] }
rules: { 'no-console': ['error'] },
})

assert.equal(report.errorCount, 1)
Expand All @@ -80,7 +80,7 @@ describe('Linter - no-console', () => {
`

const report = linter.processStr(code, {
rules: { 'no-console': ['error'] }
rules: { 'no-console': ['error'] },
})

assert.equal(report.errorCount, 1)
Expand All @@ -94,7 +94,7 @@ describe('Linter - no-console', () => {
`

const report = linter.processStr(code, {
rules: { 'no-console': ['error'] }
rules: { 'no-console': ['error'] },
})

assert.equal(report.errorCount, 1)
Expand All @@ -108,7 +108,7 @@ describe('Linter - no-console', () => {
`

const report = linter.processStr(code, {
rules: { 'no-console': ['error'] }
rules: { 'no-console': ['error'] },
})

assert.equal(report.errorCount, 0)
Expand Down

0 comments on commit c50c429

Please sign in to comment.