markdownlint-cli icon indicating copy to clipboard operation
markdownlint-cli copied to clipboard

Ignore "node_modules" by default

Open Chrico opened this issue 1 year ago • 4 comments

By default the node_modules-folder is not ignored. It should be considered - to align with ESLint and Stylelint - to ignore the folder by default.

ESLint https://eslint.org/docs/latest/use/configure/ignore

In addition to any patterns in the .eslintignore file, ESLint always follows a couple of implicit ignore rules even if the --no-ignore flag is passed. The implicit rules are as follows:

  • node_modules/ is ignored.

Stylelint https://stylelint.io/user-guide/configure/

Stylelint ignores the node_modules directory by default. However, this is overridden if ignoreFiles is set.

Chrico avatar Jun 26 '23 07:06 Chrico

Feels a little like magic - and then it forces other parts of the code to be more complicated (see StyleLint comment you quoted, now there needs to be a way to un-ignore, etc.). That said, I can see why this is handy if you only care about Node projects.

DavidAnson avatar Jun 26 '23 16:06 DavidAnson

Jip, that's true, you (maybe) need to find a way to "un-ignore" it. But is there actually any use case, why I would like to lint markdown files comming from external dependencies? :)

Chrico avatar Jun 27 '23 06:06 Chrico

VS Code's default ignore list includes bower_components, among others. Should some of those directories be be ignored by default as well? This tool is written in JavaScript, but can be used anywhere. Do other ecosystems have other special folders? Where does the magic stop? :)

DavidAnson avatar Jun 27 '23 07:06 DavidAnson

Hi @DavidAnson,

Should some of those directories be be ignored by default as well? This tool is written in JavaScript, but can be used anywhere.

IMO, since this is an npm package, as a first start, I'd only ignore the node_modules/ folder. If there's demand for folder structures from other package managers, these could be added later. Thanks!

tyrann0us avatar Jun 27 '23 08:06 tyrann0us