Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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";

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;
Copy link
Contributor

Choose a reason for hiding this comment

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

can't seem to export destructures in ESM, static vs dynamic?

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