vscode-markdownlint: VSCode error "Unexpected token # in JSON"
Hi, for a few days I’ve been getting this error in VSCode:

As text:
[9:56:22 AM] ERROR: Exception while linting with markdownlint-cli2:
Error: Unable to parse '/Users/borekb/dev/shoptet/sofa/docs/docs/.markdownlint.jsonc'; Parser 0: Unexpected token # in JSON at position 0; Parser 1: A collection cannot be both a mapping and a sequence
at /Users/borekb/.vscode/extensions/davidanson.vscode-markdownlint-0.46.0/bundle.js:33:29570
at /Users/borekb/.vscode/extensions/davidanson.vscode-markdownlint-0.46.0/bundle.js:1:2260
In the terminal, all works fine:
$ yarn markdownlint-cli2 '**/*.md'
markdownlint-cli2 v0.1.3 (markdownlint v0.23.1)
Finding: **/*.md !**/node_modules/** !**/.next/** !**/dist/**
Linting: 80 file(s)
Summary: 0 error(s)
Also strange is that the VSCode error mentions a file /Users/borekb/dev/shoptet/sofa/docs/docs/.markdownlint.jsonc which doesn’t exist on my disk and I’m not sure where it’s coming from.
The only markdownlint config we have in the repo is repo-root-level .markdownlint-cli2.js with this content:
require('./.pnp.cjs').setup();
const path = require('path');
module.exports = {
config: {
MD007: {
indent: 4,
},
MD013: false,
MD014: false,
MD040: false,
MD029: false,
MD033: false,
MD026: false,
MD009: { br_spaces: 0 },
MD031: { list_items: false },
'graphql-examples': {
schema: path.join(__dirname, 'packages/graphql/schema.graphql'),
globs: [`${__dirname}/docs/docs/**/*.md{,x}`],
},
},
ignores: ['**/node_modules/**', '**/.next/**', '**/dist/**'],
customRules: ['@shoptet-private/markdownlint-graphql-examples'],
};
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 21 (11 by maintainers)
(I may still need an allow list for schemes for cases when a workspace is not open.)