mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-01-23 23:46:09 +01:00
Replace require("package.json") with constants.js to simplify and remove that file from markdownlint-browser.js.
This commit is contained in:
parent
8179adf38e
commit
c5345f45eb
6 changed files with 33 additions and 21 deletions
6
lib/constants.js
Normal file
6
lib/constants.js
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
// @ts-check
|
||||
|
||||
"use strict";
|
||||
|
||||
module.exports.homepage = "https://github.com/DavidAnson/markdownlint";
|
||||
module.exports.version = "0.24.0";
|
||||
|
|
@ -1102,7 +1102,7 @@ function readConfigSync(file, parsers, fs) {
|
|||
* @returns {string} SemVer string.
|
||||
*/
|
||||
function getVersion() {
|
||||
return require("../package.json").version;
|
||||
return require("./constants").version;
|
||||
}
|
||||
|
||||
// Export a/synchronous/Promise APIs
|
||||
|
|
|
|||
|
|
@ -2,9 +2,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const packageJson = require("../package.json");
|
||||
const homepage = packageJson.homepage;
|
||||
const version = packageJson.version;
|
||||
const { homepage, version } = require("./constants");
|
||||
|
||||
const rules = [
|
||||
require("./md001"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue