Git Product home page Git Product logo

markdownlint-cli's People

Contributors

aleksi avatar andmos avatar benniwi avatar bgrnwd avatar boneskull avatar brookr avatar davidanson avatar davidosomething avatar dependabot[bot] avatar dtrodrigues avatar elischleifer avatar fornever avatar grushetsky avatar hugovk avatar igorshubovych avatar janosh avatar kangie avatar macpijan avatar mftabriz avatar mroderick avatar nlm-pro avatar nschonni avatar programmer04 avatar rogerluan avatar rrauenza avatar sequoia avatar sxlijin avatar theoludwig avatar veselovalex avatar xeho91 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

markdownlint-cli's Issues

markdown: command not found

I'm pretty sure I've configured my system right but I can't seem to get this to work...I would appreciate some help. I've reinstalled Node several times and NPM, and I just don't get it. I would really appreciate any help...I've pasted as much info as I can think of below...

$brew config -list

$ brew config -list
HOMEBREW_VERSION: 1.6.3
ORIGIN: https://github.com/Homebrew/brew
HEAD: d14d0c25d6bd5a15f3fbca4cb402f0f2245c4631
Last commit: 3 weeks ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: bb7c5fe7890f65d0da3980f3c894dbfcb7b36910
Core tap last commit: 10 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_VISUAL: subl
CPU: 12-core 64-bit kabylake
Homebrew Ruby: 2.3.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
Clang: 9.1 build 902
Git: 2.17.0 => /usr/local/bin/git
Curl: 7.54.0 => /usr/bin/curl
Java: 10.0.1, 10
macOS: 10.13.4-x86_64
CLT: 9.3.0.0.1.1521514116
Xcode: 9.3.1
XQuartz: N/A

$node -v

$ node -v
v10.1.0

$which node

$ which node
/usr/local/bin/node

$npm config -g list -l

$ npm config ls -l
; cli configs
long = true
metrics-registry = "https://registry.npmjs.org/"
scope = ""
user-agent = "npm/6.0.1 node/v10.1.0 darwin x64"

; userconfig /Users/draque/.npmrc
prefix = "/Users/draque/.npm-packages"

; builtin config undefined
; prefix = "/usr/local" (overridden)

; default values
access = null
allow-same-version = false
also = null
always-auth = false
audit = true
auth-type = "legacy"
bin-links = true
browser = null
ca = null
cache = "/Users/draque/.npm"
cache-lock-retries = 10
cache-lock-stale = 60000
cache-lock-wait = 10000
cache-max = null
cache-min = 10
cafile = undefined
cert = null
cidr = null
color = true
commit-hooks = true
depth = null
description = true
dev = false
dry-run = false
editor = "subl"
engine-strict = false
fetch-retries = 2
fetch-retry-factor = 10
fetch-retry-maxtimeout = 60000
fetch-retry-mintimeout = 10000
force = false
git = "git"
git-tag-version = true
global = false
global-style = false
globalconfig = "/Users/draque/.npm-packages/etc/npmrc"
globalignorefile = "/Users/draque/.npm-packages/etc/npmignore"
group = 20
ham-it-up = false
heading = "npm"
https-proxy = null
if-present = false
ignore-prepublish = false
ignore-scripts = false
init-author-email = ""
init-author-name = ""
init-author-url = ""
init-license = "ISC"
init-module = "/Users/draque/.npm-init.js"
init-version = "1.0.0"
json = false
key = null
legacy-bundling = false
link = false
local-address = undefined
loglevel = "notice"
logs-max = 10
; long = false (overridden)
maxsockets = 50
message = "%s"
; metrics-registry = null (overridden)
no-proxy = null
node-options = null
node-version = "10.1.0"
offline = false
onload-script = null
only = null
optional = true
otp = null
package-lock = true
package-lock-only = false
parseable = false
prefer-offline = false
prefer-online = false
; prefix = "/usr/local/Cellar/node/10.1.0" (overridden)
production = false
progress = true
proxy = null
read-only = false
rebuild-bundle = true
registry = "https://registry.npmjs.org/"
rollback = true
save = true
save-bundle = false
save-dev = false
save-exact = false
save-optional = false
save-prefix = "^"
save-prod = false
scope = ""
script-shell = null
scripts-prepend-node-path = "warn-only"
searchexclude = null
searchlimit = 20
searchopts = ""
searchstaleness = 900
send-metrics = false
shell = "/bin/bash"
shrinkwrap = true
sign-git-tag = false
sso-poll-frequency = 500
sso-type = "oauth"
strict-ssl = true
tag = "latest"
tag-version-prefix = "v"
timing = false
tmp = "/var/folders/yl/5kztfc653sd4w7xr6j7c7yz40000gn/T"
umask = 18
unicode = true
unsafe-perm = true
usage = false
user = 501
; user-agent = "npm/{npm-version} node/{node-version} {platform} {arch}" (overridden)
userconfig = "/Users/draque/.npmrc"
version = false
versions = false
viewer = "man"

