Closed danielfdickinson closed 1 year ago
Yes, eslint does not like import statement in a script (none module). This import is however for ESBuild built in to Hugo and will not be part of the output.
Tried to find way to remove the error but decided to just ignore it. Most likely only us two who care about linting in the Zen theme :-).
I found way to quiet eslint on this:
parserOptions:
ecmaVersion: 12
sourceType: module
combined with
rules:
strict: 0
in .eslintrc.yaml
. Of course this has side effects that might be a problem (like not warning of misuse of strict), so you'll have to contemplate what you think of that.
Do not complicate yourself.
I got rid of the error by just deleting import * as params from '@params';
The only reason this is needed is to set params.searchLimit
So delete params.searchLimit
and replace it with its default value of 20 and your code will finally run.
@laygond Doing that removes the ability to set searchLimit
in the site config file (e.g. config.yaml
or config.toml
).
Added comments to disable linting for the import lines so closing this.
On Windows 10:
With node 16.19.1.
The line in question (in both cases) is: