GithubHelp home page GithubHelp logo

Comments (3)

DavidAnson avatar DavidAnson commented on August 19, 2024

I created that schema because the VS Code extension vscode-markdownlint can use it to provide syntax highlighting in the editor (i.e., warning). How are you thinking to use the schema with markdownlint? Would you want to throw an exception if the user provides a config that isn't valid? My worry about that would be that it is too restrictive (i.e., error). For example, note that I use the unsupported comment key to add information to the sample styles: https://github.com/DavidAnson/markdownlint/blob/master/style/relaxed.json

I don't think I would want to block a valid user just because they had extra content in their JSON.

from markdownlint.

mizunashi-mana avatar mizunashi-mana commented on August 19, 2024

For example, note that I use the unsupported comment key to add information to the sample styles: https://github.com/DavidAnson/markdownlint/blob/master/style/relaxed.json

In this case, json schema permits additional properties on default. So, this is not problem.
However, there might be problems in other cases.

Yet, I think the rules structure of markdownlint are more complexity than other linter config.
For markdownlint developers, we should provide validations.
json-schema is flexible and has many supports. For example, we can nest such as:

{
  "type": "object",
  "properties": {
     "rules": {
         "$ref": "rules.schema.json"
     }
  }
}

ref: https://spacetelescope.github.io/understanding-json-schema/structuring.html

And, related writers can choose best library that suits them from many libraries.

I think providing json schema, providing cost saving and flexible validations for markdownlint tool writers.

from markdownlint.

DavidAnson avatar DavidAnson commented on August 19, 2024

I think this could work as a new validateSchema option - if true, an exception is thrown for an invalid schema. I use tv4 in vscode-markdownlint, so it would be fairly straightforward to add.

However, I'm reluctant to introduce a new dependencies for something non-essential like this. :( (There's currently just one and it's the Markdown parser!) I'd worry less about using devDependencies, but I'm not sure that works for the scenario you have in mind.

I may need to think about this more.

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.