$npm list -g | grep markdown

$ npm list -g | grep markdown
├─┬ [email protected]
├─┬ [email protected]
│ └─┬ [email protected]

markdownlint

$ markdownlint
-bash: markdownlint: command not found

Support cross-platform glob

It would be nice to support cross-platform glob like prettier.

Currently markdownlint-cli supports directory.
But if directory has node_modules directory, markdownlint-cli also search in it.
To avoid that, I want to use glob like this:

# ./ has node_modules directory and *.md file exists in ./ and ./docs
markdownlint './*.md' './docs/**/*.md'

cli `markdownlint --help` fails out of the box

after install
npm install -g markdownlint-cli

testing the cli
markdownlint --help

returns an error.

/usr/local/lib/node_modules/markdownlint-cli/node_modules/markdownlint/lib/markdownlint.js:262
      capturedRules = { ...enabledRules };
                        ^^^

SyntaxError: Unexpected token ...
    at createScript (vm.js:74:10)
    at Object.runInThisContext (vm.js:116:10)
    at Module._compile (module.js:533:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/markdownlint-cli/markdownlint.js:14:22)

Problem matcher for VSCode?

Does anyone have a problem matcher for VSCode at hand? I already use the extension but this is for a scenario where markdownlint runs as part of a npm script and I'd like to parse its output into problems view for people who don't have the extension.

Investigate random-seeming failures in 'glob linting does not try to lint directories as files' test

How to ignore multiple directories? [Performance is slow]

I want to lint our monorepo which requires excluding node_modules and vendor directories (they contain a lot of Markdown files which are not our source code).

So far, I've tried this with no luck:

# All these don't work

# 1
markdownlint -i '**/(node_modules|vendor)/**' .

# 2
markdownlint -i '(node_modules|vendor)' .

# 3
markdownlint -i '**/node_modules/**' -i '**/vendor/**' .

# 4
markdownlint '**/!(node_modules|vendor)/**/*.md'

I especially think that #4 should work.

[feature request] formatter

In my opinion, it'd be cool to format markdown as like eslint --fix. This will silently fix problems if it can, otherwise show error.

For example, https://github.com/DavidAnson/vscode-markdownlint enables this feature and it's super handy. The feature would make workflow more beautiful like below.

{
  "lint-staged": {
    "*.md": [
      "markdownlint --fix",
      "git add"
    ]
  },
}

Fix config schema and add some options

I suggest to modify config schema such as:

{
  "rules": {
     // rule options
   },
   "extra1": {
     // extra options
   },
   ...
}

Moreover, we should add files and excludes options:

{
   "rules": {
     ...
   },
   "files": [
     ...
   ],
   "excludes": [
     ...
   ]
}

The Design of files and excludes

  • Permit glob pattern
  • Excludes are stronger than files
  • Arguments are stronger than excludes
  • Add --force-exclusion option: force apply excludes even if they are explicitly passed as arguments

SyntaxError: Unexpected token } in JSON at position 525

#10288: $ ./node_modules/.bin/markdownlint ./
undefined:28
}
^

