Skip to content

Commit

Permalink
feat: lint JavaScript in Markdown (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
greatislander committed Aug 15, 2023
1 parent fe7a650 commit efac02a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 4 deletions.
11 changes: 9 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
module.exports = {
extends: [
"fluid",
"plugin:yml/standard"
"plugin:yml/standard",
"plugin:markdown/recommended"
],
ignorePatterns: ["_site/", "!.*.cjs", "!.*.js", "!.github/"],
env: {
Expand All @@ -14,5 +15,11 @@ module.exports = {
},
parserOptions: {
ecmaVersion: 2020
}
},
overrides: [
{
files: ["**/*.md"],
processor: "markdown/markdown"
}
]
};
25 changes: 25 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dev": "cross-env NODE_ENV=development eleventy --serve",
"lint": "run-s -l lint:*",
"lint:css": "stylelint \"**/*.css\"",
"lint:js": "eslint \"**/*.js\"",
"lint:js": "eslint \"**/*.{js,md}\"",
"lint:markdown": "markdownlint-cli2 \"**/*.md\"",
"lint:yml": "eslint \"**/*.yml\"",
"start": "npm-run-all -l clean -p start:*",
Expand Down Expand Up @@ -47,6 +47,7 @@
"eslint": "8.47.0",
"eslint-config-fluid": "2.1.1",
"eslint-plugin-jsdoc": "46.4.6",
"eslint-plugin-markdown": "3.0.1",
"eslint-plugin-yml": "1.8.0",
"husky": "8.0.3",
"image-size": "1.0.2",
Expand All @@ -64,6 +65,9 @@
"lint-staged": {
"*.css": "stylelint --fix",
"*.{js,yml}": "eslint --fix",
"*.md": "markdownlint-cli2 --fix"
"*.md": [
"markdownlint-cli2 --fix",
"eslint --fix"
]
}
}

0 comments on commit efac02a

Please sign in to comment.