# Source: https://github.com/quick-lint/quick-lint-js/blob/master/docs/errors/E0076.md

# E0076: cannot declare and export variable with 'export default'

In modules, you can declare and export a variable at the same time. However, it
is a syntax error to declare and export a variable by default:

```javascript
export default let cache = {};
```

To fix this error, export by name, not by default:

```javascript
// Import using:
// import {cache} from "./cache.mjs";
export let cache = {};
```

Alternatively, to export by default, declare the variable then export it in a
separate statement. Note that this means importers of the variable cannot assign
to the variable (but the object can still be modified):

```javascript
// Import using:
// import cache from "./cache.mjs";
let cache = {};
export default cache;
```

Introduced in quick-lint-js version 0.2.0.