SyntaxError: Unexpected token } in JSON at position 525
    at JSON.parse (<anonymous>)
    at exports.parse (/node_modules/rc/lib/utils.js:15:17)
    at addConfigFile (/node_modules/rc/index.js:30:20)
    at Array.forEach (<anonymous>)
    at module.exports (/node_modules/rc/index.js:43:36)
    at readConfiguration (/node_modules/markdownlint-cli/markdownlint.js:28:16)
    at lintAndPrint (/node_modules/markdownlint-cli/markdownlint.js:220:18)
    at Object.<anonymous> (/node_modules/markdownlint-cli/markdownlint.js:237:3)
    at Module._compile (internal/modules/cjs/loader.js:707:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)

MD022 with --fix changing wrong lines

I know this isn't actually released yet, but I was trying it out from installing it from the current tarball.

Steps to reproduce:

  1. Clone https://github.com/dotnet/docs
  2. Remove the "MD022" suppression in .markdownlint.json
  3. Run markdownlint --fix "docs/visual-basic/**/*.md" (just to minimize the affected files

Expected Result:
Newlines around/after the ATX headings

Actual Result:
Newlines after opening frontmatter and in lists

Might give you a nice test bed for kicking the tires on the --fix.

Allow including a custom rule via package name

This works right now:

markdownlint --config .markdownlint.json --rules ./node_modules/sentences-per-line/index.js README.md

...but this does not:

markdownlint --config .markdownlint.json --rules sentences-per-line README.md

Relevant function: prepareFileList

markdownlint now analyzing stdin unnecessarily

This may be a byproduct of #32 -- i just recently started to see it. I'm using [email protected]

We were passing in a list of directories, each containing a markdown file, to be analyzed while skipping over the node_modules directory. Just started to see an error related to stdin. Not sure if we're abusing the file input argument, but would be great to see if this is related to the latest version of markdownlint-cli.

$ markdownlint --config .markdownlint.json `ls -d */ | grep -v 'node_modules/'`
stdin: 1: MD043/required-headers Required header structure [Context: "## Learning objectives"]

our markdownlint.json file looks like

{
    "_docs_for_this_file": "https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md",
    "line-length": false,
    "first-line-h1": false,
    "first-header-h1": {
        "level": 2
    },
    "header-style": {
        "style": "atx"
    },
    "ul-style": {
        "style": "asterisk"
    },
    "hr-style": {
        "style": "---"
    },
    "fenced-code-language": false,
    "required-headers": {
        "headers": [
            "## Learning objectives",
            "## Prerequisites",
            "## Estimated time",
            "## Steps",
            "*",
            "## Summary",
            "## References"
        ]
    },
    "spelling": false,
    "no-alt-text": false
}

[feature request] .markdownlintignore

What if we have the file like .markdownlintignore?
Listing all directories and files to ignore on single command might be somewhat improper in some cases. (And I even avoid using a shorthand option like -i to let people understand the option more easily)

{
# - A few directories (e.g. node_modules) which contains external markdown files. 
# - A few directories (e.g. .git) which does not actually contain markdown files, 
#   but should be ignored for performance as they are 'deep' and 'wide'. 
# - A few exceptional markdown files (e.g.CHANGELOG.md) 
#   that has some special reasons to be ignored (e.g. written and managed by machine)
  "lint:md": "markdownlint --ignore node_modules --ignore .git --ignore CHANGELOG.md --ignore ..."
}

In those cases, the script specifed in package.json would be so long, leading a bit of inconvenient experience.

How do you feel?

TypeError: Cannot read property 'trim' of undefined

Seems like running markdownlint the way I normally do has stopped working with the latest release of npm and/or node.

I looked at the line that's tossing up the error but it seems OK (https://github.com/DavidAnson/markdownlint/blob/master/lib/markdownlint.js#L161). I'll try a different (earlier) version of npm and see what happens.

$ node --version
v8.11.1
$ npm --version
5.6.0
$ markdownlint --version
0.8.1
$ markdownlint --config .markdownlint.json `ls -d */ | grep -v 'node_modules/'`
/usr/local/lib/node_modules/markdownlint-cli/node_modules/markdownlint/lib/markdownlint.js:161
      while (token.map[1] && !(lines[token.map[1] - 1].trim())) {
                                                       ^

TypeError: Cannot read property 'trim' of undefined
    at forToken (/usr/local/lib/node_modules/markdownlint-cli/node_modules/markdownlint/lib/markdownlint.js:161:56)
    at Array.forEach (<anonymous>)
    at annotateTokens (/usr/local/lib/node_modules/markdownlint-cli/node_modules/markdownlint/lib/markdownlint.js:144:10)
    at lintContent (/usr/local/lib/node_modules/markdownlint-cli/node_modules/markdownlint/lib/markdownlint.js:298:3)
    at lintContentWrapper (/usr/local/lib/node_modules/markdownlint-cli/node_modules/markdownlint/lib/markdownlint.js:413:5)
    at lintFile (/usr/local/lib/node_modules/markdownlint-cli/node_modules/markdownlint/lib/markdownlint.js:418:5)
    at lintNextItem (/usr/local/lib/node_modules/markdownlint-cli/node_modules/markdownlint/lib/markdownlint.js:474:9)
    at lintInput (/usr/local/lib/node_modules/markdownlint-cli/node_modules/markdownlint/lib/markdownlint.js:488:3)
    at Function.markdownlintSync [as sync] (/usr/local/lib/node_modules/markdownlint-cli/node_modules/markdownlint/lib/markdownlint.js:510:3)
    at lintAndPrint (/usr/local/lib/node_modules/markdownlint-cli/markdownlint.js:142:33)

Make ignores and files to include part of the configuration

The config file (.markdownlint.json), if I understand it correctly, is the options.config object. In the API, options have other keys like files or customRules.

Would it be possible to use this in .markdownlint.json as well? Especially, I'd use it to denote certain directories as ignored. This is probably not supported by the underlying API at this point but I imagine something like this:

// .markdownlint.json
{
  "ignore": [
	"node_modules"
  ],
  "config": {
	"MD026": false
  }
}

[feature request] junit test reporter

Hi, thank you for this convenient cli!

I'd like to suggest a feature which might be cool especially in CI environment.
If markdownlint-cli supports junit-style(de facto format) reporter, it'd be so comfortable to check the lint results in CI.
Other popular test runner and linters (e.g. jest, eslint) does support the feature as well.

How do you feel about this?

Property 'range' of onError parameter is incorrect when passing "**/target/**" as --ignore

When ignoring path that contains folder target there's an error:
However if I use something different that target it works just fine.

juanchaur$ npm run lint:md

> @ lint:md
> markdownlint ./ -r ./myRules -i **/library/** -i **/node_modules/** -i **/target/**
/markdownlint-cli/node_modules/markdownlint/lib/markdownlint.js:575
      throw error;
      ^
Error: Property 'range' of onError parameter is incorrect.
    at throwError (/node_modules/markdownlint-cli/node_modules/markdownlint/lib/markdownlint.js:350:13)
    at onError (/markdownlint-cli/node_modules/markdownlint/lib/markdownlint.js:378:9)
    at addError (/markdownlint-cli/node_modules/markdownlint/helpers/helpers.js:314:3)
    at addErrorContext (/markdownlint-cli/node_modules/markdownlint/helpers/helpers.js:349:5)
    at forEachInlineCodeSpan (/markdownlint-cli/node_modules/markdownlint/lib/md038.js:38:15)
    at forEachInlineCodeSpan (/markdownlint-cli/node_modules/markdownlint/helpers/helpers.js:275:13)
    at MD038.filterTokens (/markdownlint-cli/node_modules/markdownlint/lib/md038.js:19:9)
    at forToken (/markdownlint-cli/node_modules/markdownlint/helpers/helpers.js:143:7)
    at Array.forEach (<anonymous>)
    at filterTokens (/markdownlint-cli/node_modules/markdownlint/helpers/helpers.js:141:17)

I'm running it in a project structure like this:

- projectA
	- README.md
	- node_modules
- subdir
	- projectB
		- node_modules
		- docs.md
		- target
	- projectC
		- node_modules
		- docs
			- a.md
			- b.md
        - target
- project X
	- vendor
	- site
		- page1.md
		- page2.md

`--ignore` option can not handle absolute path?

Hi! New feature --ignore option from v0.7.0 is very awesome!

I found that this option behavior is different from ESLint --ignore-pattern option, so is this behavior a bug?

OK

# relative path
eslint --ignore-pattern a.js "*.js"

# absolute path
eslint --ignore-pattern a.js "$(pwd)/*.js"

# relative path
markdownlint --ignore a.md "*.md"

NG

# absolute path
markdownlint --ignore a.md "$(pwd)/*.md"

I created Gist for reproduction:
https://gist.github.com/ybiquitous/3c7680dc9020455013c59fd999ab6fcd

Thanks.

Don't print empty lines on valid Markdown

When running markdownlint-cli on an valid .md file, it prints an empty line. I think it's a good idea to have it output nothing (if it has nothing to output of course).

Having taken a quick look at the source code I'm not sure if this is a markdownlint or markdownlint-cli related issue.

DavidAnson/markdownlint#30

markdownlint as a peer dependency?

Keeping markdownlint itself as a direct dependency in package.json somewhat locks this package into that version. If you mark it as a devDependency, users will have an easier time managing versioning.

The setup flow would become:

npm i -g markdownlint markdownlint-cli

Overrides field

I think it would be great to specify config overrides for certain files (like overrides in eslint and prettier). I don't think this should be implement in the markdownlint library, because it's easier to do this overriding manually when using the API, but it would be nice if the CLI would support it in some way.

markdownlint reports npm ERR when run as npm script

Using the npm script reference: npm run mdlint

"scripts": {
  "mdlint": "node_modules/.bin/markdownlint --config .markdownlintrc source"
}

reports the following error:

npm ERR! Darwin 16.5.0
npm ERR! argv "/usr/local/Cellar/node/7.3.0/bin/node" "/usr/local/bin/npm" "run" "mdlint"
npm ERR! node v7.3.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] mdlint: `markdownlint --config .markdownlintrc source`
npm ERR! Exit status 1

However, if I issue the same command in the shell, it throws no errors:

node node_modules/.bin/markdownlint --config .markdownlintrc source

I had previously forked to fix this issue, but if you could fix it in your repo then I would have a need for the fork.

Thank you for contributing this utility.

Help text on Windows refers to the tool name as "cli" although it's installed as "markdownlint"

This is a minor issue, but potentially confusing for novices. I'd suggest that "Usage:" should say "markdownlint" instead of "cli":

D:\T>markdownlint --help

  Usage: cli [options] <files>

  MarkdownLint Command Line Interface

  Options:

    -h, --help                 output usage information
    -V, --version              output the version number
    -c, --config [configFile]  Configuration file

As an extremely minor point, the 'O's of "Output" might be capitalized and the 'V' of "-V" lower-cased for consistency with the other switches.

Is this project abandoned?

This project is potentially really useful to me, but I noticed that there are pull requests and issues with no responses from the project owner for several months.

So is this project abandoned?

Add --statistics --count?

The Python linting tool Flake8 has useful options: --statistics and --count.

Basic use

$ flake8 .
./interactive_console.py:5:1: E402 module level import not at top of file
<snip>
./pytumblr/helpers.py:31:1: E302 expected 2 blank lines, found 1

With --statistics

$ flake8 . --statistics
./interactive_console.py:5:1: E402 module level import not at top of file
<snip>
./pytumblr/helpers.py:31:1: E302 expected 2 blank lines, found 1
1     E201 whitespace after '{'
1     E222 multiple spaces after operator
3     E265 block comment should start with '# '
2     E302 expected 2 blank lines, found 1
1     E305 expected 2 blank lines after class or function definition, found 1
18    E402 module level import not at top of file
90    E501 line too long (92 > 79 characters)
1     W293 blank line contains whitespace

With --count

$ flake8 . --count
./interactive_console.py:5:1: E402 module level import not at top of file
<snip>
./pytumblr/helpers.py:31:1: E302 expected 2 blank lines, found 1
117

With both

$ flake8 . --count --statistics
./interactive_console.py:5:1: E402 module level import not at top of file
<snip>
./pytumblr/helpers.py:31:1: E302 expected 2 blank lines, found 1
1     E201 whitespace after '{'
1     E222 multiple spaces after operator
3     E265 block comment should start with '# '
2     E302 expected 2 blank lines, found 1
1     E305 expected 2 blank lines after class or function definition, found 1
18    E402 module level import not at top of file
90    E501 line too long (92 > 79 characters)
1     W293 blank line contains whitespace
117

Any chance to include something like that here?

Thanks!

Add --init command for generating config

When starting to add Markdownlint, the first step I usually find is to add the config with "default: true", then run and disable the failing rules as a starting point.
Alternate approaches might be to try and guess the settings based off the files, or ask questions about styles.

[email protected] suddenly fails on MD047/single-trailing-newline

Reproduction steps:

  1. git clone [email protected]:v8/v8.dev.git && cd v8.dev
  2. npm install (note: this includes [email protected])
  3. npm run lint works
  4. npm install [email protected]
  5. npm run lint fails with the following error message:
> markdownlint src/**/*.md

src/blog/scanner.md: 95: MD047/single-trailing-newline Files should end with a single newline character

This might be an upstream issue in markdownlint itself, but I figured I’d start by posting here.

js-yaml < 3.13.0 has a denial of service vulnerability

package.json:

  "devDependencies": {
    "markdownlint-cli": "^0.14.0"
  }

Result:

                       === npm audit security report ===                        
                                                                                
┌──────────────────────────────────────────────────────────────────────────────┐
│                                Manual Review                                 │
│            Some vulnerabilities require your attention to resolve            │
│                                                                              │
│         Visit https://go.npm.me/audit-guide for additional guidance          │
└──────────────────────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate      │ Denial of Service                                            │
├───────────────[90m┼──────────────────────────────────────────────────────────────┤
│ Package       │ js-yaml                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=3.13.0                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ markdownlint-cli [dev]                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ markdownlint-cli > js-yaml                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://npmjs.com/advisories/788                             │
└───────────────┴──────────────────────────────────────────────────────────────┘
found 1 moderate severity vulnerability in 896 scanned packages

feature_request(config): automatically detect configuration files

1. Summary

It would be nice, if markdownlint-cli will automatically detect configuration files as .markdownlint.yaml.

2. Argumentation

Save a users time. It would be nice, if user doesn't need add -c .markdownlint.yaml each time.

I use many linters in my projects: all except Markdownlint detect standard config files.

3. Data

  • KiraMarkdownlint__MD002_MD041--demo.md:
### Kira

Goddess!
  • .markdownlint.yaml:
MD041: false

4. Steps to reproduce

markdownlint KiraMarkdownlint__MD002_MD041--demo.md

5. Expected behavior

As if the configuration file were directly specified:

D:\Kristinita>markdownlint KiraMarkdownlint__MD002_MD041--demo.md -c .markdownlint.yaml
KiraMarkdownlint__MD002_MD041--demo.md: 1: MD002/first-heading-h1/first-header-h1 First heading should be a top level heading [Expected: h1; Actual: h3]

6. Actual behavior

D:\SashaDebugging>markdownlint KiraMarkdownlint__MD002_MD041--demo.md
KiraMarkdownlint__MD002_MD041--demo.md: 1: MD002/first-heading-h1/first-header-h1 First heading should be a top level heading [Expected: h1; Actual: h3]
KiraMarkdownlint__MD002_MD041--demo.md: 1: MD041/first-line-h1 First line in file should be a top level heading [Context: "### Kira"]

7. Environment

  • Windows 10 Enterprise LTSB 64-bit EN
  • Node.js 11.9.0
  • markdownlint-cli 0.13.0

Thanks.

Filter gitignore'd files

As initially discussed in #44, it would be great if markdownlint could pic up ignore rules from .gitignore files. With a flag suggested by @DavidAnson, it could look like this:

markdownlint --gitignore

(I'd prefer to put it in a config file but that is a generic request, see #45.)

Feature: Allow glob option `matchBase`

Currently, this seems necessary when, as is common for nodejs projects, there's a README.md in the top-level directory and some .md files in the ./src tree:

markdownlint --ignore node_modules *.md && markdownlint --ignore node_modules **/*.md 

Instead if glob option matchBase could be set to true, then something like the following would suffice:

markdownlint --ignore node_modules --matchBase *.md 

Sort all a file's failures by line, ignoring rule?

image

When I get a bunch of failure reports, my behavior is to go to the file and fix them in reverse order (so line numbers are preserved). It's pretty inconvenient to have them grouped by rule and therefore out of order. Can the default be to sort by line number?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.