Skip to content

Commit

Permalink
chore(release): 14.0.0 (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi authored Jan 28, 2019
1 parent 69a5e2c commit 91bf853
Show file tree
Hide file tree
Showing 11 changed files with 4,397 additions and 4,456 deletions.
11 changes: 7 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@ cache:

matrix:
include:
- node_js: '10'
- node_js: "11"
script: npm run pretest
env: CI=pretest
- node_js: '10'
- node_js: "11"
script: npm run test-only
env: CI=tests 11
- node_js: "10"
script: npm run test-only
env: CI=tests 10
- node_js: '8'
- node_js: "8"
script: npm run test-only
env: CI=tests 8
- node_js: '6'
- node_js: "6"
script: npm run test-only
env: CI=tests 6

Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.

This project adheres to [Semantic Versioning](http://semver.org).

## 13.0.0 - 2019-01-28

- Changed: allow using `_` in file names (`remark-lint-no-file-name-irregular-characters` rule).
- Chore: update `remark-validate-links` package.

## 12.0.1 - 2018-06-16

- Changed: drop `nodejs@4` support.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2017 itgalaxy inc.
Copyright (c) 2017-present itgalaxy inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 3 additions & 0 deletions __tests__/fixtures/MY_README_FILE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Header

Text
61 changes: 0 additions & 61 deletions __tests__/index.js

This file was deleted.

68 changes: 68 additions & 0 deletions __tests__/index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
const config = require("..");
const remark = require("remark");
const globby = require("globby");
const path = require("path");
const fs = require("fs");
const vfile = require("vfile");

function isObject(obj) {
return typeof obj === "object" && obj !== null;
}

describe("remark-preset-lint-itgalaxy", () => {
it("should have property `plugin`", () => {
expect(isObject(config.plugins)).toBe(true);
});

it("should have rules in property `lint` in `plugin` property", () => {
expect(Object.keys(config.plugins)).not.toHaveLength(0);
});

it("should have property `settings`", () => {
expect(isObject(config.settings)).toBe(true);
});

it("should have no error on valid syntax", () =>
globby(["fixtures/**/*.md"], {
absolute: true,
cwd: path.dirname(__filename)
}).then(filePaths =>
Promise.all(
filePaths.map(filePath =>
new Promise((resolve, reject) =>
fs.readFile(filePath, (error, contents) => {
if (error) {
return reject(error);
}

return resolve(contents);
})
).then(contents =>
new Promise((resolve, reject) => {
// Remove `remark-validate-links`, because it doesn't work not on CLI
config.plugins.splice(3, 1);

const file = vfile({
path: filePath,
contents: contents.toString()
});

return remark()
.use(config.plugins)
.process(file, (error, lintedFile) => {
if (error) {
return reject(error);
}

return resolve(lintedFile);
});
}).then(file => {
expect(file.messages).toHaveLength(0);

return true;
})
)
)
)
));
});
7 changes: 7 additions & 0 deletions husky.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"use strict";

module.exports = {
hooks: {
"pre-commit": "lint-staged"
}
};
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ module.exports = {
require("remark-lint-no-empty-url"),
require("remark-lint-no-file-name-articles"),
require("remark-lint-no-file-name-consecutive-dashes"),
require("remark-lint-no-file-name-irregular-characters"),
[
require("remark-lint-no-file-name-irregular-characters"),
"\\\\.a-zA-Z0-9-_"
],
require("remark-lint-no-file-name-mixed-case"),
require("remark-lint-no-file-name-outer-dashes"),
require("remark-lint-no-heading-like-paragraph"),
Expand Down
3 changes: 2 additions & 1 deletion lint-staged.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ module.exports = {
"prettier --list-different",
"remark -f -q",
"git add"
]
],
"*.{yml,yaml}": ["prettier --list-different", "git add"]
};
Loading

0 comments on commit 91bf853

Please sign in to comment.