Skip to content

Commit efac02a

Browse files
feat: lint JavaScript in Markdown (#17)
1 parent fe7a650 commit efac02a

File tree

3 files changed

+40
-4
lines changed

3 files changed

+40
-4
lines changed

.eslintrc.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
module.exports = {
44
extends: [
55
"fluid",
6-
"plugin:yml/standard"
6+
"plugin:yml/standard",
7+
"plugin:markdown/recommended"
78
],
89
ignorePatterns: ["_site/", "!.*.cjs", "!.*.js", "!.github/"],
910
env: {
@@ -14,5 +15,11 @@ module.exports = {
1415
},
1516
parserOptions: {
1617
ecmaVersion: 2020
17-
}
18+
},
19+
overrides: [
20+
{
21+
files: ["**/*.md"],
22+
processor: "markdown/markdown"
23+
}
24+
]
1825
};

package-lock.json

+25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"dev": "cross-env NODE_ENV=development eleventy --serve",
1212
"lint": "run-s -l lint:*",
1313
"lint:css": "stylelint \"**/*.css\"",
14-
"lint:js": "eslint \"**/*.js\"",
14+
"lint:js": "eslint \"**/*.{js,md}\"",
1515
"lint:markdown": "markdownlint-cli2 \"**/*.md\"",
1616
"lint:yml": "eslint \"**/*.yml\"",
1717
"start": "npm-run-all -l clean -p start:*",
@@ -47,6 +47,7 @@
4747
"eslint": "8.47.0",
4848
"eslint-config-fluid": "2.1.1",
4949
"eslint-plugin-jsdoc": "46.4.6",
50+
"eslint-plugin-markdown": "3.0.1",
5051
"eslint-plugin-yml": "1.8.0",
5152
"husky": "8.0.3",
5253
"image-size": "1.0.2",
@@ -64,6 +65,9 @@
6465
"lint-staged": {
6566
"*.css": "stylelint --fix",
6667
"*.{js,yml}": "eslint --fix",
67-
"*.md": "markdownlint-cli2 --fix"
68+
"*.md": [
69+
"markdownlint-cli2 --fix",
70+
"eslint --fix"
71+
]
6872
}
6973
}

0 commit comments

Comments
 (0)