documentation
documentation copied to clipboard
Unexpected invisible token
Error
132:1 warning unexpected token
Here's the line 132:
/**
I checked for encoding and the surrounding characters which are below:
};
/**
*
But I don't know why it's still doing this.
- What version of documentation.js are you using?:
8.1.2 - How are you running documentation.js (on the CLI, Node.js API, Grunt, other?): I'm running it as follows:
"doc:lint": "documentation lint src/**"
Mind specifying the complete source code of that file? The thing with 'unexpected token' errors is that it's "unexpected" because of context. It's not that there's a specific 'bad' token, it's that the code (which in this example comes before that }; line) sets up an expectation that is then not fulfilled. Or, alternately, make sure that the file in this example runs in Node or a browser to make sure it's parseable to begin with.
@tmcw Sure, here's the file.
Looks like this is an error thrown by doctrine, the underlying JSDoc parser, so it's a JSDoc syntax error rather than a JavaScript one, and it appears to be triggered by the line
* @param {string[]} [files=process.argv.slice(2, process.argv.length)] Array of file paths
@tmcw I removed the process... and still get this error pointed to the same line.
Still getting that even by having this:
/**
* @description Synchronously read files and scan them.
* @param {string[]} [files] Array of file paths
* @param {Config} obj Configuration
* @see Config
* @return {(undefined|string[]|{...string})} Data or nothing
* @public
* @example <caption>Reading from the CLI</caption>
* readFilesSync();
* @example <caption>Reading from specific files</caption>
* readFilesSync(['output.txt']);
* @example <caption>... With specific configurations</caption>
* readFilesSync(['input.json'], {prettify: true, outputFormat: 'json'}); //logs {<br> "output.json": "sha256-iTyF6rE+vAUIIWrWaC6bWt9NwI/74kpOuk4JZl9zCMM="<br>}
* readFilesSync(['input.csv'], {outputDest: 'output.json', outputFormat: 'json'}); //Writes the above to output.json
*/
const readFilesSync = (files = [], { prettify = false, outputDest = OUTPUT_DEST, outputFormat = OUTPUT_FORMAT } = {}) => {
...
@tmcw Have you had a chance to look at this?
Please don't bump issues - I'll post back on something if I've made progress on it.