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

Remark ignores plugins that override default settings #246

Closed
vitoyucepi opened this issue Aug 14, 2020 · 1 comment
Closed

Remark ignores plugins that override default settings #246

vitoyucepi opened this issue Aug 14, 2020 · 1 comment
Labels
🙋 no/question This does not need any changes

Comments

@vitoyucepi
Copy link

Subject of the issue

Remark ignores plugins like remark-lint-ordered-list-marker-value if they override default settings.
I try to configure list order like:

1.
1.
1.

But every time I reformat code with npx remark README.md -o it outputs:

1.
2.
3.

Your environment

  • OS: Archlinux
  • Packages:
    • "remark-cli": "8.0.1"
    • "remark-lint-ordered-list-marker-value": "2.0.1"
  • Env:
    • node: v12.18.3
    • npm: 6.14.7

Steps to reproduce

  1. Create package.json
{
 "name": "test",
 "version": "1.0.0",
 "main": "index.js",
 "license": "MIT",
 "dependencies": {
   "remark-cli": "8.0.1",
   "remark-lint-ordered-list-marker-value": "2.0.1"
 },
 "remarkConfig": {
   "plugins": [
     [
       "remark-lint-ordered-list-marker-value",
       "one"
     ]
   ]
 }
}
  1. Create README.md
1.  Test
1.  Test1
1.  Test2
  1. Install packages npm i
  2. Run reformat command remark README.md -o

Expected behavior

README.md should look like

1.  Test
1.  Test1
1.  Test2

Actual behavior

README.md will look like:

1.  Test
2.  Test1
3.  Test2

Additional info

DEBUG="*" npx remark README.md -o

  unified-engine:configuration Looking for `[ '.remarkrc', '.remarkrc.js', '.remarkrc.yml', '.remarkrc.yaml' ]` configuration files +0ms
  unified-engine:configuration Looking for `remarkConfig` fields in `package.json` files +3ms
  unified-engine:find-up No files found for `/tmp/test/README.md` +0ms
  unified-engine:file-set-pipeline:stdin Ignoring `streamIn` +0ms
  unified-engine:file-pipeline:read Reading `/tmp/test/README.md` in `utf8` +0ms
  unified-engine:file-pipeline:read Read `/tmp/test/README.md` (error: null) +1ms
  unified-engine:find-up Read file `/tmp/test/package.json` +5ms
  unified-engine:file-pipeline:configure Using settings `{}` +0ms
  unified-engine:file-pipeline:configure Using `1` plugins +0ms
  unified-engine:file-pipeline:configure Using plugin `remark-lint:ordered-list-marker-value`, with options `"one"` +0ms
  unified-engine:file-pipeline:parse Parsing `README.md` +0ms
  unified-engine:file-pipeline:parse Parsed document +6ms
  unified-engine:file-pipeline:transform Transforming document `README.md` +0ms
  unified-engine:file-pipeline:transform Transformed document (error: null) +1ms
  unified-engine:file-pipeline:queue Queueing `README.md` +0ms
  unified-engine:file-pipeline:queue `README.md` can be flushed +0ms
  unified-engine:file-pipeline:queue Flushing: all files can be flushed +0ms
  unified-engine:file-pipeline:stringify Compiling `README.md` +0ms
  unified-engine:file-pipeline:stringify Serialized document +1ms
  unified-engine:file-pipeline:copy Not copying +0ms
  unified-engine:file-pipeline:stdout Ignoring writing to `streamOut` +0ms
  unified-engine:file-pipeline:file-system Writing document to `/tmp/test/README.md` +0ms
README.md
  2:1-2:10  warning  Marker should be `1`, was `2`  ordered-list-marker-value  remark-lint
  3:1-3:10  warning  Marker should be `1`, was `3`  ordered-list-marker-value  remark-lint

⚠ 2 warnings
@vitoyucepi vitoyucepi added 🐛 type/bug This is a problem 🙉 open/needs-info This needs some more info labels Aug 14, 2020
@ChristianMurphy ChristianMurphy added 🙋 no/question This does not need any changes and removed 🐛 type/bug This is a problem 🙉 open/needs-info This needs some more info labels Aug 14, 2020
@ChristianMurphy
Copy link
Member

@vitoyucepi remark-lint doesn't modify the content of the markdown (see #82)
The setting is in remark-stringify https://github.com/remarkjs/remark/tree/main/packages/remark-stringify#optionsincrementlistmarker
and can be configured with

{
 "name": "test",
 "version": "1.0.0",
 "main": "index.js",
 "license": "MIT",
 "dependencies": {
   "remark-cli": "8.0.1",
   "remark-lint-ordered-list-marker-value": "2.0.1"
 },
 "remarkConfig": {
    "settings": {
      "incrementListMarker": false
    },
   "plugins": [
     [
       "remark-lint-ordered-list-marker-value",
       "one"
     ]
   ]
 }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙋 no/question This does not need any changes
Development

No branches or pull requests

2 participants