Comments (8)
Here's how I think you would do that today: Create desired rules in JSON file, put in npm package, publish, reference that package from each of your projects, "extend" it from each of those .markdownlint.json files (by relative path into node_modules). Would this work for you? If not, what's missing?
from markdownlint.
If that works for you, I'll close this issue in a day or two.
from markdownlint.
Yes sorry, that solution is definitely workable, not pretty, but it'll work!
from markdownlint.
How is it any uglier than what ESLint does? If you want, you can do the require/exports thing here as well. Only difference I see is the need for a require statement, but that seems trivial. Am I missing something?
from markdownlint.
ESLint supports specifying the package as simply a name, not a relative path, so you could do something like this:
{
"extends": "markdownlint-config-example",
"default": true
}
ESLint does a nice thing where example
is also possible, as it'd automatically prepend eslint-config-
when resolving the config.
If I understand the solution suggested, markdownlint would instead require:
{
"extends": "./node_modules/markdownlint-config-example",
"default": true
}
Very minor difference 😃
from markdownlint.
Yes, that was my original suggestion!
If you're willing to do this in code, you can create a package that exports whatever config you want and then do something like:
var config = {
extends: require("my-config-module")
}
Or even:
{
extends: require("my-config-module").mySpecialConfig
}
All of which works today. :)
from markdownlint.
Excellent, I missed that, thanks for showing an example! Looks like I've got some configs to consolidate now 😄
from markdownlint.
Great! If you feel like starting a library of configs that other people could reuse in their own projects, I'll link to it from the README. No pressure, just an idea I had. :)
from markdownlint.
Related Issues (20)
- No bare-urls when using _redirects file HOT 1
- MD033 - Inline HTML Not ignoring custom HTML tags, but recognizing them as tags HOT 2
- MD033: Organizing information with collapsed sections HOT 7
- MD045: no-alt-text triggered even though html alt-text is specified HOT 2
- QUESTION: Is it possible to write custom linting rules, including Quick Fix information, for frontmatter? HOT 2
- Copyright HOT 1
- MD056/table-column-count counts pipes inside backticks as column separators HOT 2
- MD014 only considers the `$` sign, is this intentional? HOT 2
- Umlauts like Ä, Ö, Ü in Mailadresses/URLs are not detected as normal letters HOT 5
- HTML disable/enables comments triggered when inside Markdown inline code HOT 4
- Frontmatter interpreted as top-level heading HOT 8
- `markdownlint-disable-next-line` should apply to the next non-empty line HOT 1
- MD045 shown when image has alt text in the optional title HOT 3
- MD029/ol-prefix: Continuous list with more than 10 elements HOT 1
- Include additional schema/types for strict rule name verification HOT 2
- Diabling rules from the front matter? HOT 2
- 11 12 14 16 HOT 3
- Reference links are lost between dollar signs HOT 7
- Feature Request: Recognize `markdownlint-*` configuration comments in "non-HTML comments" (unused link reference definitions) HOT 1
- MD036: doesn't fire when any HTML comment is present on the same line.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from markdownlint.