Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps-dev): bump markdownlint from 0.36.1 to 0.37.3 #135

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
18 changes: 0 additions & 18 deletions .eslintrc.js

This file was deleted.

18 changes: 18 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"root": true,
"parserOptions": {
"ecmaVersion": 2020
},
"env": {
"es6": true,
"node": true,
"jest": true
},
"plugins": ["github"],
"extends": ["plugin:github/recommended"],
"rules": {
"import/no-commonjs": "off",
"filenames/match-regex": "off",
"i18n-text/no-en": "off"
}
}
12 changes: 0 additions & 12 deletions .markdownlint-cli2.cjs

This file was deleted.

12 changes: 12 additions & 0 deletions .markdownlint-cli2.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { init } from "./index.js";
JoyceZhu marked this conversation as resolved.
Show resolved Hide resolved

const options = init({
default: false,
"heading-increment": true,
"no-alt-text": true,
"single-h1": true,
"no-emphasis-as-heading": true,
"first-line-heading": true,
});
export const config = options;
export const customRules = ["./index.js"];
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14
18
21 changes: 11 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
const _ = require("lodash");
import _ from "lodash-es";

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

regular lodash is synchronous

const accessibilityRules = require("./style/accessibility.json");
const base = require("./style/base.json");
const gitHubCustomRules = require("./src/rules/index").rules;

module.exports = [...gitHubCustomRules];
import accessibilityRules from "./style/accessibility.json";
import base from "./style/base.json";
import { githubMarkdownLint } from "./src/rules/index.js";

const offByDefault = ["no-empty-alt-text"];

for (const rule of gitHubCustomRules) {
for (const rule of githubMarkdownLint) {
const ruleName = rule.names[1];
base[ruleName] = offByDefault.includes(ruleName) ? false : true;
}

module.exports.init = function init(consumerConfig) {
export function init(consumerConfig) {
// left overwrites right
return _.defaultsDeep(consumerConfig, accessibilityRules, base);
};
const foo = _.defaultsDeep(consumerConfig, accessibilityRules, base);
return foo;
}

// export default githubMarkdownLint;
4 changes: 4 additions & 0 deletions jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"transform": {
}
}
Loading
Loading