mountain-pass/addressr

View on GitHub
service/address-service.js

Summary

Maintainability
A
0 mins
Test Coverage
C
76%

'loadFileContents' is defined but never used.
Open

async function loadFileContents(contentsFile) {
Severity: Minor
Found in service/address-service.js by eslint

Disallow Unused Variables (no-unused-vars)

Variables that are declared and not used anywhere in the code are most likely an error due to incomplete refactoring. Such variables take up space in the code and can lead to confusion by readers.

Rule Details

This rule is aimed at eliminating unused variables, functions, and function parameters.

A variable foo is considered to be used if any of the following are true:

  • It is called (foo()) or constructed (new foo())
  • It is read (var bar = foo)
  • It is passed into a function as an argument (doSomething(foo))
  • It is read inside of a function that is passed to another function (doSomething(function() { foo(); }))

A variable is not considered to be used if it is only ever declared (var foo = 5) or assigned to (foo = 7).

Examples of incorrect code for this rule:

/*eslint no-unused-vars: "error"*/
/*global some_unused_var*/

// It checks variables you have defined as global
some_unused_var = 42;

var x;

// Write-only variables are not considered as used.
var y = 10;
y = 5;

// A read for a modification of itself is not considered as used.
var z = 0;
z = z + 1;

// By default, unused arguments cause warnings.
(function(foo) {
    return 5;
})();

// Unused recursive functions also cause warnings.
function fact(n) {
    if (n < 2) return 1;
    return n * fact(n - 1);
}

// When a function definition destructures an array, unused entries from the array also cause warnings.
function getY([x, y]) {
    return y;
}

Examples of correct code for this rule:

/*eslint no-unused-vars: "error"*/

var x = 10;
alert(x);

// foo is considered used here
myFunc(function foo() {
    // ...
}.bind(this));

(function(foo) {
    return foo;
})();

var myFunc;
myFunc = setTimeout(function() {
    // myFunc is considered used
    myFunc();
}, 50);

// Only the second argument from the descructured array is used.
function getY([, y]) {
    return y;
}

exported

In environments outside of CommonJS or ECMAScript modules, you may use var to create a global variable that may be used by other scripts. You can use the /* exported variableName */ comment block to indicate that this variable is being exported and therefore should not be considered unused.

Note that /* exported */ has no effect for any of the following:

  • when the environment is node or commonjs
  • when parserOptions.sourceType is module
  • when ecmaFeatures.globalReturn is true

The line comment // exported variableName will not work as exported is not line-specific.

Examples of correct code for /* exported variableName */ operation:

/* exported global_var */

var global_var = 42;

Options

This rule takes one argument which can be a string or an object. The string settings are the same as those of the vars property (explained below).

By default this rule is enabled with all option for variables and after-used for arguments.

{
    "rules": {
        "no-unused-vars": ["error", { "vars": "all", "args": "after-used", "ignoreRestSiblings": false }]
    }
}

vars

The vars option has two settings:

  • all checks all variables for usage, including those in the global scope. This is the default setting.
  • local checks only that locally-declared variables are used but will allow global variables to be unused.

vars: local

Examples of correct code for the { "vars": "local" } option:

/*eslint no-unused-vars: ["error", { "vars": "local" }]*/
/*global some_unused_var */

some_unused_var = 42;

varsIgnorePattern

The varsIgnorePattern option specifies exceptions not to check for usage: variables whose names match a regexp pattern. For example, variables whose names contain ignored or Ignored.

Examples of correct code for the { "varsIgnorePattern": "[iI]gnored" } option:

/*eslint no-unused-vars: ["error", { "varsIgnorePattern": "[iI]gnored" }]*/

var firstVarIgnored = 1;
var secondVar = 2;
console.log(secondVar);

args

The args option has three settings:

  • after-used - unused positional arguments that occur before the last used argument will not be checked, but all named arguments and all positional arguments after the last used argument will be checked.
  • all - all named arguments must be used.
  • none - do not check arguments.

args: after-used

Examples of incorrect code for the default { "args": "after-used" } option:

/*eslint no-unused-vars: ["error", { "args": "after-used" }]*/

// 2 errors, for the parameters after the last used parameter (bar)
// "baz" is defined but never used
// "qux" is defined but never used
(function(foo, bar, baz, qux) {
    return bar;
})();

Examples of correct code for the default { "args": "after-used" } option:

/*eslint no-unused-vars: ["error", {"args": "after-used"}]*/

(function(foo, bar, baz, qux) {
    return qux;
})();

args: all

Examples of incorrect code for the { "args": "all" } option:

/*eslint no-unused-vars: ["error", { "args": "all" }]*/

// 2 errors
// "foo" is defined but never used
// "baz" is defined but never used
(function(foo, bar, baz) {
    return bar;
})();

args: none

Examples of correct code for the { "args": "none" } option:

/*eslint no-unused-vars: ["error", { "args": "none" }]*/

(function(foo, bar, baz) {
    return bar;
})();

ignoreRestSiblings

The ignoreRestSiblings option is a boolean (default: false). Using a Rest Property it is possible to "omit" properties from an object, but by default the sibling properties are marked as "unused". With this option enabled the rest property's siblings are ignored.

Examples of correct code for the { "ignoreRestSiblings": true } option:

/*eslint no-unused-vars: ["error", { "ignoreRestSiblings": true }]*/
// 'type' is ignored because it has a rest property sibling.
var { type, ...coords } = data;

argsIgnorePattern

The argsIgnorePattern option specifies exceptions not to check for usage: arguments whose names match a regexp pattern. For example, variables whose names begin with an underscore.

Examples of correct code for the { "argsIgnorePattern": "^_" } option:

/*eslint no-unused-vars: ["error", { "argsIgnorePattern": "^_" }]*/

function foo(x, _y) {
    return x + 1;
}
foo();

caughtErrors

The caughtErrors option is used for catch block arguments validation.

It has two settings:

  • none - do not check error objects. This is the default setting.
  • all - all named arguments must be used.

caughtErrors: none

Not specifying this rule is equivalent of assigning it to none.

Examples of correct code for the { "caughtErrors": "none" } option:

/*eslint no-unused-vars: ["error", { "caughtErrors": "none" }]*/

try {
    //...
} catch (err) {
    console.error("errors");
}

caughtErrors: all

Examples of incorrect code for the { "caughtErrors": "all" } option:

/*eslint no-unused-vars: ["error", { "caughtErrors": "all" }]*/

// 1 error
// "err" is defined but never used
try {
    //...
} catch (err) {
    console.error("errors");
}

caughtErrorsIgnorePattern

The caughtErrorsIgnorePattern option specifies exceptions not to check for usage: catch arguments whose names match a regexp pattern. For example, variables whose names begin with a string 'ignore'.

Examples of correct code for the { "caughtErrorsIgnorePattern": "^ignore" } option:

/*eslint no-unused-vars: ["error", { "caughtErrorsIgnorePattern": "^ignore" }]*/

try {
    //...
} catch (ignoreErr) {
    console.error("errors");
}

When Not To Use It

If you don't want to be notified about unused variables or function arguments, you can safely turn this rule off. Source: http://eslint.org/docs/rules/

Insert ;
Open

const fsp = fs.promises
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

var logger = debug('api')
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const cachedResponse = await cache.get(packageUrl)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

      headers: response.headers
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace error_ with (error_)
Open

      fs.access(destination, fs.constants.R_OK, error_ => {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const basenameWithoutExtention = path.basename(file, extname)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        else resolve()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                const dirname = path.dirname(entryPath)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                        logger('skipping extract for', entryPath)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace entry with (entry)
Open

    entry => entry.CODE === code
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  error({ address })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    return found.NAME
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

      }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

          type: {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

        ...(geo.GEOCODE_SITE_DESCRIPTION !== '' && {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace s.flat.suffix·|| with ⏎······s.flat.suffix·||·''
Open

    number = `${s.flat.prefix || ''}${s.flat.number || ''}${s.flat.suffix ||
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

          })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

            }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

        postcode: d.POSTCODE
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

              _id: `/addresses/${item.pid}`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

import Keyv from 'keyv'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      return cachedResponse
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    const response = await got.get(packageUrl)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                    entry.autodrain()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                    callback()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace error_ with (error_)
Open

                fs.mkdir(dirname, { recursive: true }, error_ => {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                        logger('error statting file', error_)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  error({ address })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  return
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace geo with (geo)
Open

    geoSite.forEach(geo => {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        geo.default = false
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

      if (geo.PLANIMETRIC_ACCURACY !== '') {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ········console.log('e',·geo) with ··········console.log('e',·geo);
Open

        console.log('e', geo)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

      }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ············name:·geocodeTypeCodeToName(geo.GEOCODE_TYPE_CODE,·context) with ··············name:·geocodeTypeCodeToName(geo.GEOCODE_TYPE_CODE,·context),
Open

            name: geocodeTypeCodeToName(geo.GEOCODE_TYPE_CODE, context)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ············} with ··············},
Open

            }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

          }),
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

          ...(geo.LONGITUDE !== '' && {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      : []
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  return sites.concat(def)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  let number = ''
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const streetSuffix = s.street.suffix ? ` ${s.street.suffix.code}` : ''
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    rval.smla = mapToShortMla(rval.structured)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

import LinkHeader from 'http-link-header'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  logger('cached gnaf package data', cachedResponse)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

import stream from 'stream'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

const ONE_DAY_MS = 1000 * ONE_DAY_S
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      if (error_) reject(error_)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

        _id: row.links.self.href
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      if (error_) reject(error_)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    const created = new Date(cachedResponse.headers.date)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        if (error_) reject(error_)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                          })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    return found.NAME
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

            }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  return
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          logger('error unzipping data file', error_)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  error(`Unknown Geocode Type Code: '${code}'`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace entry with (entry)
Open

    entry => entry.CODE === code
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    return found.NAME
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        foundDefault = true
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

      }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

      if (geo.BOUNDARY_EXTENT !== '') {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

      }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace } with ··},
Open

          }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

      if (geo.GEOCODE_SITE_NAME !== '') {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

        }),
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ··········longitude:·Number.parseFloat(geo.LONGITUDE) with ············longitude:·Number.parseFloat(geo.LONGITUDE),
Open

          longitude: Number.parseFloat(geo.LONGITUDE)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    : []
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

})
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ······''}/with····}/;
Open

      ''}/`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Delete s
Open

    number = `${number}${s.lotNumber.prefix || ''}${s.lotNumber.number || ''}${s
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    logger('response.isFromCache', response.fromCache)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace s.level.number·|| with ⏎········s.level.number·||·''
Open

      `${s.level.type.code || ''}${s.level.prefix || ''}${s.level.number ||
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

import fs from 'fs'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

const GNAF_DIR = process.env.GNAF_DIR || `target/gnaf`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

import download from '../utils/stream-down'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Delete ''
Open

      ''}${s.level.suffix || ''}`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

            suffix: d.NUMBER_FIRST_SUFFIX
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace r with (r)
Open

    r => r.state === 'active' && r.mimetype === 'application/zip'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

import { KeyvFile } from 'keyv-file'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    : undefined
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

                suffix: d.NUMBER_LAST_SUFFIX
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    return []
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

            }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  logger('url', dataResource.url)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  await dropESIndex(global.esClient)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

            prefix: d.LOT_NUMBER_PREFIX
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

            suffix: d.LOT_NUMBER_SUFFIX
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    await sendIndexRequest(indexingBody)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

      precedence: d.PRIMARY_SECONDARY === 'P' ? 'primary' : 'secondary'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  'https://data.gov.au/api/3/action/package_show?id=19432f89-dc3a-4ef3-b943-5326ef1dbecc'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ··········} with ············},
Open

          }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          items.push(item)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    cachedResponse.headers['x-cache'] = 'HIT'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      await fsp.rename(`${incomplete_path}/${basename}`, destination)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    response.headers['x-cache'] = 'MISS'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

            number: Number.parseInt(d.FLAT_NUMBER)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const complete_path = `${GNAF_DIR}/${basenameWithoutExtention}`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const response = await fetchPackageData()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const exists = await directoryExists(complete_path)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

          })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                            logger('finished extracting', entryPath)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    await prom
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      logger(`${i} rows`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      else resolve()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        else resolve(complete_path)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        if (error_) reject(error_)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  error(`Unknown Flat Type Code: '${code}'`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        if (error_) reject(error_)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace entry with (entry)
Open

    entry => entry.CODE === code
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace error_ with (error_)
Open

        .on('error', error_ => {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  error(`Unknown Level Type Code: '${code}'`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    return found.NAME
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

        name: streetClassCodeToName(l.STREET_CLASS_CODE, context)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

        name: streetSuffixCodeToName(l.STREET_SUFFIX_CODE, context)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace entry with (entry)
Open

    entry => entry.CODE === code
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

      }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ········throw·new·Error('encounterd·geo.BOUNDARY_EXTENT') with ··········throw·new·Error('encounterd·geo.BOUNDARY_EXTENT');
Open

        throw new Error('encounterd geo.BOUNDARY_EXTENT')
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

      return {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

        ...(geo.RELIABILITY_CODE !== '' && {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

        }),
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ········} with ··········};
Open

        }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const fla = []
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ············ with ··············
Open

            code: geo.GEOCODE_TYPE_CODE,
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    fla.push(s.buildingName)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    fla.shift()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace geo with (geo)
Open

      ? geoDefault.map(geo => {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const fla = []
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace .flat.suffix·||·'' with s.flat.suffix·||·''⏎······
Open

        .flat.suffix || ''}`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  return fla
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

        }),
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  fla.push(`${s.locality.name} ${s.state.abbreviation} ${s.postcode}`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

        buildingName: d.BUILDING_NAME
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const street = `${s.street.name}${streetType}${streetSuffix}`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

            prefix: d.NUMBER_FIRST_PREFIX
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  fla.push(`${s.locality.name} ${s.state.abbreviation} ${s.postcode}`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  rval.sla = mapToSla(rval.mla)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const locality = context.localityIndexed[d.LOCALITY_PID]
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

        ...(d.LEVEL_GEOCODED_CODE !== '' && {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

            code: d.LEVEL_GEOCODED_CODE,
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

        ...(hasGeo && {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

    }),
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

              name: flatTypeCodeToName(d.FLAT_TYPE_CODE, context, d)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

        confidence: Number.parseInt(d.CONFIDENCE)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    rval.ssla = mapToSla(rval.smla)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

import Papa from 'papaparse'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

  store: new KeyvFile({ filename: 'target/keyv-file.msgpack' })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

const PAGE_SIZE = process.env.PAGE_SIZE || 8
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    return covered.split(',')
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

const ES_INDEX_NAME = process.env.ES_INDEX_NAME || 'addressr'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    logger('created', created)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    return complete_path
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                        callback(error_)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                        entry.autodrain()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                            callback()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace error_ with (error_)
Open

      fs.rename(incomplete_path, complete_path, error_ => {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  error(`Unknown Locality Class Code: '${code}'`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  return
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  let foundDefault = false
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  fla.push(`${number} ${street}`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ··''}${s.number.last.suffix·||·''}with}${s.number.last.suffix·||·''};
Open

        ''}${s.number.last.suffix || ''}`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    logger('FLA TOO LONG', fla, s)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ··········geocodes:·mapGeo(geoSite,·context,·geoDefault) with ············geocodes:·mapGeo(geoSite,·context,·geoDefault),
Open

          geocodes: mapGeo(geoSite, context, geoDefault)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  return rval
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  let age = 0
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        return cachedResponse
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const basename = path.basename(dataResource.url)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const incomplete_path = `${complete_path}/incomplete`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      error('Error downloading G-NAF', error_)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Definition for rule 'unicorn/prevent-abbreviations' was not found.
Open

/* eslint-disable eslint-comments/disable-enable-pair */
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

import debug from 'debug'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

import { initIndex, dropIndex as dropESIndex } from '../client/elasticsearch'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                            callback(error)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  await clearAddresses()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        else resolve()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    return destination
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      logger('Finished downloading G-NAF', destination)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

              const entryPath = `${incomplete_path}/${entry.path}`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                        return
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                        callback()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace console.log('be',·geo) with ··console.log('be',·geo);
Open

        console.log('be', geo)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          logger('finish')
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

              code: geo.GEOCODE_TYPE_CODE,
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace s.level.number·|| with ⏎········s.level.number·||·''
Open

      `${s.level.type.name || ''} ${s.level.prefix || ''}${s.level.number ||
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  error(`Unknown Street Type Code: '${code}'`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  error(`Unknown Geocode Reliability Code: '${code}'`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace .lotNumber.suffix·||·''}withs.lotNumber.suffix·||·''⏎····};
Open

      .lotNumber.suffix || ''}`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace entry with (entry)
Open

    entry => entry.CODE === code
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

      }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const street = `${s.street.name}${streetType}${streetSuffix}`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace throw·new·Error('encounterd·geo.PLANIMETRIC_ACCURACY') with ··throw·new·Error('encounterd·geo.PLANIMETRIC_ACCURACY');
Open

        throw new Error('encounterd geo.PLANIMETRIC_ACCURACY')
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    logger('FLA TOO LONG', fla, s)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

            type: {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

            number: d.LOT_NUMBER
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ··············name:·geocodeTypeCodeToName(geo.GEOCODE_TYPE_CODE,·context) with ················name:·geocodeTypeCodeToName(geo.GEOCODE_TYPE_CODE,·context),
Open

              name: geocodeTypeCodeToName(geo.GEOCODE_TYPE_CODE, context)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      logger(`${(i / count) * 100}%`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ·········· with ············
Open

          ...(geo.LATITUDE !== '' && {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace s.number⏎······.suffix·||·''}with⏎······s.number.suffix·||·''⏎····};
Open

    number = `${s.number.prefix || ''}${s.number.number || ''}${s.number
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ··''}${s.number.last.suffix·||·''}with}${s.number.last.suffix·||·''};
Open

        ''}${s.number.last.suffix || ''}`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    throw new Error('FLA TOO LONG')
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

              })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

            prefix: d.LEVEL_NUMBER_PREFIX
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

        }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Definition for rule 'unicorn/no-process-exit' was not found.
Open

/* eslint-disable eslint-comments/disable-enable-pair */
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

        timeout: process.env.ADDRESSR_INDEX_TIMEOUT || '300s'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

import got from 'got'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

      headers: response.headers
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    throw error_
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const pack = JSON.parse(response.body)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const complete_path = GNAF_DIR
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace error_ with (error_)
Open

    fs.mkdir(incomplete_path, { recursive: true }, error_ => {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const incomplete_path = `${GNAF_DIR}/incomplete/${basenameWithoutExtention}`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace error_ with (error_)
Open

                fs.mkdir(entryPath, { recursive: true }, error_ => {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                    entry.autodrain()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                        entry.autodrain()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace error with (error)
Open

                          .on('error', error => {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace entry with (entry)
Open

    entry => entry.CODE === code
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace entry with (entry)
Open

    entry => entry.CODE === code
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        geo.default = true
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

import crypto from 'crypto'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace description:·geo.GEOCODE_SITE_DESCRIPTION with ··description:·geo.GEOCODE_SITE_DESCRIPTION,
Open

          description: geo.GEOCODE_SITE_DESCRIPTION
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace longitude:·Number.parseFloat(geo.LONGITUDE) with ··longitude:·Number.parseFloat(geo.LONGITUDE),
Open

            longitude: Number.parseFloat(geo.LONGITUDE)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

      confidence: structurted.structurted.confidence
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Delete s
Open

    number = `LOT ${s.lotNumber.prefix || ''}${s.lotNumber.number || ''}${s
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    throw new Error('FLA TOO LONG')
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    age = Date.now() - created
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  logger('headers', JSON.stringify(response.headers, undefined, 2))
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      return destination
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace .lotNumber.suffix·||·''}withs.lotNumber.suffix·||·''⏎····};
Open

      .lotNumber.suffix || ''}`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    logger('before pipe')
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          resolve()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  fla.push(`${number} ${street}`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    return found.NAME
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    : undefined
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace entry with (entry)
Open

    entry => entry.CODE === code
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      (geoDefault !== undefined && geoDefault.length > 0))
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  return
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

                prefix: d.NUMBER_LAST_PREFIX
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

      }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

      name: l.STREET_NAME
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

        }),
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

            code: geo.RELIABILITY_CODE,
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace }) with ··}),
Open

        })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

      })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  rval.mla = mapToMla(rval.structured)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      logger('addr', JSON.stringify(rval, undefined, 2))
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Definition for rule 'unicorn/filename-case' was not found.
Open

/* eslint-disable eslint-comments/disable-enable-pair */
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

import directoryExists from 'directory-exists'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

var error = debug('error')
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  logger('basename', basename)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  error(`Unknown Street Class Code: '${code}'`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  error(`Unknown Street Suffix Code: '${code}'`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

      if (geo.ELEVATION !== '') {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

          reliability: {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ········ with ··········
Open

        ...(geo.LONGITUDE !== '' && {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

          ...(geo.GEOCODE_TYPE_CODE !== '' && {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  return fla.join(', ')
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  let number = ''
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const streetType = s.street.type ? ` ${s.street.type.name}` : ''
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const streetType = s.street.type ? ` ${s.street.type.name}` : ''
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ······} with ········},
Open

      }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

            number: Number.parseInt(d.LEVEL_NUMBER)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace (error_ with ((error_)
Open

            .catch(error_ => {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

import unzip from 'unzip-stream'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const packageUrl = GNAF_PACKAGE_URL
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    logger('Starting G-NAF download')
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                    callback(error_)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                    callback(error_)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          reject(error_)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  return
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    return found.NAME
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

      name: l.LOCALITY_NAME
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

        name: streetTypeCodeToName(l.STREET_TYPE_CODE, context)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace (geo with ((geo)
Open

    ? geoSite.map(geo => {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

      }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

        }),
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

        return {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

          default: true,
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace .number.suffix·||·''}withs.number.suffix·||·''⏎····};
Open

      .number.suffix || ''}`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

      geocoding: {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

          })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

            prefix: d.FLAT_NUMBER_PREFIX
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

              parser.resume()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

import path from 'path'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const covered = process.env.COVERED_STATES || ''
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  await initIndex(global.esClient, true)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const indexingBody = []
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace (row with ((row)
Open

  addr.forEach(row => {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

import glob from 'glob-promise'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

const COVERED_STATES = getCoveredStates()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

      }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    return response
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace error_ with (error_)
Open

    fs.mkdir(incomplete_path, { recursive: true }, error_ => {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    const { sla, ssla, ...structurted } = row
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      else resolve()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    const readStream = fs.createReadStream(file)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const destination = `${complete_path}/${basename}`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                        logger('extracting', entryPath)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const extname = path.extname(file)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    return found.NAME
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    logger('directory exits. Skipping extract', complete_path)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace entry with (entry)
Open

    entry => entry.CODE === code
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace error_ with (error_)
Open

      fs.mkdir(incomplete_path, { recursive: true }, error_ => {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    return found.NAME
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  return
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  return
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ········throw·new·Error('encounterd·geo.ELEVATION') with ··········throw·new·Error('encounterd·geo.ELEVATION');
Open

        throw new Error('encounterd geo.ELEVATION')
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  return
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

        default: geo.default || false,
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  return
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ········ with ··········
Open

        ...(geo.GEOCODE_TYPE_CODE !== '' && {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ··········} with ············},
Open

          }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

        name: localityClassCodeToName(l.LOCALITY_CLASS_CODE, context)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

        ...(geo.LATITUDE !== '' && {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ······} with ········};
Open

      }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ········throw·new·Error('encounterd·geo.GEOCODE_SITE_NAME') with ··········throw·new·Error('encounterd·geo.GEOCODE_SITE_NAME');
Open

        throw new Error('encounterd geo.GEOCODE_SITE_NAME')
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ··········}) with ············}),
Open

          })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ············latitude:·Number.parseFloat(geo.LATITUDE) with ··············latitude:·Number.parseFloat(geo.LATITUDE),
Open

            latitude: Number.parseFloat(geo.LATITUDE)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Delete ''
Open

      ''}${s.level.suffix || ''}`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    fla[1] = `${fla[0]}, ${fla[1]}`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace s.number.last.number·|| with ⏎········s.number.last.number·||·''
Open

      number = `${number}-${s.number.last.prefix || ''}${s.number.last.number ||
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Delete s
Open

    number = `${number}${s.number.prefix || ''}${s.number.number || ''}${s
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const streetSuffix = s.street.suffix ? ` ${s.street.suffix.name}` : ''
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const streetLocality = context.streetLocalityIndexed[d.STREET_LOCALITY_PID]
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace s.number.last.number·|| with ⏎········s.number.last.number·||·''
Open

      number = `${number}-${s.number.last.prefix || ''}${s.number.last.number ||
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace name:·levelGeocodedCodeToName(d.LEVEL_GEOCODED_CODE,·context) with ··name:·levelGeocodedCodeToName(d.LEVEL_GEOCODED_CODE,·context),
Open

            name: levelGeocodedCodeToName(d.LEVEL_GEOCODED_CODE, context)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

                number: Number.parseInt(d.NUMBER_LAST)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

        }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

            suffix: d.LEVEL_NUMBER_SUFFIX
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

            suffix: d.FLAT_NUMBER_SUFFIX
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

        }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

        abbreviation: context.state
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

      }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

    pid: d.ADDRESS_DETAIL_PID
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        const items = []
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Definition for rule 'unicorn/no-null' was not found.
Open

