Skip to content

Commit

Permalink
chore: migrate to eslint-mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
techfg committed Mar 22, 2024
1 parent 05db25d commit 910a245
Show file tree
Hide file tree
Showing 8 changed files with 12,264 additions and 726 deletions.
5 changes: 3 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"prettier",
"plugin:yml/standard",
"plugin:yml/prettier",
"plugin:markdown/recommended-legacy",
"plugin:mdx/recommended",
"plugin:jsonc/recommended-with-jsonc"
],
"plugins": ["html"],
Expand All @@ -28,7 +28,8 @@
},
"settings": {
"html/indent": "+2",
"html/report-bad-indent": "error"
"html/report-bad-indent": "error",
"mdx/code-blocks": true
},
"overrides": [
{
Expand Down
6 changes: 6 additions & 0 deletions .remarkignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# NOTE - This file is only used when running remark-cli, it is not used by eslint.
tests/redist/
examples/redist/
build/
dist/
node_modules/
23 changes: 23 additions & 0 deletions .remarkrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
settings: {
bullet: '-',
emphasis: '*',
listItemIndent: 'one',
quote: "'",
rule: '-',
strong: '*',
tightDefinitions: true
},
plugins: [
'remark-preset-lint-consistent',
'remark-preset-lint-markdown-style-guide',
'remark-preset-lint-recommended',
['remark-lint-list-item-indent', 'space'],
['remark-lint-maximum-line-length', false],
['remark-lint-list-item-spacing', { checkBlanks: true }],
['remark-lint-no-file-name-irregular-characters', false],
['remark-lint-ordered-list-marker-value', 'ordered'],
'remark-frontmatter',
'remark-gfm'
]
};
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"DavidAnson.vscode-markdownlint",
"unifiedjs.vscode-mdx",
"esbenp.prettier-vscode"
]
}
3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.fixAll.markdownlint": "explicit"
"source.fixAll.eslint": "explicit"
},
"eslint.validate": ["javascript", "html", "markdown", "yaml", "json", "jsonc"]
}
10 changes: 2 additions & 8 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,6 @@ module.exports = function (grunt) {
},
formatfix: {
command: 'prettier . --write'
},
mdlintcheck: {
command: 'markdownlint-cli2 "**/*.md"'
},
mdlintfix: {
command: 'markdownlint-cli2 --fix "**/*.md"'
}
},
eslint: {
Expand Down Expand Up @@ -219,8 +213,8 @@ module.exports = function (grunt) {
grunt.registerTask('debug', ['build', 'connect', 'watch']);
grunt.registerTask('example', ['build', 'connect:examples', 'watch']);
grunt.registerTask('test', ['build', 'connect:tests', 'watch']);
grunt.registerTask('lint', ['eslint:check', 'shell:mdlintcheck']);
grunt.registerTask('lint:fix', ['eslint:fix', 'shell:mdlintfix']);
grunt.registerTask('lint', ['eslint:check']);
grunt.registerTask('lint:fix', ['eslint:fix']);
grunt.registerTask('format', ['shell:formatcheck']);
grunt.registerTask('format:fix', ['shell:formatfix']);
grunt.registerTask('postBump', ['dist', 'bump-commit', 'shell:npmpublish']);
Expand Down
Loading

0 comments on commit 910a245

Please sign in to comment.