Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in Output #16

Closed
Stanzilla opened this issue Jan 16, 2020 · 22 comments
Closed

Error in Output #16

Stanzilla opened this issue Jan 16, 2020 · 22 comments
Labels
help wanted 🙏 This could use your insight or help 🐛 type/bug This is a problem

Comments

@Stanzilla
Copy link

Getting these errors in the output in VSCode:

[Remark]
[[object Object]]: Package not found. Use **npm i remark-[object Object]** or **npm i -g remark-[object Object]**.
[remark-lint-maximum-line-length,999]: Package not found. Use **npm i remark-remark-lint-maximum-line-length,999** or **npm i -g remark-remark-lint-maximum-line-length,999**.
[remark-lint-unordered-list-marker-style,consistent]: Package not found. Use **npm i remark-remark-lint-unordered-list-marker-style,consistent** or **npm i -g remark-remark-lint-unordered-list-marker-style,consistent**.
[remark-lint-ordered-list-marker-style,consistent]: Package not found. Use **npm i remark-remark-lint-ordered-list-marker-style,consistent** or **npm i -g remark-remark-lint-ordered-list-marker-style,consistent**.
[remark-lint-emphasis-marker,consistent]: Package not found. Use **npm i remark-remark-lint-emphasis-marker,consistent** or **npm i -g remark-remark-lint-emphasis-marker,consistent**.
[remark-lint-ordered-list-marker-value,ordered]: Package not found. Use **npm i remark-remark-lint-ordered-list-marker-value,ordered** or **npm i -g remark-remark-lint-ordered-list-marker-value,ordered**.
[remark-lint-no-file-name-irregular-characters,false]: Package not found. Use **npm i remark-remark-lint-no-file-name-irregular-characters,false** or **npm i -g remark-remark-lint-no-file-name-irregular-characters,false**.
[remark-lint-list-item-spacing,[object Object]]: Package not found. Use **npm i remark-remark-lint-list-item-spacing,[object Object]** or **npm i -g remark-remark-lint-list-item-spacing,[object Object]**.
[remark-lint-list-item-indent,space]: Package not found. Use **npm i remark-remark-lint-list-item-indent,space** or **npm i -g remark-remark-lint-list-item-indent,space**.
[remark-lint-list-item-content-indent,false]: Package not found. Use **npm i remark-remark-lint-list-item-content-indent,false** or **npm i -g remark-remark-lint-list-item-content-indent,false**.
[remark-lint-code-block-style,false]: Package not found. Use **npm i remark-remark-lint-code-block-style,false** or **npm i -g remark-remark-lint-code-block-style,false**.
[remark-lint-table-cell-padding,false]: Package not found. Use **npm i remark-remark-lint-table-cell-padding,false** or **npm i -g remark-remark-lint-table-cell-padding,false**.
[remark-lint-table-pipe-alignment,false]: Package not found. Use **npm i remark-remark-lint-table-pipe-alignment,false** or **npm i -g remark-remark-lint-table-pipe-alignment,false**.
[function frontmatter(options) {
  var parser = this.Parser
  var compiler = this.Compiler
  var config = matters(options || ['yaml'])

  if (isRemarkParser(parser)) {
    attachParser(parser, config)
  }

  if (isRemarkCompiler(compiler)) {
    attachCompiler(compiler, config)
  }
}]: Package not found. Use **npm i remark-function frontmatter(options) {
  var parser = this.Parser
  var compiler = this.Compiler
  var config = matters(options || ['yaml'])

  if (isRemarkParser(parser)) {
    attachParser(parser, config)
  }

  if (isRemarkCompiler(compiler)) {
    attachCompiler(compiler, config)
  }
}** or **npm i -g remark-function frontmatter(options) {
  var parser = this.Parser
  var compiler = this.Compiler
  var config = matters(options || ['yaml'])

  if (isRemarkParser(parser)) {
    attachParser(parser, config)
  }

  if (isRemarkCompiler(compiler)) {
    attachCompiler(compiler, config)
  }
}**.
[remark-frontmatter,[object Object]]: Package not found. Use **npm i remark-remark-frontmatter,[object Object]** or **npm i -g remark-remark-frontmatter,[object Object]**.

My config file looks like this:

const fs = require("fs");
const path = require("path");

exports.settings = {
    bullet: "consistent",
    listItemIndent: "1",
    rule: "-",
    ruleRepetition: "3",
    ruleSpaces: false,
    emphasis: "*",
    paddedTable: false
};

const personalDictionaryPath = path.join(__dirname, ".vscode/spellright.dict");
const personalDictionary = fs.existsSync(personalDictionaryPath)
    ? {
          personal: fs.readFileSync(personalDictionaryPath, "utf8")
      }
    : {};

exports.plugins = [
    require("remark-preset-lint-markdown-style-guide"),
    ["remark-lint-maximum-line-length", 999],
    ["remark-lint-unordered-list-marker-style", "consistent"],
    ["remark-lint-ordered-list-marker-style", "consistent"],
    ["remark-lint-emphasis-marker", "consistent"],
    ["remark-lint-ordered-list-marker-value", "ordered"],
    ["remark-lint-no-file-name-irregular-characters", false],
    ["remark-lint-list-item-spacing", { checkBlanks: true }],
    ["remark-lint-list-item-indent", "space"],
    ["remark-lint-list-item-content-indent", false],
    ["remark-lint-code-block-style", false],
    ["remark-lint-table-cell-padding", false],
    ["remark-lint-table-pipe-alignment", false],
    require("remark-frontmatter"),
    ["remark-frontmatter", {type: 'custom', marker: '!'}]
];
@mrmlnc
Copy link
Collaborator