/* eslint-disable eslint-comments/disable-enable-pair */
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

import { setLinkOptions } from './setLinkOptions'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

const ONE_DAY_S = 60 /*sec*/ * 60 /*min*/ * 24 /*hours*/
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

const THIRTY_DAYS_MS = ONE_DAY_MS * 30
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        cachedResponse.headers['warning'] = '110    custom/1.0 "Response is Stale"'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  logger('dataResource', JSON.stringify(dataResource, undefined, 2))
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      throw error_
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                    entry.autodrain()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                            logger('error unzipping entry', error)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    return found.NAME
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace console.log('pa',·geo) with ··console.log('pa',·geo);
Open

        console.log('pa', geo)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ········console.log('gsn',·geo) with ··········console.log('gsn',·geo);
Open

        console.log('gsn', geo)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ············name:·geocodeReliabilityCodeToName(geo.RELIABILITY_CODE,·context) with ··············name:·geocodeReliabilityCodeToName(geo.RELIABILITY_CODE,·context),
Open

            name: geocodeReliabilityCodeToName(geo.RELIABILITY_CODE, context)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ··········latitude:·Number.parseFloat(geo.LATITUDE) with ············latitude:·Number.parseFloat(geo.LATITUDE),
Open

          latitude: Number.parseFloat(geo.LATITUDE)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

          }),
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Delete s
Open

      `${s.flat.type.name || ''} ${s.flat.prefix || ''}${s.flat.number || ''}${s
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  return fla
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ··
Open

          level: {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ········}) with ··········}),
Open

        })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

            number: Number.parseInt(d.NUMBER_FIRST)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

              name: levelTypeCodeToName(d.LEVEL_TYPE_CODE, context, d)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

            }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

          })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

        }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

                  operator: 'AND'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          error(`Errors reading '${file}': ${chunk.errors}`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

              throw error_
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        loadContext.geoDefaultIndexed = {}
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    await fsp.access(countsFile, fs.constants.F_OK)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          resolve(results.data)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          console.log(error, file)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    return []
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace f with (f)
Open

  const geoFile = files.find(f =>
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

      type: 'text/html'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

        ...(q !== undefined && { q })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Delete ··
Open

            ...(q !== undefined && { q }),
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          actualCount += 1
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        resolve(results.data[0].STATE_NAME)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace type with (type)
Open

    .map(type => {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    filesCounts = await loadFileCounts(countsFile)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  logger('addressDetailFiles', addressDetailFiles)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      loadContext.stateName = await loadState(files, directory, state)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      loadContext.localityIndexed = {}
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        loadContext.localityIndexed[l.LOCALITY_PID] = l
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  logger('filesCounts', filesCounts)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace f with (f)
Open

  const geoFile = files.find(f =>
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

            parser.resume()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  logger('AUTH', loadContext)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  console.log(gnafDir)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Delete ··
Open

          }${new URLSearchParams({
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      return { statusCode: 503, json: { error: 'service unavailable' } }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

        }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

      }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          const { sla, ssla, ...structured } = item
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          parser.resume()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

      }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      error(`count: ${count}`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  return synonyms
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const countsFile = `${directory}/Counts.csv`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      const streetLocality = await loadStreetLocality(files, directory, state)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    return false
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        resolve()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    const expectedCount = filesCounts[geoFile]
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          parser.pause()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

              count += 1
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

            error({ errors: chunk.errors })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          reject(error)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

              )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const gnafDir = await glob('**/G-NAF/', { cwd: unzipped })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    const responseBody = mapToSearchAddressResponse(foundAddresses)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      return { statusCode: 504, json: { error: 'gateway timeout' } }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      return { statusCode: 500, json: { error: 'unexpected error' } }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        const indexingBody = []
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

      }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        throw resp
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

            confidence: structured.structured.confidence
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Possible race condition: backoff might be reassigned based on an outdated value of backoff.
Open

      backoff = Math.min(
Severity: Minor
Found in service/address-service.js by eslint

Disallow assignments that can lead to race conditions due to usage of await or yield (require-atomic-updates)

When writing asynchronous code, it is possible to create subtle race condition bugs. Consider the following example:

let totalLength = 0;

async function addLengthOfSinglePage(pageNum) {
  totalLength += await getPageLength(pageNum);
}

Promise.all([addLengthOfSinglePage(1), addLengthOfSinglePage(2)]).then(() => {
  console.log('The combined length of both pages is', totalLength);
});

This code looks like it will sum the results of calling getPageLength(1) and getPageLength(2), but in reality the final value of totalLength will only be the length of one of the two pages. The bug is in the statement totalLength += await getPageLength(pageNum);. This statement first reads an initial value of totalLength, then calls getPageLength(pageNum) and waits for that Promise to fulfill. Finally, it sets the value of totalLength to the sum of await getPageLength(pageNum) and the initial value of totalLength. If the totalLength variable is updated in a separate function call during the time that the getPageLength(pageNum) Promise is pending, that update will be lost because the new value is overwritten without being read.

One way to fix this issue would be to ensure that totalLength is read at the same time as it's updated, like this:

async function addLengthOfSinglePage(pageNum) {
  const lengthOfThisPage = await getPageLength(pageNum);

  totalLength += lengthOfThisPage;
}

Another solution would be to avoid using a mutable variable reference at all:

Promise.all([getPageLength(1), getPageLength(2)]).then(pageLengths => {
  const totalLength = pageLengths.reduce((accumulator, length) => accumulator + length, 0);

  console.log('The combined length of both pages is', totalLength);
});

Rule Details

This rule aims to report assignments to variables or properties where all of the following are true:

  • A variable or property is reassigned to a new value which is based on its old value.
  • A yield or await expression interrupts the assignment after the old value is read, and before the new value is set.
  • The rule cannot easily verify that the assignment is safe (e.g. if an assigned variable is local and would not be readable from anywhere else while the function is paused).

Examples of incorrect code for this rule:

/* eslint require-atomic-updates: error */

let result;
async function foo() {
  result += await somethingElse;

  result = result + await somethingElse;

  result = result + doSomething(await somethingElse);
}

function* bar() {
  result += yield;

  result = result + (yield somethingElse);

  result = result + doSomething(yield somethingElse);
}

Examples of correct code for this rule:

/* eslint require-atomic-updates: error */

let result;
async function foo() {
  result = await somethingElse + result;

  let tmp = await somethingElse;
  result += tmp;

  let localVariable = 0;
  localVariable += await somethingElse;
}

function* bar() {
  result += yield;

  result = (yield somethingElse) + result;

  result = doSomething(yield somethingElse, result);
}

When Not To Use It

If you don't use async or generator functions, you don't need to enable this rule. Source: http://eslint.org/docs/rules/

Insert ;
Open

      )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      return type.CODE !== type.NAME
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      const res = `${currentDir}/${dirent.name}`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      return dirent.isDirectory() ? getFiles(res, baseDir) : res
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      const lines = await countFileLines(`${directory}/${file}`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        logger('Address details loaded', context.state, expectedCount || '')
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      logger('Loading streets', state)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      loadContext.streetLocalityIndexed = {}
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        }, backoff)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

              }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          error({ errors: row.errors })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        console.log(error, file)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    error(`Could not find state file '${state}_STATE_psv.psv'`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    logger('files', files)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

const { readdir } = require('fs').promises
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace (f with ((f)
Open

  const localityFile = files.find(f =>
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        logger(`Skipping geos. set 'ADDRESSR_ENABLE_GEO' env var to enable`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace (dirent with ((dirent)
Open

    dirents.map(dirent => {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        console.log('GNAF data loaded')
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    return []
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

            error(`Errors reading '${directory}/${geoFile}': ${chunk.errors}`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const synonyms = buildSynonyms(loadContext)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                  )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

            })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      .replace(/_.*/, '')
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                loadContext.geoDefaultIndexed[g.ADDRESS_DETAIL_PID].push(g)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          loadContext[contextKey] = results.data
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        await loadSiteGeo(files, directory, state, loadContext, filesCounts)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

      sla: jsonX.body._source.sla
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

              resolve()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace results with (results)
Open

        complete: results => {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          reject(error)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

        }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                  )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          resolve()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    logger('jsonX', jsonX)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace h with (h)
Open

  return foundAddresses.body.hits.hits.map(h => {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

            error(`Errors reading '${directory}/${geoFile}': ${chunk.errors}`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

              )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

        }).toString()}`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          error(`Error loading '${directory}/${authFile}`, error, file)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  logger('Data dir', unzipped)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    return { link, json: responseBody, linkTemplate }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const contents = await fsp.readdir(unzipped)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      return { statusCode: 404, json: { error: 'not found' } }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  let actualCount = 0
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    const op = swagger.path.get
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          error({ errors: chunk.errors })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace row with (row)
Open

        chunk.data.forEach(row => {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

                }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  return searchResp
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      error(`backing off for ${backoff}ms`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      error(`next backoff: ${backoff}ms`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace results with (results)
Open

      complete: results => {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  let countsFileExists = await fileExists(countsFile)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        reject(error)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

      }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

            }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    return name
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

              return
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace results with (results)
Open

        complete: results => {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          reject(error)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

            ]
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    let count = 0
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  ]
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                loadContext.geoIndexed[g.ADDRESS_SITE_PID].push(g)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      filesCounts[file] = lines - 1
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace f·=>·f.match(new·RegExp(${state}_STATE_psv))) with (f)·=>⏎····f.match(new·RegExp(${state}_STATE_psv))⏎··);
Open

  const stateFile = files.find(f => f.match(new RegExp(`${state}_STATE_psv`)))
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    return []
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          console.log(error, file)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          console.log(error, file)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  logger('authCodeFiles', authCodeFiles)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

      uri: `/addresses/${addressId}`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    throw new Error(`Data dir '${unzipped}' is empty`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    throw new Error(`Cannot find 'G-NAF' directory in Data dir '${unzipped}'`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const mainDirectory = path.dirname(`${unzipped}/${gnafDir[0].slice(0, -1)}`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    logger('PAGE_SIZE * p', PAGE_SIZE * p)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  await loadGnafData(mainDirectory, { refresh })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    logger('TOTAL', foundAddresses.body.hits.total.value)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

          href: h._id
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        loadContext.geoIndexed = {}
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    const name = await getStateName(state, `${directory}/${stateFile}`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  logger('Loading site geos')
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    return []
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

      id: `/addresses/${addressId}`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    delete json._id
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    const link = new LinkHeader()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    logger('foundAddresses', foundAddresses)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    logger('responseBody', JSON.stringify(responseBody, undefined, 2))
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    error('error querying elastic search', error_)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

                }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

        }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      return
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      return `${type.CODE} => ${type.NAME}`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    files = []
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      const locality = await loadLocality(files, directory, state)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    error(err)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  return filesCounts
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const contents = await fsp.readFile(contentsFile)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace line·=>·line.trim()) with (line)·=>·line.trim());
Open

    .map(line => line.trim())
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    return
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    error(`Could not find locality file '${state}_LOCALITY_psv.psv'`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

            parser.resume()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      return { statusCode: 503, json: { error: 'service unavailable' } }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ··...(p·>·2·&&·{·p:·p·-·1·}) with ...(p·>·2·&&·{·p:·p·-·1·}),
Open

            ...(p > 2 && { p: p - 1 })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    logger('next?', foundAddresses.body.hits.total.value > PAGE_SIZE * p)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

            })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Delete
