-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore(deps-dev): bump markdownlint from 0.36.1 to 0.37.3 Bumps [markdownlint](https://github.com/DavidAnson/markdownlint) from 0.36.1 to 0.37.3. - [Changelog](https://github.com/DavidAnson/markdownlint/blob/main/CHANGELOG.md) - [Commits](DavidAnson/markdownlint@v0.36.1...v0.37.3) --- updated-dependencies: - dependency-name: markdownlint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * breaking: convert from CommonJS -> ESM * Update `README` with ESM examples * Update to version 0.2.0 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Joyce Zhu <[email protected]>
- Loading branch information
1 parent
8493df4
commit 607c420
Showing
23 changed files
with
175 additions
and
150 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"root": true, | ||
"parserOptions": { | ||
"ecmaVersion": 2020 | ||
}, | ||
"env": { | ||
"es6": true, | ||
"node": true, | ||
"jest": true | ||
}, | ||
"plugins": ["github"], | ||
"extends": ["plugin:github/recommended"], | ||
"rules": { | ||
"filenames/match-regex": "off", | ||
"i18n-text/no-en": "off", | ||
"import/extensions": ["error", { "js": "ignorePackages"}], | ||
"import/no-unresolved": [ | ||
"error", | ||
{ | ||
"ignore": ["^markdownlint/.+"] | ||
} | ||
] | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { init } from "./index.js"; | ||
|
||
const configOptions = await init({ | ||
default: false, | ||
"heading-increment": true, | ||
"no-alt-text": true, | ||
"single-h1": true, | ||
"no-emphasis-as-heading": true, | ||
"first-line-heading": true, | ||
}); | ||
const options = { | ||
config: configOptions, | ||
customRules: ["./index.js"], | ||
}; | ||
export default options; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
14 | ||
18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Changelog | ||
|
||
## 0.2.0 | ||
|
||
* BREAKING change: Convert to ECMAScript modules (ESM) | ||
|
||
## 0.1.0 | ||
|
||
* Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,25 @@ | ||
const _ = require("lodash"); | ||
import { readFile } from "fs/promises"; | ||
import _ from "lodash-es"; | ||
import { githubMarkdownLint } from "./src/rules/index.js"; | ||
|
||
const accessibilityRules = require("./style/accessibility.json"); | ||
const base = require("./style/base.json"); | ||
const gitHubCustomRules = require("./src/rules/index").rules; | ||
const offByDefault = ["no-empty-alt-text"]; | ||
|
||
module.exports = [...gitHubCustomRules]; | ||
export async function init(consumerConfig) { | ||
// left overwrites right | ||
const accessibilityRules = JSON.parse( | ||
await readFile(new URL("./style/accessibility.json", import.meta.url)), | ||
); | ||
|
||
const offByDefault = ["no-empty-alt-text"]; | ||
const base = JSON.parse( | ||
await readFile(new URL("./style/base.json", import.meta.url)), | ||
); | ||
|
||
for (const rule of gitHubCustomRules) { | ||
const ruleName = rule.names[1]; | ||
base[ruleName] = offByDefault.includes(ruleName) ? false : true; | ||
} | ||
for (const rule of githubMarkdownLint) { | ||
const ruleName = rule.names[1]; | ||
base[ruleName] = offByDefault.includes(ruleName) ? false : true; | ||
} | ||
|
||
module.exports.init = function init(consumerConfig) { | ||
// left overwrites right | ||
return _.defaultsDeep(consumerConfig, accessibilityRules, base); | ||
}; | ||
} | ||
|
||
export default githubMarkdownLint; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"transform": { | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
/* Downcase and strip extra whitespaces and punctuation */ | ||
function stripAndDowncaseText(text) { | ||
export function stripAndDowncaseText(text) { | ||
return text | ||
.toLowerCase() | ||
.replace(/[.,/#!$%^&*;:{}=\-_`~()]/g, "") | ||
.replace(/\s+/g, " ") | ||
.trim(); | ||
} | ||
|
||
module.exports = { stripAndDowncaseText }; |
Oops, something went wrong.