mrmlnc commented Jan 19, 2020

Most likely this is artifact after #14.

//cc @tengattack if you're interested

@mrmlnc mrmlnc added the 🐛 type/bug This is a problem label Jan 19, 2020
@tengattack
Copy link
Contributor

Could you try to remove the last two plugins:

require("remark-frontmatter"),
["remark-frontmatter", {type: 'custom', marker: '!'}]

And try again? See whether the errors have gone

@mrmlnc mrmlnc added the help wanted 🙏 This could use your insight or help label Jan 19, 2020
@tengattack
Copy link
Contributor

BTW, you should remove the remark- prefix in plugins:

MY config works fine:

var stringWidth = require('string-width')

module.exports = {
  "settings": {
    "fences": true,
    "listItemIndent": 1,
    "paddedTable": false,
    "stringLength": stringWidth,
  },
  "plugins": [
    "preset-lint-markdown-style-guide",
    ["lint-emphasis-marker", "_"],
    ["lint-list-item-indent", "space"],
    ["lint-maximum-line-length", 120],
    ["lint-no-file-name-irregular-characters", "\\.a-zA-Z0-9-_ \\u2e80-\\u2eff\\u2f00-\\u2fdf\\u3040-\\u309f\\u30a0-\\u30ff\\u3100-\\u312f\\u3200-\\u32ff\\u3400-\\u4dbf\\u4e00-\\u9fff\\uf900-\\ufaff"],
    ["lint-no-file-name-mixed-case", false],
    ["lint-no-shortcut-reference-link", false],
    ["lint-ordered-list-marker-value", "ordered"],
    ["lint-table-pipe-alignment", false]
  ]
}

@tengattack
Copy link
Contributor

tengattack commented Jan 19, 2020

The code add remark- prefix now:

image

And does not support function & object now, like your first plugin:

require("remark-preset-lint-markdown-style-guide"),

Just use preset-lint-markdown-style-guide to replace it, it will work.

@Stanzilla
Copy link
Author

That sounds like something that should be in the documentation though

@tengattack
Copy link
Contributor

Yes. It only works in limited scenarios now.

I will update the README later.

@Stanzilla
Copy link
Author

Okay and for frontmatter?

"frontmatter",
["frontmatter", {type: 'custom', marker: '!'}]

Still gives me the "Headings should use atx" warning even though it should not anymore

@tengattack
Copy link
Contributor

Okay and for frontmatter?

"frontmatter",
["frontmatter", {type: 'custom', marker: '!'}]

Still gives me the "Headings should use atx" warning even though it should not anymore

Could you remove the first "frontmatter" plugin, only keep ["frontmatter", {type: 'custom', marker: '!'}] and try again?

@Stanzilla
Copy link
Author

That gives the same message here

@tengattack
Copy link
Contributor

tengattack commented Jan 19, 2020

What about using remark-cli, run the remark command in console directly (specify the file you need to check)? Is there same errors?

@Stanzilla
Copy link
Author

Nope, remark-cli gets it right!

@Stanzilla
Copy link
Author

Wait, I ran into a different issue again. I need to reload the window every time I update the config file for it to be used by the vs code extension. Something I previously reported here drewbourne/vscode-remark-lint#2

After reloading the window and just using ["frontmatter", { type: 'custom', marker: '-' }] i still get 4:1-5:4: Headings should use atx

@tengattack
Copy link
Contributor

Wait, I ran into a different issue again. I need to reload the window every time I update the config file for it to be used by the vs code extension. Something I previously reported here drewbourne/vscode-remark-lint#2

After reloading the window and just using ["frontmatter", { type: 'custom', marker: '-' }] i still get 4:1-5:4: Headings should use atx

Currently, Yes, you will need to reload window every time after config updated.

@tengattack
Copy link
Contributor

I will dig into it later, it seems the settings didn't pass to the plugin.

@Stanzilla
Copy link
Author

That maybe should also be in the readme since it's really not intuitive. What's the reasoning for it? And if it's required maybe add a notification or button to reload when the config changes?

@tengattack
Copy link
Contributor

Could you try to add the settings {"frontmatter": {"type": "custom", "maker": "-"}} to remark settings in vscode settings like the README shows

@Stanzilla
Copy link
Author

Added

 "remark.format": {
		"plugins": [
			"frontmatter"
		],
    "type": "custom",
    "marker": "-"
  }

to my VSCode config, reloaded and now it works :)

@tengattack
Copy link
Contributor

image

add to "remark.format" like:

"remark.format": {
  "formatter": {...}
}

@Stanzilla
Copy link
Author

@tengattack any news here? 😃

@asbjornu
Copy link
Collaborator

asbjornu commented Sep 1, 2020

@Stanzilla, if you run the following commands in the root folder of your project, what's the output in your console?

npm install remark-cli
npx remark-cli .

@Stanzilla
Copy link
Author

That works but it's been a while since I had this problem, I haven't used remark since then.

@asbjornu
Copy link
Collaborator

Please try version 1.3.0 of unifiedjs.vscode-remark (notice the rename). If that does not fix this problem, please reopen the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted 🙏 This could use your insight or help 🐛 type/bug This is a problem
Development

No branches or pull requests

4 participants