Open

        }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  logger('hits', JSON.stringify(searchResp.body.hits, undefined, 2))
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  return Array.prototype.concat(...files)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const loadContext = {}
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

          })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

    }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      loadContext.state = state
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

    ...streetSuffixTypes
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    return true
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    files = await getFiles('.', directory)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace f with (f)
Open

  const localityFile = files.find(f =>
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      logger('Loading suburbs', state)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    let count = 0
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

        }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                loadContext.geoIndexed[g.ADDRESS_SITE_PID] = [g]
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const unzipped = await unzipFile(file)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

        }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

      uri: `${url}${spString === '' ? '' : '?'}${spString}`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

      }).toString()}`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    const expectedCount = filesCounts[geoFile]
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          resolve()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  logger('Data dir contents', contents)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    logger('json', json)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    const link = new LinkHeader()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ⏎··········
Open

        uri: `${url}${q === undefined && p == 2 ? '' : '?'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace type with (type)
Open

    .filter(type => {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  logger(`reading ${dir} (${currentDir} in ${baseDir})`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace with ;
Open

        filesCounts[psvFile] = row.data.Count
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        console.log(error, file)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      logger('addr', JSON.stringify(rval, undefined, 2))
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

            error({ errors: chunk.errors })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        parser.pause()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        error(_error, file)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace row with (row)
Open

            chunk.data.forEach(row => {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        reject()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    logger(`loaded '${actualCount}' rows from '${file}'`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          console.log(error, file)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

        }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      error('Indexing error', JSON.stringify(error_, undefined, 2))
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

              count += 1
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          resolve()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

      ...(p !== 1 && { p })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        loadContext.streetLocalityIndexed[sl.STREET_LOCALITY_PID] = sl
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    const spString = sp.toString()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const filesCounts = {}
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          error(`Errors reading '${countsFile}': ${row.errors}`)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

        }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace (f·=>·f.match(/Authority·Code/)) with ((f)·=>·f.match(/Authority·Code/));
Open

  const authCodeFiles = files.filter(f => f.match(/Authority Code/))
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    const contextKey = path.basename(authFile, path.extname(authFile))
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const file = await fetchGnafFile()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  logger('Main Data dir', mainDirectory)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    error('error getting record from elastic search', error_)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      return { statusCode: 500, json: { error: 'unexpected error' } }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

          p: p + 1
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    const linkTemplate = new LinkHeader()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        resolve()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

                  operator: 'AND'
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  let backoff = initialBackoff
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace (resolve with ((resolve)
Open

      await new Promise(resolve => {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        reject(error)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

      }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  const dir = path.resolve(baseDir, currentDir)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  await loadAuthFiles(files, directory, loadContext, filesCounts)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        await loadDefaultGeo(files, directory, state, loadContext, filesCounts)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

        )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

        }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

              const g = row
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

            })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  logger('Loading default geos')
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          parser.pause()
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

              const g = row
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

                loadContext.geoDefaultIndexed[g.ADDRESS_DETAIL_PID] = [g]
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

              )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          reject([`Error loading '${directory}/${authFile}`, error, file])
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

              error('error sending index request', error_)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    const foundAddresses = await searchForAddress(q, p)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

        { 'sla.raw': { order: 'asc' } }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    setLinkOptions(op, url, linkTemplate)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ,
Open

          ssla: {}
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Possible race condition: backoff might be reassigned based on an outdated value of backoff.
Open

      backoff += Number.parseInt(
Severity: Minor
Found in service/address-service.js by eslint

Disallow assignments that can lead to race conditions due to usage of await or yield (require-atomic-updates)

When writing asynchronous code, it is possible to create subtle race condition bugs. Consider the following example:

let totalLength = 0;

async function addLengthOfSinglePage(pageNum) {
  totalLength += await getPageLength(pageNum);
}

Promise.all([addLengthOfSinglePage(1), addLengthOfSinglePage(2)]).then(() => {
  console.log('The combined length of both pages is', totalLength);
});

This code looks like it will sum the results of calling getPageLength(1) and getPageLength(2), but in reality the final value of totalLength will only be the length of one of the two pages. The bug is in the statement totalLength += await getPageLength(pageNum);. This statement first reads an initial value of totalLength, then calls getPageLength(pageNum) and waits for that Promise to fulfill. Finally, it sets the value of totalLength to the sum of await getPageLength(pageNum) and the initial value of totalLength. If the totalLength variable is updated in a separate function call during the time that the getPageLength(pageNum) Promise is pending, that update will be lost because the new value is overwritten without being read.

One way to fix this issue would be to ensure that totalLength is read at the same time as it's updated, like this:

async function addLengthOfSinglePage(pageNum) {
  const lengthOfThisPage = await getPageLength(pageNum);

  totalLength += lengthOfThisPage;
}

Another solution would be to avoid using a mutable variable reference at all:

Promise.all([getPageLength(1), getPageLength(2)]).then(pageLengths => {
  const totalLength = pageLengths.reduce((accumulator, length) => accumulator + length, 0);

  console.log('The combined length of both pages is', totalLength);
});

Rule Details

This rule aims to report assignments to variables or properties where all of the following are true:

  • A variable or property is reassigned to a new value which is based on its old value.
  • A yield or await expression interrupts the assignment after the old value is read, and before the new value is set.
  • The rule cannot easily verify that the assignment is safe (e.g. if an assigned variable is local and would not be readable from anywhere else while the function is paused).

Examples of incorrect code for this rule:

/* eslint require-atomic-updates: error */

let result;
async function foo() {
  result += await somethingElse;

  result = result + await somethingElse;

  result = result + doSomething(await somethingElse);
}

function* bar() {
  result += yield;

  result = result + (yield somethingElse);

  result = result + doSomething(yield somethingElse);
}

Examples of correct code for this rule:

/* eslint require-atomic-updates: error */

let result;
async function foo() {
  result = await somethingElse + result;

  let tmp = await somethingElse;
  result += tmp;

  let localVariable = 0;
  localVariable += await somethingElse;
}

function* bar() {
  result += yield;

  result = (yield somethingElse) + result;

  result = doSomething(yield somethingElse, result);
}

When Not To Use It

If you don't use async or generator functions, you don't need to enable this rule. Source: http://eslint.org/docs/rules/

Insert ;
Open

  const dirents = await readdir(dir, { withFileTypes: true })
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    files = Object.keys(filesCounts)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace f with (f)
Open

    f => f.match(/ADDRESS_DETAIL/) && f.match(/\/Standard\//)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

  )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    )
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          resolve(results.data)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

          reject(error)
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace row with (row)
Open

            chunk.data.forEach(row => {
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

      .digest('hex')
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Insert ;
Open

    return { link, json, hash }
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Replace ··········}).toString()}with········}).toString()},
Open

          }).toString()}`
Severity: Minor
Found in service/address-service.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

There are no issues that match your filters.

Category
Status