mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
chore: Use ESLint overrides for config (#348)
This commit is contained in:
parent
a9d25b04ac
commit
0c309c63c1
4 changed files with 36 additions and 6 deletions
|
|
@ -3,3 +3,4 @@ demo/markdownlint-browser.js
|
||||||
demo/markdownlint-browser.min.js
|
demo/markdownlint-browser.min.js
|
||||||
demo/markdownlint-rule-helpers-browser.js
|
demo/markdownlint-rule-helpers-browser.js
|
||||||
example/typescript/type-check.js
|
example/typescript/type-check.js
|
||||||
|
lib-es3/
|
||||||
|
|
|
||||||
|
|
@ -180,5 +180,36 @@
|
||||||
"unicorn/prevent-abbreviations": "off",
|
"unicorn/prevent-abbreviations": "off",
|
||||||
"unicorn/string-content": "error",
|
"unicorn/string-content": "error",
|
||||||
"unicorn/throw-new-error": "error"
|
"unicorn/throw-new-error": "error"
|
||||||
}
|
},
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": [
|
||||||
|
"demo/*.js"
|
||||||
|
],
|
||||||
|
"env": {
|
||||||
|
"browser": true
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"jsdoc/require-jsdoc": "off",
|
||||||
|
"unicorn/prefer-query-selector": "off",
|
||||||
|
"unicorn/prefer-add-event-listener": "off",
|
||||||
|
"no-console": "off",
|
||||||
|
"no-shadow": "off",
|
||||||
|
"no-var": "off"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": [
|
||||||
|
"example/*.js"
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"node/no-missing-require": "off",
|
||||||
|
"node/no-extraneous-require": "off",
|
||||||
|
"no-console": "off",
|
||||||
|
"no-invalid-this": "off",
|
||||||
|
"no-shadow": "off",
|
||||||
|
"object-property-newline": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
/* eslint-disable jsdoc/require-jsdoc */
|
|
||||||
|
|
||||||
(function main() {
|
(function main() {
|
||||||
// DOM elements
|
// DOM elements
|
||||||
var markdown = document.getElementById("markdown");
|
var markdown = document.getElementById("markdown");
|
||||||
|
|
@ -166,7 +164,7 @@
|
||||||
|
|
||||||
// Show library version
|
// Show library version
|
||||||
document.getElementById("version").textContent =
|
document.getElementById("version").textContent =
|
||||||
"(v" + markdownlint.getVersion() + ")";
|
"(v" + window.markdownlint.getVersion() + ")";
|
||||||
|
|
||||||
// Add event listeners
|
// Add event listeners
|
||||||
document.body.addEventListener("dragover", onDragOver);
|
document.body.addEventListener("dragover", onDragOver);
|
||||||
|
|
@ -208,7 +206,7 @@
|
||||||
// Update Markdown from hash (if present)
|
// Update Markdown from hash (if present)
|
||||||
if (window.location.hash) {
|
if (window.location.hash) {
|
||||||
try {
|
try {
|
||||||
const decodedHash = decodeURIComponent(window.location.hash.substring(1));
|
var decodedHash = decodeURIComponent(window.location.hash.substring(1));
|
||||||
if (hashPrefix === decodedHash.substring(0, hashPrefix.length)) {
|
if (hashPrefix === decodedHash.substring(0, hashPrefix.length)) {
|
||||||
markdown.value = decodedHash.substring(hashPrefix.length);
|
markdown.value = decodedHash.substring(hashPrefix.length);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
"test-cover": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 tape test/markdownlint-test.js test/markdownlint-test-custom-rules.js test/markdownlint-test-helpers.js test/markdownlint-test-result-object.js test/markdownlint-test-scenarios.js",
|
"test-cover": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 tape test/markdownlint-test.js test/markdownlint-test-custom-rules.js test/markdownlint-test-helpers.js test/markdownlint-test-result-object.js test/markdownlint-test-scenarios.js",
|
||||||
"test-declaration": "cd example/typescript && tsc && node type-check.js",
|
"test-declaration": "cd example/typescript && tsc && node type-check.js",
|
||||||
"test-extra": "node test/markdownlint-test-extra.js",
|
"test-extra": "node test/markdownlint-test-extra.js",
|
||||||
"lint": "eslint --max-warnings 0 lib helpers test schema && eslint --env browser --global markdownit --global markdownlint --rule \"no-unused-vars: 0, no-extend-native: 0, max-statements: 0, no-console: 0, no-var: 0, unicorn/prefer-add-event-listener: 0, unicorn/prefer-query-selector: 0, unicorn/prefer-replace-all: 0\" demo && eslint --rule \"no-console: 0, no-invalid-this: 0, no-shadow: 0, object-property-newline: 0, node/no-missing-require: 0, node/no-extraneous-require: 0\" example",
|
"lint": "eslint --max-warnings 0 .",
|
||||||
"ci": "npm run test-cover && npm run lint && npm run test-declaration",
|
"ci": "npm run test-cover && npm run lint && npm run test-declaration",
|
||||||
"build-config-schema": "node schema/build-config-schema.js",
|
"build-config-schema": "node schema/build-config-schema.js",
|
||||||
"build-declaration": "tsc --allowJs --declaration --emitDeclarationOnly --resolveJsonModule lib/markdownlint.js && rimraf 'lib/{c,md,r}*.d.ts' 'helpers/*.d.ts'",
|
"build-declaration": "tsc --allowJs --declaration --emitDeclarationOnly --resolveJsonModule lib/markdownlint.js && rimraf 'lib/{c,md,r}*.d.ts' 'helpers/*.d.ts'",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue