environment
array of .deepsource.toml
. Read more in our documentation https://deepsource.io/docs/analyzer/javascript 8import Adapter from 'enzyme-adapter-react-16';
9import {createSerializer} from 'enzyme-to-json';
10
11expect.addSnapshotSerializer(createSerializer({mode: 'deep'}));12
13Enzyme.configure({adapter: new Adapter()});
Variables that aren't defined, but accessed may throw reference errors at runtime.
Potential ReferenceError
s may result from misspellings of variable and parameter names, or accidental implicit globals (for example, forgetting the var
keyword in a for
loop initializer).
Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a /*global ...*/
comment, or specified in the globals key in the configuration file.
A common use case for these is if you intentionally use globals that are defined elsewhere (e.g. in a script sourced from HTML).
const foo = someFunction();
const bar = a + 1; // 'a' is undeclared
/*global someFunction, a*/
/*eslint no-undef: "error"*/
const foo = someFunction();
const bar = a + 1;