GithubHelp home page GithubHelp logo

Comments (7)

DavidAnson avatar DavidAnson commented on July 19, 2024 2

See here for how to use the new functionality: https://github.com/DavidAnson/markdownlint#configuration

I believe this implementation addresses most of the scenarios @IanVS outlined with the exception of a single comment to disable a rule for a single line only. I know how I would implement that, but didn't want to complicate the initial implementation because it's just a shorthand convenience.

from markdownlint.

DavidAnson avatar DavidAnson commented on July 19, 2024

This is basically markdownlint/markdownlint#16, I believe. I left a comment there a while back about how I'd probably approach this - though I'd very much prefer that both implementations agree on a strategy. I'll try to get to this soon-ish. In the meanwhile, I'm already a submitter for ESLint - if you'd like to turn off MD010 globally, I can offer to turn it back on once this feature is available AND fix any unwanted violations that crept in along the way. Does that work in the short term?

from markdownlint.

IanVS avatar IanVS commented on July 19, 2024

Yep, that would do the trick. I have a temporary hack in place now that should get us through until something like this can be implemented.

As for the issue you linked to, I'm personally πŸ‘ for:

  • Should not appear in the rendered document
  • Should optionally allow a specific rule ID to be mentioned

but πŸ‘Ž for:

  • Should go on the same line where the rule violation occurred, if possible

...as it would preferably be able to handle a range of lines (or the entire file), maybe with a concept similar to /*eslint-disable*/ and /*eslint-enable*/.

from markdownlint.

mivok avatar mivok commented on July 19, 2024

I'll defer to however you want to implement it (presumably html comments at this point). Sadly, I haven't had much time to work on the ruby version lately.

markdownlint/markdownlint#16 was initially intended to be a rule exception for a specific line rather than disabling a rule for the whole file, but the ability to disable a rule entirely makes a lot of sense.

My rationale for putting something on the same line was for a quick simple exception for a specific occurrence of a rule violation where you didn't have to specify a line number. Something like ## Hello world <!-- ignore:MD002 -->. The intent here is for it to be an option to put it on the same line and exclude any line number information rather than for it to be a requirement to do so.

from markdownlint.

IanVS avatar IanVS commented on July 19, 2024

Hi, I completely get the reasoning behind disabling for a single line. ESLint has this concept as well. In fact, ESLint gives a lot of flexibility to configure rules:

  • Configure rules for entire file.
  • Disable/enable all linting for range of lines.
  • Disable/enable particular rule for range of lines.
  • Disable all linting for one line.
  • Disable particular rule for one line.

I don't know how feasible these are for your projects, but they certainly all come in handy for JavaScript linting.

from markdownlint.

DavidAnson avatar DavidAnson commented on July 19, 2024

I've submitted a PR for eslint to upgrade to markdownlint 0.0.8 which contains the functionality above:
eslint/eslint#3953

from markdownlint.

IanVS avatar IanVS commented on July 19, 2024

πŸ‘ Thanks! I will test this out in the next few days.

from markdownlint.

Related Issues (20)

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.