eslint-plugin-markdown-preferences 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +110 -0
- package/lib/index.d.ts +76 -0
- package/lib/index.js +251 -0
- package/package.json +124 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Yosuke Ota
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Introduction
|
|
2
|
+
|
|
3
|
+
[eslint-plugin-markdown-preferences](https://www.npmjs.com/package/eslint-plugin-markdown-preferences) is ESLint plugin that enforces our markdown preferences.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/eslint-plugin-markdown-preferences)
|
|
6
|
+
[](https://www.npmjs.com/package/eslint-plugin-markdown-preferences)
|
|
7
|
+
[](http://www.npmtrends.com/eslint-plugin-markdown-preferences)
|
|
8
|
+
[](http://www.npmtrends.com/eslint-plugin-markdown-preferences)
|
|
9
|
+
[](http://www.npmtrends.com/eslint-plugin-markdown-preferences)
|
|
10
|
+
[](http://www.npmtrends.com/eslint-plugin-markdown-preferences)
|
|
11
|
+
[](http://www.npmtrends.com/eslint-plugin-markdown-preferences)
|
|
12
|
+
[](https://github.com/ota-meshi/eslint-plugin-markdown-preferences/actions/workflows/NodeCI.yml)
|
|
13
|
+
|
|
14
|
+
## 📛 Features
|
|
15
|
+
|
|
16
|
+
ESLint plugin that enforces our markdown preferences.
|
|
17
|
+
|
|
18
|
+
You can check on the [Online DEMO](https://eslint-online-playground.netlify.app/#eslint-plugin-markdown-preferences).
|
|
19
|
+
|
|
20
|
+
<!--DOCS_IGNORE_START-->
|
|
21
|
+
|
|
22
|
+
## 📖 Documentation
|
|
23
|
+
|
|
24
|
+
See [documents](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/).
|
|
25
|
+
|
|
26
|
+
## 💿 Installation
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install --save-dev eslint eslint-plugin-markdown-preferences
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
<!--DOCS_IGNORE_END-->
|
|
33
|
+
|
|
34
|
+
## 📖 Usage
|
|
35
|
+
|
|
36
|
+
<!--USAGE_SECTION_START-->
|
|
37
|
+
<!--USAGE_GUIDE_START-->
|
|
38
|
+
|
|
39
|
+
### Configuration
|
|
40
|
+
|
|
41
|
+
#### New Config (`eslint.config.js`)
|
|
42
|
+
|
|
43
|
+
Use `eslint.config.js` file to configure rules. See also: <https://eslint.org/docs/latest/use/configure/configuration-files-new>.
|
|
44
|
+
|
|
45
|
+
Example **eslint.config.js**:
|
|
46
|
+
|
|
47
|
+
```js
|
|
48
|
+
import { defineConfig } from "eslint/config";
|
|
49
|
+
// import markdown from "@eslint/markdown";
|
|
50
|
+
import markdownPreferences from 'eslint-plugin-markdown-preferences';
|
|
51
|
+
export default [
|
|
52
|
+
// add more generic rule sets here, such as:
|
|
53
|
+
// markdown.configs.recommended,
|
|
54
|
+
markdownPreferences.configs.recommended,
|
|
55
|
+
{
|
|
56
|
+
rules: {
|
|
57
|
+
// override/add rules settings here, such as:
|
|
58
|
+
// 'markdown-preferences/prefer-linked-words': 'error'
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
];
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
This plugin provides configs:
|
|
65
|
+
|
|
66
|
+
- `*.configs.recommended` ... Recommended config provided by the plugin.
|
|
67
|
+
|
|
68
|
+
See [the rule list](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/) to get the `rules` that this plugin provides.
|
|
69
|
+
|
|
70
|
+
#### Legacy Config (`.eslintrc`)
|
|
71
|
+
|
|
72
|
+
Is not supported.
|
|
73
|
+
|
|
74
|
+
<!--USAGE_GUIDE_END-->
|
|
75
|
+
<!--USAGE_SECTION_END-->
|
|
76
|
+
|
|
77
|
+
## ✅ Rules
|
|
78
|
+
|
|
79
|
+
<!--RULES_SECTION_START-->
|
|
80
|
+
|
|
81
|
+
The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) automatically fixes problems reported by rules which have a wrench 🔧 below.
|
|
82
|
+
The rules with the following star ⭐ are included in the configs.
|
|
83
|
+
|
|
84
|
+
<!--RULES_TABLE_START-->
|
|
85
|
+
|
|
86
|
+
### Markdown Rules
|
|
87
|
+
|
|
88
|
+
| Rule ID | Description | Fixable | RECOMMENDED |
|
|
89
|
+
|:--------|:------------|:-------:|:-----------:|
|
|
90
|
+
| [markdown-preferences/hard-linebreak-style](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/hard-linebreak-style.html) | enforce consistent hard linebreak style. | 🔧 | ⭐ |
|
|
91
|
+
| [markdown-preferences/prefer-linked-words](https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/prefer-linked-words.html) | enforce the specified word to be a link. | 🔧 | |
|
|
92
|
+
|
|
93
|
+
<!--RULES_TABLE_END-->
|
|
94
|
+
<!--RULES_SECTION_END-->
|
|
95
|
+
<!--DOCS_IGNORE_START-->
|
|
96
|
+
|
|
97
|
+
## 🍻 Contributing
|
|
98
|
+
|
|
99
|
+
Welcome contributing!
|
|
100
|
+
|
|
101
|
+
Please use GitHub's Issues/PRs.
|
|
102
|
+
|
|
103
|
+
### Development Tools
|
|
104
|
+
|
|
105
|
+
- `npm test` runs tests and measures coverage.
|
|
106
|
+
- `npm run update` runs in order to update readme and recommended configuration.
|
|
107
|
+
|
|
108
|
+
## 🔒 License
|
|
109
|
+
|
|
110
|
+
See the [LICENSE](LICENSE) file for license rights and limitations (MIT).
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as _eslint_core from '@eslint/core';
|
|
2
|
+
import { RuleDefinition } from '@eslint/core';
|
|
3
|
+
import { Linter, ESLint } from 'eslint';
|
|
4
|
+
import markdown from '@eslint/markdown';
|
|
5
|
+
|
|
6
|
+
declare module 'eslint' {
|
|
7
|
+
namespace Linter {
|
|
8
|
+
interface RulesRecord extends RuleOptions {
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
interface RuleOptions {
|
|
13
|
+
/**
|
|
14
|
+
* enforce consistent hard linebreak style.
|
|
15
|
+
* @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/hard-linebreak-style.html
|
|
16
|
+
*/
|
|
17
|
+
'markdown-preferences/hard-linebreak-style'?: Linter.RuleEntry<MarkdownPreferencesHardLinebreakStyle>;
|
|
18
|
+
/**
|
|
19
|
+
* enforce the specified word to be a link.
|
|
20
|
+
* @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/prefer-linked-words.html
|
|
21
|
+
*/
|
|
22
|
+
'markdown-preferences/prefer-linked-words'?: Linter.RuleEntry<MarkdownPreferencesPreferLinkedWords>;
|
|
23
|
+
}
|
|
24
|
+
type MarkdownPreferencesHardLinebreakStyle = [] | [
|
|
25
|
+
{
|
|
26
|
+
style?: ("backslash" | "spaces");
|
|
27
|
+
}
|
|
28
|
+
];
|
|
29
|
+
type MarkdownPreferencesPreferLinkedWords = [] | [
|
|
30
|
+
{
|
|
31
|
+
words: ({
|
|
32
|
+
[k: string]: (string | null);
|
|
33
|
+
} | string[]);
|
|
34
|
+
[k: string]: unknown | undefined;
|
|
35
|
+
}
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
declare const name$1 = "markdown-preferences/recommended";
|
|
39
|
+
declare const files: string[];
|
|
40
|
+
declare const language = "markdown/commonmark";
|
|
41
|
+
declare const plugins: {
|
|
42
|
+
markdown: typeof markdown;
|
|
43
|
+
readonly "markdown-preferences": ESLint.Plugin;
|
|
44
|
+
};
|
|
45
|
+
declare const rules$1: Linter.RulesRecord;
|
|
46
|
+
|
|
47
|
+
declare const recommended_files: typeof files;
|
|
48
|
+
declare const recommended_language: typeof language;
|
|
49
|
+
declare const recommended_plugins: typeof plugins;
|
|
50
|
+
declare namespace recommended {
|
|
51
|
+
export { recommended_files as files, recommended_language as language, name$1 as name, recommended_plugins as plugins, rules$1 as rules };
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
declare const name: "eslint-plugin-markdown-preferences";
|
|
55
|
+
declare const version: "0.1.0";
|
|
56
|
+
|
|
57
|
+
declare const meta_name: typeof name;
|
|
58
|
+
declare const meta_version: typeof version;
|
|
59
|
+
declare namespace meta {
|
|
60
|
+
export { meta_name as name, meta_version as version };
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
declare const configs: {
|
|
64
|
+
recommended: typeof recommended;
|
|
65
|
+
};
|
|
66
|
+
declare const rules: Record<string, RuleDefinition>;
|
|
67
|
+
|
|
68
|
+
declare const _default: {
|
|
69
|
+
meta: typeof meta;
|
|
70
|
+
configs: {
|
|
71
|
+
recommended: typeof recommended;
|
|
72
|
+
};
|
|
73
|
+
rules: Record<string, RuleDefinition<_eslint_core.RuleDefinitionTypeOptions>>;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export { configs, _default as default, meta, rules };
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import markdown from '@eslint/markdown';
|
|
3
|
+
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name3 in all)
|
|
7
|
+
__defProp(target, name3, { get: all[name3], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
// src/utils/index.ts
|
|
11
|
+
function createRule(ruleName, rule) {
|
|
12
|
+
return {
|
|
13
|
+
meta: {
|
|
14
|
+
...rule.meta,
|
|
15
|
+
docs: {
|
|
16
|
+
...rule.meta.docs,
|
|
17
|
+
url: `https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/${ruleName}.html`,
|
|
18
|
+
ruleId: `markdown-preferences/${ruleName}`,
|
|
19
|
+
ruleName
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
create(context) {
|
|
23
|
+
return rule.create(context);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// src/rules/hard-linebreak-style.ts
|
|
29
|
+
var hard_linebreak_style_default = createRule("hard-linebreak-style", {
|
|
30
|
+
meta: {
|
|
31
|
+
type: "layout",
|
|
32
|
+
docs: {
|
|
33
|
+
description: "enforce consistent hard linebreak style.",
|
|
34
|
+
categories: ["recommended"]
|
|
35
|
+
},
|
|
36
|
+
fixable: "code",
|
|
37
|
+
hasSuggestions: false,
|
|
38
|
+
schema: [
|
|
39
|
+
{
|
|
40
|
+
type: "object",
|
|
41
|
+
properties: {
|
|
42
|
+
style: {
|
|
43
|
+
enum: ["backslash", "spaces"]
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
additionalProperties: false
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
messages: {
|
|
50
|
+
expectedBackslash: "Expected a backslash linebreak.",
|
|
51
|
+
expectedSpaces: "Expected a space linebreak."
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
create(context) {
|
|
55
|
+
const sourceCode = context.sourceCode;
|
|
56
|
+
const linebreakStyle = context.options[0]?.style || "backslash";
|
|
57
|
+
return {
|
|
58
|
+
break: (node) => {
|
|
59
|
+
const text = sourceCode.getText(node);
|
|
60
|
+
if (linebreakStyle === "backslash" && !text.startsWith("\\")) {
|
|
61
|
+
context.report({
|
|
62
|
+
node,
|
|
63
|
+
messageId: "expectedBackslash",
|
|
64
|
+
fix(fixer) {
|
|
65
|
+
return fixer.replaceText(node, "\\\n");
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
} else if (linebreakStyle === "spaces" && !text.startsWith(" ")) {
|
|
69
|
+
context.report({
|
|
70
|
+
node,
|
|
71
|
+
messageId: "expectedSpaces",
|
|
72
|
+
fix(fixer) {
|
|
73
|
+
return fixer.replaceText(node, " \n");
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
var prefer_linked_words_default = createRule("prefer-linked-words", {
|
|
82
|
+
meta: {
|
|
83
|
+
type: "suggestion",
|
|
84
|
+
docs: {
|
|
85
|
+
description: "enforce the specified word to be a link.",
|
|
86
|
+
categories: []
|
|
87
|
+
},
|
|
88
|
+
fixable: "code",
|
|
89
|
+
hasSuggestions: false,
|
|
90
|
+
schema: [
|
|
91
|
+
{
|
|
92
|
+
type: "object",
|
|
93
|
+
properties: {
|
|
94
|
+
words: {
|
|
95
|
+
anyOf: [
|
|
96
|
+
{
|
|
97
|
+
type: "object",
|
|
98
|
+
patternProperties: {
|
|
99
|
+
"^[\\s\\S]+$": {
|
|
100
|
+
type: ["string", "null"]
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
type: "array",
|
|
106
|
+
items: {
|
|
107
|
+
type: "string"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
required: ["words"]
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
messages: {
|
|
117
|
+
requireLink: 'The word "{{name}}" should be a link.'
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
create(context) {
|
|
121
|
+
const sourceCode = context.sourceCode;
|
|
122
|
+
const words = context.options[0]?.words || {};
|
|
123
|
+
const wordEntries = (Array.isArray(words) ? words.map((word) => [word, void 0]) : Object.entries(words)).map(
|
|
124
|
+
([word, link]) => [word, link ? adjustLink(link) : void 0]
|
|
125
|
+
).filter(([, link]) => link !== `./${path.basename(context.filename)}`);
|
|
126
|
+
let ignore = null;
|
|
127
|
+
return {
|
|
128
|
+
"link, linkReference, heading"(node) {
|
|
129
|
+
if (ignore) return;
|
|
130
|
+
ignore = node;
|
|
131
|
+
},
|
|
132
|
+
"link, linkReference, heading:exit"(node) {
|
|
133
|
+
if (ignore === node) ignore = null;
|
|
134
|
+
},
|
|
135
|
+
text(node) {
|
|
136
|
+
if (ignore) return;
|
|
137
|
+
for (const [word, link] of wordEntries) {
|
|
138
|
+
let startPosition = 0;
|
|
139
|
+
while (true) {
|
|
140
|
+
const index = node.value.indexOf(word, startPosition);
|
|
141
|
+
if (index < 0) break;
|
|
142
|
+
startPosition = index + word.length;
|
|
143
|
+
if ((node.value[index - 1] || "").trim() || (node.value[index + word.length] || "").trim()) {
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
const loc = sourceCode.getLoc(node);
|
|
147
|
+
const beforeLines = node.value.slice(0, index).split(/\n/u);
|
|
148
|
+
const line = loc.start.line + beforeLines.length - 1;
|
|
149
|
+
const column = (beforeLines.length === 1 ? loc.start.column : 1) + (beforeLines.at(-1) || "").length;
|
|
150
|
+
context.report({
|
|
151
|
+
node,
|
|
152
|
+
loc: {
|
|
153
|
+
start: { line, column },
|
|
154
|
+
end: { line, column: column + word.length }
|
|
155
|
+
},
|
|
156
|
+
messageId: "requireLink",
|
|
157
|
+
data: {
|
|
158
|
+
name: word
|
|
159
|
+
},
|
|
160
|
+
fix: link ? (fixer) => {
|
|
161
|
+
const [start] = sourceCode.getRange(node);
|
|
162
|
+
return fixer.replaceTextRange(
|
|
163
|
+
[start + index, start + index + word.length],
|
|
164
|
+
`[${word}](${link})`
|
|
165
|
+
);
|
|
166
|
+
} : null
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
inlineCode(node) {
|
|
172
|
+
if (ignore) return;
|
|
173
|
+
for (const [word, link] of wordEntries) {
|
|
174
|
+
if (node.value === word) {
|
|
175
|
+
context.report({
|
|
176
|
+
node,
|
|
177
|
+
messageId: "requireLink",
|
|
178
|
+
data: {
|
|
179
|
+
name: word
|
|
180
|
+
},
|
|
181
|
+
fix: link ? (fixer) => {
|
|
182
|
+
return fixer.replaceText(node, `[\`${word}\`](${link})`);
|
|
183
|
+
} : null
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
function adjustLink(link) {
|
|
190
|
+
if (/^\w+:/.test(link)) {
|
|
191
|
+
return link;
|
|
192
|
+
}
|
|
193
|
+
if (link.startsWith("#")) {
|
|
194
|
+
return link;
|
|
195
|
+
}
|
|
196
|
+
const absoluteLink = path.isAbsolute(link) ? link : path.join(context.cwd, link);
|
|
197
|
+
return `./${path.relative(path.dirname(context.filename), absoluteLink)}`;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
// src/utils/rules.ts
|
|
203
|
+
var rules = [hard_linebreak_style_default, prefer_linked_words_default];
|
|
204
|
+
|
|
205
|
+
// src/configs/recommended.ts
|
|
206
|
+
var recommended_exports = {};
|
|
207
|
+
__export(recommended_exports, {
|
|
208
|
+
files: () => files,
|
|
209
|
+
language: () => language,
|
|
210
|
+
name: () => name,
|
|
211
|
+
plugins: () => plugins,
|
|
212
|
+
rules: () => rules2
|
|
213
|
+
});
|
|
214
|
+
var name = "markdown-preferences/recommended";
|
|
215
|
+
var files = ["**/*.md"];
|
|
216
|
+
var language = "markdown/commonmark";
|
|
217
|
+
var plugins = {
|
|
218
|
+
markdown,
|
|
219
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- ignore
|
|
220
|
+
get "markdown-preferences"() {
|
|
221
|
+
return index_default;
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
var rules2 = {
|
|
225
|
+
// eslint-plugin-markdown-preferences rules
|
|
226
|
+
"markdown-preferences/hard-linebreak-style": "error"
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
// src/meta.ts
|
|
230
|
+
var meta_exports = {};
|
|
231
|
+
__export(meta_exports, {
|
|
232
|
+
name: () => name2,
|
|
233
|
+
version: () => version
|
|
234
|
+
});
|
|
235
|
+
var name2 = "eslint-plugin-markdown-preferences";
|
|
236
|
+
var version = "0.1.0";
|
|
237
|
+
|
|
238
|
+
// src/index.ts
|
|
239
|
+
var configs = {
|
|
240
|
+
recommended: recommended_exports
|
|
241
|
+
};
|
|
242
|
+
var rules3 = rules.reduce(
|
|
243
|
+
(obj, r) => {
|
|
244
|
+
obj[r.meta.docs.ruleName] = r;
|
|
245
|
+
return obj;
|
|
246
|
+
},
|
|
247
|
+
{}
|
|
248
|
+
);
|
|
249
|
+
var index_default = { meta: meta_exports, configs, rules: rules3 };
|
|
250
|
+
|
|
251
|
+
export { configs, index_default as default, meta_exports as meta, rules3 as rules };
|
package/package.json
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "eslint-plugin-markdown-preferences",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "ESLint plugin that enforces our markdown preferences",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"import": "./lib/index.js"
|
|
9
|
+
},
|
|
10
|
+
"./package.json": "./package.json"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"lib"
|
|
14
|
+
],
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": "^20.19.0 || ^22.12.0 || >=24.0.0"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "npm run build:meta && npm run build:tsup",
|
|
20
|
+
"build:meta": "npm run ts -- ./tools/update-meta.ts",
|
|
21
|
+
"build:tsup": "tsup",
|
|
22
|
+
"lint": "eslint .",
|
|
23
|
+
"tsc": "tsc --project tsconfig.build.json",
|
|
24
|
+
"eslint-fix": "eslint . --fix",
|
|
25
|
+
"test": "npm run mocha -- \"tests/src/**/*.ts\" --reporter=dot --timeout=60000",
|
|
26
|
+
"cover": "c8 --reporter=lcov npm run test",
|
|
27
|
+
"test:update": "npm run mocha -- \"tests/src/**/*.ts\" --reporter=dot --update",
|
|
28
|
+
"update": "npm run ts -- ./tools/update.ts && npm run eslint-fix",
|
|
29
|
+
"new": "npm run ts -- ./tools/new-rule.ts",
|
|
30
|
+
"docs:watch": "vitepress dev docs --open",
|
|
31
|
+
"docs:build": "vitepress build docs",
|
|
32
|
+
"ts": "node --import=tsx",
|
|
33
|
+
"mocha": "npm run ts ./node_modules/mocha/bin/mocha.js",
|
|
34
|
+
"generate:version": "env-cmd -e version npm run update && npm run lint -- --fix",
|
|
35
|
+
"changeset:version": "changeset version && npm run generate:version && git add --all",
|
|
36
|
+
"changeset:publish": "npm run build && changeset publish"
|
|
37
|
+
},
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "git+https://github.com/ota-meshi/eslint-plugin-markdown-preferences.git"
|
|
41
|
+
},
|
|
42
|
+
"keywords": [
|
|
43
|
+
"eslint",
|
|
44
|
+
"eslintplugin",
|
|
45
|
+
"eslint-plugin",
|
|
46
|
+
"markdown",
|
|
47
|
+
"preferences",
|
|
48
|
+
"lint"
|
|
49
|
+
],
|
|
50
|
+
"author": "Yosuke Ota",
|
|
51
|
+
"funding": "https://github.com/sponsors/ota-meshi",
|
|
52
|
+
"license": "MIT",
|
|
53
|
+
"bugs": {
|
|
54
|
+
"url": "https://github.com/ota-meshi/eslint-plugin-markdown-preferences/issues"
|
|
55
|
+
},
|
|
56
|
+
"homepage": "https://ota-meshi.github.io/eslint-plugin-markdown-preferences/",
|
|
57
|
+
"dependencies": {},
|
|
58
|
+
"peerDependencies": {
|
|
59
|
+
"eslint": ">=9.0.0",
|
|
60
|
+
"@eslint/markdown": "^7.1.0"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@changesets/changelog-github": "^0.5.1",
|
|
64
|
+
"@changesets/cli": "^2.28.1",
|
|
65
|
+
"@changesets/get-release-plan": "^4.0.8",
|
|
66
|
+
"@eslint/core": "^0.15.0",
|
|
67
|
+
"@eslint/markdown": "^7.1.0",
|
|
68
|
+
"@ota-meshi/eslint-plugin": "^0.17.6",
|
|
69
|
+
"@shikijs/vitepress-twoslash": "^3.0.0",
|
|
70
|
+
"@types/eslint": "^9.6.1",
|
|
71
|
+
"@types/eslint-scope": "^8.0.0",
|
|
72
|
+
"@types/eslint-utils": "^3.0.5",
|
|
73
|
+
"@types/estree": "^1.0.6",
|
|
74
|
+
"@types/json-schema": "^7.0.15",
|
|
75
|
+
"@types/mocha": "^10.0.10",
|
|
76
|
+
"@types/node": "^22.13.10",
|
|
77
|
+
"@types/semver": "^7.5.8",
|
|
78
|
+
"assert": "^2.1.0",
|
|
79
|
+
"c8": "^10.1.3",
|
|
80
|
+
"env-cmd": "^10.1.0",
|
|
81
|
+
"eslint": "^9.22.0",
|
|
82
|
+
"eslint-compat-utils": "^0.6.4",
|
|
83
|
+
"eslint-config-prettier": "^10.1.1",
|
|
84
|
+
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
85
|
+
"eslint-plugin-eslint-plugin": "^6.4.0",
|
|
86
|
+
"eslint-plugin-jsdoc": "^52.0.0",
|
|
87
|
+
"eslint-plugin-json-schema-validator": "^5.3.1",
|
|
88
|
+
"eslint-plugin-jsonc": "^2.19.1",
|
|
89
|
+
"eslint-plugin-markdown": "^5.1.0",
|
|
90
|
+
"eslint-plugin-n": "^17.16.2",
|
|
91
|
+
"eslint-plugin-node-dependencies": "^1.0.0",
|
|
92
|
+
"eslint-plugin-prettier": "^5.2.3",
|
|
93
|
+
"eslint-plugin-regexp": "^2.7.0",
|
|
94
|
+
"eslint-plugin-vue": "^10.0.0",
|
|
95
|
+
"eslint-plugin-yml": "^1.17.0",
|
|
96
|
+
"eslint-snapshot-rule-tester": "^0.1.0",
|
|
97
|
+
"eslint-typegen": "^2.0.0",
|
|
98
|
+
"espree": "^10.3.0",
|
|
99
|
+
"events": "^3.3.0",
|
|
100
|
+
"globals": "^16.0.0",
|
|
101
|
+
"mocha": "^11.1.0",
|
|
102
|
+
"pako": "^2.1.0",
|
|
103
|
+
"prettier": "^3.5.3",
|
|
104
|
+
"semver": "^7.7.1",
|
|
105
|
+
"stylelint": "^16.15.0",
|
|
106
|
+
"stylelint-config-recommended": "^17.0.0",
|
|
107
|
+
"stylelint-config-recommended-vue": "^1.6.0",
|
|
108
|
+
"stylelint-config-standard": "^39.0.0",
|
|
109
|
+
"stylelint-config-standard-vue": "^1.0.0",
|
|
110
|
+
"tsup": "^8.4.0",
|
|
111
|
+
"tsx": "^4.19.3",
|
|
112
|
+
"twoslash-eslint": "^0.3.1",
|
|
113
|
+
"type-fest": "^4.37.0",
|
|
114
|
+
"typescript": "~5.9.0",
|
|
115
|
+
"typescript-eslint": "^8.26.1",
|
|
116
|
+
"util": "^0.12.5",
|
|
117
|
+
"vite-plugin-eslint4b": "^0.6.0",
|
|
118
|
+
"vitepress": "^1.6.3",
|
|
119
|
+
"vue-eslint-parser": "^10.0.0"
|
|
120
|
+
},
|
|
121
|
+
"publishConfig": {
|
|
122
|
+
"access": "public"
|
|
123
|
+
}
|
|
124
|
+
}
|