'loadFileContents' is defined but never used. Open
async function loadFileContents(contentsFile) {
- Read upRead up
- Exclude checks
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
orcommonjs
- when
parserOptions.sourceType
ismodule
- when
ecmaFeatures.globalReturn
istrue
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
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
var logger = debug('api')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const cachedResponse = await cache.get(packageUrl)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
headers: response.headers
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace error_
with (error_)
Open
fs.access(destination, fs.constants.R_OK, error_ => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const basenameWithoutExtention = path.basename(file, extname)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
else resolve()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const dirname = path.dirname(entryPath)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('skipping extract for', entryPath)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace entry
with (entry)
Open
entry => entry.CODE === code
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error({ address })
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return found.NAME
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
type: {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
...(geo.GEOCODE_SITE_DESCRIPTION !== '' && {
- Read upRead up
- Exclude checks
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 ||
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
postcode: d.POSTCODE
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
_id: `/addresses/${item.pid}`
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
import Keyv from 'keyv'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return cachedResponse
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const response = await got.get(packageUrl)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
entry.autodrain()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
callback()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace error_
with (error_)
Open
fs.mkdir(dirname, { recursive: true }, error_ => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('error statting file', error_)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error({ address })
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace geo
with (geo)
Open
geoSite.forEach(geo => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
geo.default = false
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
if (geo.PLANIMETRIC_ACCURACY !== '') {
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
}
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ············}
with ··············},
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
}),
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
...(geo.LONGITUDE !== '' && {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
: []
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return sites.concat(def)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
let number = ''
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const streetSuffix = s.street.suffix ? ` ${s.street.suffix.code}` : ''
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
rval.smla = mapToShortMla(rval.structured)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
import LinkHeader from 'http-link-header'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('cached gnaf package data', cachedResponse)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
import stream from 'stream'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const ONE_DAY_MS = 1000 * ONE_DAY_S
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
if (error_) reject(error_)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
_id: row.links.self.href
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
if (error_) reject(error_)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const created = new Date(cachedResponse.headers.date)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
if (error_) reject(error_)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return found.NAME
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('error unzipping data file', error_)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error(`Unknown Geocode Type Code: '${code}'`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace entry
with (entry)
Open
entry => entry.CODE === code
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return found.NAME
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
foundDefault = true
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
if (geo.BOUNDARY_EXTENT !== '') {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace }
with ··},
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
if (geo.GEOCODE_SITE_NAME !== '') {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
}),
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
: []
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ······''}/
with
····}/;
Open
''}/`
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete s
Open
number = `${number}${s.lotNumber.prefix || ''}${s.lotNumber.number || ''}${s
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('response.isFromCache', response.fromCache)
- Read upRead up
- Exclude checks
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 ||
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
import fs from 'fs'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const GNAF_DIR = process.env.GNAF_DIR || `target/gnaf`
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
import download from '../utils/stream-down'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ''
Open
''}${s.level.suffix || ''}`
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
suffix: d.NUMBER_FIRST_SUFFIX
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace r
with (r)
Open
r => r.state === 'active' && r.mimetype === 'application/zip'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
import { KeyvFile } from 'keyv-file'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
: undefined
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
suffix: d.NUMBER_LAST_SUFFIX
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return []
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('url', dataResource.url)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
await dropESIndex(global.esClient)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
prefix: d.LOT_NUMBER_PREFIX
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
suffix: d.LOT_NUMBER_SUFFIX
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
await sendIndexRequest(indexingBody)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
precedence: d.PRIMARY_SECONDARY === 'P' ? 'primary' : 'secondary'
- Read upRead up
- Exclude checks
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'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ··········}
with ············},
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
items.push(item)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
cachedResponse.headers['x-cache'] = 'HIT'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
await fsp.rename(`${incomplete_path}/${basename}`, destination)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
response.headers['x-cache'] = 'MISS'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
number: Number.parseInt(d.FLAT_NUMBER)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const complete_path = `${GNAF_DIR}/${basenameWithoutExtention}`
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const response = await fetchPackageData()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const exists = await directoryExists(complete_path)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('finished extracting', entryPath)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
await prom
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger(`${i} rows`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
else resolve()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
else resolve(complete_path)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
if (error_) reject(error_)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error(`Unknown Flat Type Code: '${code}'`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
if (error_) reject(error_)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace entry
with (entry)
Open
entry => entry.CODE === code
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace error_
with (error_)
Open
.on('error', error_ => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error(`Unknown Level Type Code: '${code}'`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return found.NAME
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
name: streetClassCodeToName(l.STREET_CLASS_CODE, context)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
name: streetSuffixCodeToName(l.STREET_SUFFIX_CODE, context)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace entry
with (entry)
Open
entry => entry.CODE === code
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
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')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
return {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
...(geo.RELIABILITY_CODE !== '' && {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
}),
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········}
with ··········};
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const fla = []
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ············
with ··············
Open
code: geo.GEOCODE_TYPE_CODE,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
fla.push(s.buildingName)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
fla.shift()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace geo
with (geo)
Open
? geoDefault.map(geo => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const fla = []
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace .flat.suffix·||·''
with s.flat.suffix·||·''⏎······
Open
.flat.suffix || ''}`
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return fla
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
}),
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
fla.push(`${s.locality.name} ${s.state.abbreviation} ${s.postcode}`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
buildingName: d.BUILDING_NAME
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const street = `${s.street.name}${streetType}${streetSuffix}`
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
prefix: d.NUMBER_FIRST_PREFIX
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
fla.push(`${s.locality.name} ${s.state.abbreviation} ${s.postcode}`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
rval.sla = mapToSla(rval.mla)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const locality = context.localityIndexed[d.LOCALITY_PID]
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
...(d.LEVEL_GEOCODED_CODE !== '' && {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
code: d.LEVEL_GEOCODED_CODE,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
...(hasGeo && {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
}),
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
name: flatTypeCodeToName(d.FLAT_TYPE_CODE, context, d)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
confidence: Number.parseInt(d.CONFIDENCE)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
rval.ssla = mapToSla(rval.smla)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
import Papa from 'papaparse'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
store: new KeyvFile({ filename: 'target/keyv-file.msgpack' })
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const PAGE_SIZE = process.env.PAGE_SIZE || 8
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return covered.split(',')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const ES_INDEX_NAME = process.env.ES_INDEX_NAME || 'addressr'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('created', created)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return complete_path
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
callback(error_)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
entry.autodrain()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
callback()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace error_
with (error_)
Open
fs.rename(incomplete_path, complete_path, error_ => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error(`Unknown Locality Class Code: '${code}'`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
let foundDefault = false
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
fla.push(`${number} ${street}`)
- Read upRead up
- Exclude checks
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 || ''}`
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('FLA TOO LONG', fla, s)
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return rval
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
let age = 0
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return cachedResponse
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const basename = path.basename(dataResource.url)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const incomplete_path = `${complete_path}/incomplete`
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error('Error downloading G-NAF', error_)
- Read upRead up
- Exclude checks
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 */
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
import debug from 'debug'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
import { initIndex, dropIndex as dropESIndex } from '../client/elasticsearch'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
callback(error)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
await clearAddresses()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
else resolve()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return destination
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('Finished downloading G-NAF', destination)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const entryPath = `${incomplete_path}/${entry.path}`
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
callback()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
})
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('finish')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
code: geo.GEOCODE_TYPE_CODE,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
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 ||
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error(`Unknown Street Type Code: '${code}'`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error(`Unknown Geocode Reliability Code: '${code}'`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace .lotNumber.suffix·||·''}
with
s.lotNumber.suffix·||·''⏎····};
Open
.lotNumber.suffix || ''}`
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace entry
with (entry)
Open
entry => entry.CODE === code
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const street = `${s.street.name}${streetType}${streetSuffix}`
- Read upRead up
- Exclude checks
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')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('FLA TOO LONG', fla, s)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
type: {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
number: d.LOT_NUMBER
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger(`${(i / count) * 100}%`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ··········
with ············
Open
...(geo.LATITUDE !== '' && {
- Read upRead up
- Exclude checks
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
- Read upRead up
- Exclude checks
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 || ''}`
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
throw new Error('FLA TOO LONG')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
prefix: d.LEVEL_NUMBER_PREFIX
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
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 */
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
timeout: process.env.ADDRESSR_INDEX_TIMEOUT || '300s'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
import got from 'got'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
headers: response.headers
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
throw error_
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const pack = JSON.parse(response.body)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const complete_path = GNAF_DIR
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace error_
with (error_)
Open
fs.mkdir(incomplete_path, { recursive: true }, error_ => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const incomplete_path = `${GNAF_DIR}/incomplete/${basenameWithoutExtention}`
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace error_
with (error_)
Open
fs.mkdir(entryPath, { recursive: true }, error_ => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
entry.autodrain()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
entry.autodrain()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace error
with (error)
Open
.on('error', error => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace entry
with (entry)
Open
entry => entry.CODE === code
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace entry
with (entry)
Open
entry => entry.CODE === code
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
geo.default = true
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
import crypto from 'crypto'
- Read upRead up
- Exclude checks
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
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
confidence: structurted.structurted.confidence
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete s
Open
number = `LOT ${s.lotNumber.prefix || ''}${s.lotNumber.number || ''}${s
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
throw new Error('FLA TOO LONG')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
age = Date.now() - created
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('headers', JSON.stringify(response.headers, undefined, 2))
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return destination
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace .lotNumber.suffix·||·''}
with
s.lotNumber.suffix·||·''⏎····};
Open
.lotNumber.suffix || ''}`
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('before pipe')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
resolve()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
fla.push(`${number} ${street}`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return found.NAME
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
: undefined
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace entry
with (entry)
Open
entry => entry.CODE === code
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
(geoDefault !== undefined && geoDefault.length > 0))
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
prefix: d.NUMBER_LAST_PREFIX
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
name: l.STREET_NAME
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
}),
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
code: geo.RELIABILITY_CODE,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace })
with ··}),
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
rval.mla = mapToMla(rval.structured)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('addr', JSON.stringify(rval, undefined, 2))
- Read upRead up
- Exclude checks
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 */
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
import directoryExists from 'directory-exists'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
var error = debug('error')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('basename', basename)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error(`Unknown Street Class Code: '${code}'`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error(`Unknown Street Suffix Code: '${code}'`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
if (geo.ELEVATION !== '') {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
reliability: {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········
with ··········
Open
...(geo.LONGITUDE !== '' && {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
...(geo.GEOCODE_TYPE_CODE !== '' && {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return fla.join(', ')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
let number = ''
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const streetType = s.street.type ? ` ${s.street.type.name}` : ''
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const streetType = s.street.type ? ` ${s.street.type.name}` : ''
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ······}
with ········},
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
number: Number.parseInt(d.LEVEL_NUMBER)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace (error_
with ((error_)
Open
.catch(error_ => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
import unzip from 'unzip-stream'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const packageUrl = GNAF_PACKAGE_URL
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('Starting G-NAF download')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
callback(error_)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
callback(error_)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
reject(error_)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return found.NAME
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
name: l.LOCALITY_NAME
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
name: streetTypeCodeToName(l.STREET_TYPE_CODE, context)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace (geo
with ((geo)
Open
? geoSite.map(geo => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
}),
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
return {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
default: true,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace .number.suffix·||·''}
with
s.number.suffix·||·''⏎····};
Open
.number.suffix || ''}`
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
geocoding: {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
prefix: d.FLAT_NUMBER_PREFIX
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
parser.resume()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
import path from 'path'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const covered = process.env.COVERED_STATES || ''
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
await initIndex(global.esClient, true)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const indexingBody = []
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace (row
with ((row)
Open
addr.forEach(row => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
import glob from 'glob-promise'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const COVERED_STATES = getCoveredStates()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return response
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace error_
with (error_)
Open
fs.mkdir(incomplete_path, { recursive: true }, error_ => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const { sla, ssla, ...structurted } = row
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
else resolve()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const readStream = fs.createReadStream(file)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const destination = `${complete_path}/${basename}`
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('extracting', entryPath)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const extname = path.extname(file)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return found.NAME
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('directory exits. Skipping extract', complete_path)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace entry
with (entry)
Open
entry => entry.CODE === code
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace error_
with (error_)
Open
fs.mkdir(incomplete_path, { recursive: true }, error_ => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return found.NAME
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return
- Read upRead up
- Exclude checks
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')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
default: geo.default || false,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········
with ··········
Open
...(geo.GEOCODE_TYPE_CODE !== '' && {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ··········}
with ············},
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
name: localityClassCodeToName(l.LOCALITY_CLASS_CODE, context)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
...(geo.LATITUDE !== '' && {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ······}
with ········};
Open
}
- Read upRead up
- Exclude checks
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')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ··········})
with ············}),
Open
})
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ''
Open
''}${s.level.suffix || ''}`
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
fla[1] = `${fla[0]}, ${fla[1]}`
- Read upRead up
- Exclude checks
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 ||
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete s
Open
number = `${number}${s.number.prefix || ''}${s.number.number || ''}${s
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const streetSuffix = s.street.suffix ? ` ${s.street.suffix.name}` : ''
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const streetLocality = context.streetLocalityIndexed[d.STREET_LOCALITY_PID]
- Read upRead up
- Exclude checks
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 ||
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
number: Number.parseInt(d.NUMBER_LAST)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
suffix: d.LEVEL_NUMBER_SUFFIX
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
suffix: d.FLAT_NUMBER_SUFFIX
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
abbreviation: context.state
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
pid: d.ADDRESS_DETAIL_PID
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const items = []
- Read upRead up
- Exclude checks
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 */
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
import { setLinkOptions } from './setLinkOptions'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const ONE_DAY_S = 60 /*sec*/ * 60 /*min*/ * 24 /*hours*/
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const THIRTY_DAYS_MS = ONE_DAY_MS * 30
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
cachedResponse.headers['warning'] = '110 custom/1.0 "Response is Stale"'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('dataResource', JSON.stringify(dataResource, undefined, 2))
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
throw error_
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
entry.autodrain()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('error unzipping entry', error)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return found.NAME
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
}),
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete s
Open
`${s.flat.type.name || ''} ${s.flat.prefix || ''}${s.flat.number || ''}${s
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return fla
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ··
Open
level: {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········})
with ··········}),
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
number: Number.parseInt(d.NUMBER_FIRST)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
name: levelTypeCodeToName(d.LEVEL_TYPE_CODE, context, d)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
operator: 'AND'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error(`Errors reading '${file}': ${chunk.errors}`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
throw error_
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
loadContext.geoDefaultIndexed = {}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
await fsp.access(countsFile, fs.constants.F_OK)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
resolve(results.data)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
console.log(error, file)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return []
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace f
with (f)
Open
const geoFile = files.find(f =>
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
type: 'text/html'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
...(q !== undefined && { q })
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
...(q !== undefined && { q }),
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
actualCount += 1
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
resolve(results.data[0].STATE_NAME)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace type
with (type)
Open
.map(type => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
filesCounts = await loadFileCounts(countsFile)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('addressDetailFiles', addressDetailFiles)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
loadContext.stateName = await loadState(files, directory, state)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
loadContext.localityIndexed = {}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
loadContext.localityIndexed[l.LOCALITY_PID] = l
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('filesCounts', filesCounts)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace f
with (f)
Open
const geoFile = files.find(f =>
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
parser.resume()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('AUTH', loadContext)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
console.log(gnafDir)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
}${new URLSearchParams({
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return { statusCode: 503, json: { error: 'service unavailable' } }
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const { sla, ssla, ...structured } = item
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
parser.resume()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error(`count: ${count}`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return synonyms
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const countsFile = `${directory}/Counts.csv`
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const streetLocality = await loadStreetLocality(files, directory, state)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return false
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
resolve()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const expectedCount = filesCounts[geoFile]
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
parser.pause()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
count += 1
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error({ errors: chunk.errors })
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
reject(error)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const gnafDir = await glob('**/G-NAF/', { cwd: unzipped })
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const responseBody = mapToSearchAddressResponse(foundAddresses)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return { statusCode: 504, json: { error: 'gateway timeout' } }
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return { statusCode: 500, json: { error: 'unexpected error' } }
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const indexingBody = []
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
throw resp
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
confidence: structured.structured.confidence
- Read upRead up
- Exclude checks
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(
- Read upRead up
- Exclude checks
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
orawait
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
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return type.CODE !== type.NAME
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const res = `${currentDir}/${dirent.name}`
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return dirent.isDirectory() ? getFiles(res, baseDir) : res
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const lines = await countFileLines(`${directory}/${file}`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('Address details loaded', context.state, expectedCount || '')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('Loading streets', state)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
loadContext.streetLocalityIndexed = {}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
}, backoff)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error({ errors: row.errors })
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
console.log(error, file)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error(`Could not find state file '${state}_STATE_psv.psv'`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('files', files)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const { readdir } = require('fs').promises
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace (f
with ((f)
Open
const localityFile = files.find(f =>
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger(`Skipping geos. set 'ADDRESSR_ENABLE_GEO' env var to enable`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace (dirent
with ((dirent)
Open
dirents.map(dirent => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
console.log('GNAF data loaded')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return []
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error(`Errors reading '${directory}/${geoFile}': ${chunk.errors}`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const synonyms = buildSynonyms(loadContext)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
.replace(/_.*/, '')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
loadContext.geoDefaultIndexed[g.ADDRESS_DETAIL_PID].push(g)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
loadContext[contextKey] = results.data
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
await loadSiteGeo(files, directory, state, loadContext, filesCounts)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
sla: jsonX.body._source.sla
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
resolve()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace results
with (results)
Open
complete: results => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
reject(error)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
resolve()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('jsonX', jsonX)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace h
with (h)
Open
return foundAddresses.body.hits.hits.map(h => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error(`Errors reading '${directory}/${geoFile}': ${chunk.errors}`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}).toString()}`
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error(`Error loading '${directory}/${authFile}`, error, file)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('Data dir', unzipped)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return { link, json: responseBody, linkTemplate }
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const contents = await fsp.readdir(unzipped)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return { statusCode: 404, json: { error: 'not found' } }
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
let actualCount = 0
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const op = swagger.path.get
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error({ errors: chunk.errors })
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace row
with (row)
Open
chunk.data.forEach(row => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return searchResp
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error(`backing off for ${backoff}ms`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error(`next backoff: ${backoff}ms`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace results
with (results)
Open
complete: results => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
let countsFileExists = await fileExists(countsFile)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
reject(error)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return name
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace results
with (results)
Open
complete: results => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
reject(error)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
]
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
let count = 0
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
]
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
loadContext.geoIndexed[g.ADDRESS_SITE_PID].push(g)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
filesCounts[file] = lines - 1
- Read upRead up
- Exclude checks
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`)))
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return []
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
console.log(error, file)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
console.log(error, file)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('authCodeFiles', authCodeFiles)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
uri: `/addresses/${addressId}`
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
throw new Error(`Data dir '${unzipped}' is empty`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
throw new Error(`Cannot find 'G-NAF' directory in Data dir '${unzipped}'`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const mainDirectory = path.dirname(`${unzipped}/${gnafDir[0].slice(0, -1)}`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('PAGE_SIZE * p', PAGE_SIZE * p)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
await loadGnafData(mainDirectory, { refresh })
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('TOTAL', foundAddresses.body.hits.total.value)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
href: h._id
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
loadContext.geoIndexed = {}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const name = await getStateName(state, `${directory}/${stateFile}`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('Loading site geos')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return []
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
id: `/addresses/${addressId}`
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
delete json._id
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const link = new LinkHeader()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('foundAddresses', foundAddresses)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('responseBody', JSON.stringify(responseBody, undefined, 2))
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error('error querying elastic search', error_)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return `${type.CODE} => ${type.NAME}`
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
files = []
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const locality = await loadLocality(files, directory, state)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error(err)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return filesCounts
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const contents = await fsp.readFile(contentsFile)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace line·=>·line.trim())
with (line)·=>·line.trim());
Open
.map(line => line.trim())
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error(`Could not find locality file '${state}_LOCALITY_psv.psv'`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
parser.resume()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return { statusCode: 503, json: { error: 'service unavailable' } }
- Read upRead up
- Exclude checks
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 })
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('next?', foundAddresses.body.hits.total.value > PAGE_SIZE * p)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ⏎
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('hits', JSON.stringify(searchResp.body.hits, undefined, 2))
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return Array.prototype.concat(...files)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const loadContext = {}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
loadContext.state = state
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
...streetSuffixTypes
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return true
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
files = await getFiles('.', directory)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace f
with (f)
Open
const localityFile = files.find(f =>
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('Loading suburbs', state)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
let count = 0
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
loadContext.geoIndexed[g.ADDRESS_SITE_PID] = [g]
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const unzipped = await unzipFile(file)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
uri: `${url}${spString === '' ? '' : '?'}${spString}`
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}).toString()}`
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const expectedCount = filesCounts[geoFile]
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
resolve()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('Data dir contents', contents)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('json', json)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const link = new LinkHeader()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ⏎··········
Open
uri: `${url}${q === undefined && p == 2 ? '' : '?'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace type
with (type)
Open
.filter(type => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger(`reading ${dir} (${currentDir} in ${baseDir})`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ⏎
with ;
Open
filesCounts[psvFile] = row.data.Count
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
console.log(error, file)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('addr', JSON.stringify(rval, undefined, 2))
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error({ errors: chunk.errors })
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
parser.pause()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error(_error, file)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace row
with (row)
Open
chunk.data.forEach(row => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
reject()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger(`loaded '${actualCount}' rows from '${file}'`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
console.log(error, file)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error('Indexing error', JSON.stringify(error_, undefined, 2))
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
count += 1
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
resolve()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
...(p !== 1 && { p })
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
loadContext.streetLocalityIndexed[sl.STREET_LOCALITY_PID] = sl
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const spString = sp.toString()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const filesCounts = {}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error(`Errors reading '${countsFile}': ${row.errors}`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
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/))
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const contextKey = path.basename(authFile, path.extname(authFile))
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const file = await fetchGnafFile()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('Main Data dir', mainDirectory)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error('error getting record from elastic search', error_)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return { statusCode: 500, json: { error: 'unexpected error' } }
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
p: p + 1
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const linkTemplate = new LinkHeader()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
resolve()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
operator: 'AND'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
let backoff = initialBackoff
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace (resolve
with ((resolve)
Open
await new Promise(resolve => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
reject(error)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const dir = path.resolve(baseDir, currentDir)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
await loadAuthFiles(files, directory, loadContext, filesCounts)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
await loadDefaultGeo(files, directory, state, loadContext, filesCounts)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const g = row
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
logger('Loading default geos')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
parser.pause()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const g = row
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
loadContext.geoDefaultIndexed[g.ADDRESS_DETAIL_PID] = [g]
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
reject([`Error loading '${directory}/${authFile}`, error, file])
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
error('error sending index request', error_)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const foundAddresses = await searchForAddress(q, p)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
{ 'sla.raw': { order: 'asc' } }
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
setLinkOptions(op, url, linkTemplate)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ,
Open
ssla: {}
- Read upRead up
- Exclude checks
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(
- Read upRead up
- Exclude checks
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
orawait
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 })
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
files = Object.keys(filesCounts)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace f
with (f)
Open
f => f.match(/ADDRESS_DETAIL/) && f.match(/\/Standard\//)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
resolve(results.data)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
reject(error)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace row
with (row)
Open
chunk.data.forEach(row => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
.digest('hex')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return { link, json, hash }
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ··········}).toString()}
with
········}).toString()},
Open
}).toString()}`
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/