Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit 6c42fb5

Browse files
authored
Merge pull request #141 from mobify/release-v2.7.1
Release v2.7.1
2 parents 0cebad0 + c9cabc3 commit 6c42fb5

File tree

21 files changed

+1074
-290
lines changed

21 files changed

+1074
-290
lines changed

CHANGELOG

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1+
2.7.1
2+
- Re-organized and cleaned up markdown linting files
3+
- Switched to using `no-duplicate-headings-in-section` (instead of `no-duplicate-headings`)
4+
- Add `spaced-comment` rule enforcement to ES5 and legacy (ESLint 1.x or lower) linting [#132](https://github.com/mobify/mobify-code-style/pull/132)
15
2.7.0
26
- Remove `variable-for-property` rule from sass-lint
37
- Adds markdown linting via `lint-md` script
48
- Add ESLint and Atom Text integration how-to doc
5-
69
2.6.0
710
- Remove `variable-for-property` rule from sass-lint [#126](https://github.com/mobify/mobify-code-style/pull/126)
811
- Add the eslint jsx-a11y plugin through a new `mobify-es6-react-a11y` configuration [#129](https://github.com/mobify/mobify-code-style/pull/129)
9-
1012
2.5.3
1113
- Fix #123 by using react/jsx-wrap-multilines rule
1214
- Migrate CSSComb documentation from Confluence to code style repo

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
A repo to document code standards for different languages and provide tools for linting Mobify projects.
44

55
[![NPM version](https://badge.fury.io/js/mobify-code-style.svg)](http://badge.fury.io/js/mobify-code-style)
6+
[![CircleCI](https://circleci.com/gh/mobify/mobify-code-style/tree/develop.svg?style=svg)](https://circleci.com/gh/mobify/mobify-code-style/tree/develop)
67

78
## JavaScript (ES5) with Grunt
89

@@ -25,7 +26,6 @@ extends:
2526
- './node_modules/mobify-code-style/es5/mobify-es5.yml'
2627
```
2728
28-
2929
Sample eslint Grunt config:
3030
3131
```javascript
@@ -103,4 +103,4 @@ instructions on using `pep8`, `pylint` and `pyflakes` to check Python code.
103103

104104
## Documentation
105105

106-
See the [`docs`](docs) directory for setup and configuration of Markdown linting.
106+
See the [`docs`](docs) directory for setup and configuration of Markdown linting.

assets/atom-linter-settings.png

22.1 KB
Loading

bin/lint-md

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
> Write great documentation! – * [_Mobify Developer Values_](https://github.com/mobify/developer-values#️-write-great-documentation)
1+
> Write great documentation! – \* [_Mobify Developer Values_](https://github.com/mobify/developer-values#️-write-great-documentation)
22
33
At Mobify, documentation is written in markdown.
44

@@ -9,8 +9,8 @@ docs.mobify.com.
99

1010
To make writing document easier, we provide:
1111

12-
* A linter for consistent markdown style.
13-
* A writing checklist for consistent process.
12+
- A linter for consistent markdown style.
13+
- A writing checklist for consistent process.
1414

1515
### Markdown Linting
1616

@@ -32,22 +32,24 @@ npm install --save-dev mobify-code-style
3232
**Before you start writing**
3333

3434
Write down the goal of your document.
35-
* Does a similar document exist? Could it be extended to meet the goal?
36-
* Does your document fit in an existing category? If so, which one?
35+
36+
- Does a similar document exist? Could it be extended to meet the goal?
37+
- Does your document fit in an existing category? If so, which one?
3738

3839
Who is your audience? What is their skill level?
3940

4041
What kind of document best meets your goal?
41-
* [Step-by-step tutorials](https://jacobian.org/writing/what-to-write/#tutorials)
42-
* [Overview or topical guide to a conceptual area](https://jacobian.org/writing/what-to-write/#topical-guides)
43-
* [Low-level, deep-dive reference material](https://jacobian.org/writing/what-to-write/#reference)
42+
43+
- [Step-by-step tutorials](https://jacobian.org/writing/what-to-write/#tutorials)
44+
- [Overview or topical guide to a conceptual area](https://jacobian.org/writing/what-to-write/#topical-guides)
45+
- [Low-level, deep-dive reference material](https://jacobian.org/writing/what-to-write/#reference)
4446

4547
**While writing**
4648

47-
* [Write like you talk](http://paulgraham.com/talk.html).
48-
* [Only use terms from the glossary](https://docs.google.com/document/d/1xbHkio-hdps-5zZG-SmmAKbR9WpXtrJJ-fprShN7NkM/edit).
49+
- [Write like you talk](http://paulgraham.com/talk.html).
50+
- [Only use terms from the glossary](https://docs.google.com/document/d/1xbHkio-hdps-5zZG-SmmAKbR9WpXtrJJ-fprShN7NkM/edit).
4951

5052
**After writing**
5153

52-
* [ ] 👍 Reviewer
53-
* [ ] 🍻 Celeberate
54+
- [ ] 👍 Review
55+
- [ ] 🍻 Celeberate

docs/bin/lint-md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash -eu
2+
3+
# Lints Markdown files using Mobify's `.remarkrc` configuration.
4+
BIN="${BASH_SOURCE[0]}"
5+
6+
# We jump through some hoops here because we symlink the node module's
7+
# bin into the docs/bin/ directory and we want to support invoking
8+
# via the symlink and directly via `/docs/bin/lint-md`
9+
while [ -h "$BIN" ]; do
10+
# Dereference the symlink
11+
BIN="$(cd "$(dirname "$BIN")" && pwd)/$(readlink "$BIN")"
12+
done
13+
14+
DOCS_DIR="$(cd "$(dirname "$BIN")/.." && pwd)"
15+
REMARK_RC="$DOCS_DIR/remarkrc"
16+
17+
# This is tricky. `remark` is a dep of mobify-code-style
18+
# and so won't show up in `node_modules/.bin` of a project
19+
# that uses mobify-code-style. We have to move into the
20+
# the mobify-code-style /docs directory and find the npm
21+
# bin directory relative that _that_ to find remark!
22+
REMARK_CLI="$(cd "$DOCS_DIR" && npm bin)/remark"
23+
24+
$REMARK_CLI --rc-path $REMARK_RC "$@"

.remarkrc renamed to docs/remarkrc

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,14 @@
1616
"maximum-heading-length": 60,
1717
"maximum-line-length": 80,
1818
"no-consecutive-blank-lines": true,
19-
"no-duplicate-headings": true,
19+
"no-duplicate-headings-in-section": true,
2020
"no-file-name-articles": true,
21-
"no-file-name-articles": true,
22-
"no-file-name-consecutive-dashes": true,
2321
"no-file-name-consecutive-dashes": true,
2422
"no-file-name-irregular-characters": true,
25-
"no-file-name-irregular-characters": true,
26-
"no-file-name-mixed-case": true,
2723
"no-file-name-mixed-case": true,
2824
"no-file-name-outer-dashes": true,
29-
"no-file-name-outer-dashes": true,
30-
"no-heading-content-indent": true,
3125
"no-heading-content-indent": true,
3226
"no-heading-indent": true,
33-
"no-heading-indent": true,
3427
"no-multiple-toplevel-headings": 0,
3528
"no-table-indentation": true,
3629
"no-tabs": true,
@@ -40,4 +33,4 @@
4033
"unordered-list-marker-style": "-"
4134
}
4235
}
43-
}
36+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
a-bad-filename.md
3+
1:1 warning Do not start file names with `a` no-file-name-articles remark-lint
4+
5+
⚠ 1 warning

docs/test/a-bad-filename.md

Whitespace-only changes.

docs/test/bad.expected.md

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Used to test violations of style.
1414

1515
BAD: Really, really long lines of text that should probably be wrapped to a more sane length that this.
1616

17-
BAD: List immedidately following text.
17+
BAD: List immediately following text.
1818

1919
- list
2020

@@ -44,21 +44,20 @@ BAD: Indented code-block.
4444
# Indented code block
4545

4646
BAD: Missing newline at end of file.
47-
docs/test/bad.md
48-
1:1 warning Missing newline character at end of file final-newline remark-lint
49-
7:1-7:43 warning Heading levels should increment by one level at a time heading-increment remark-lint
50-
9:1-9:33 warning Don’t use multiple top level headings (9:1) no-multiple-toplevel-headings remark-lint
51-
13:1-13:27 warning Do not use headings with similar content (11:1) no-duplicate-headings remark-lint
52-
15:104 warning Line must be at most 80 characters maximum-line-length remark-lint
53-
18:5 warning Incorrect list-item indent: remove 2 spaces list-item-indent remark-lint
54-
26:4 warning Incorrect list-item indent: remove 1 space list-item-indent remark-lint
55-
30:1-30:8 warning Marker style should be `-` unordered-list-marker-style remark-lint
56-
30:4 warning Incorrect list-item indent: remove 1 space list-item-indent remark-lint
57-
34:5 warning Incorrect list-item indent: remove 1 space list-item-indent remark-lint
58-
35:1-35:9 warning Marker should be `2`, was `1` ordered-list-marker-value remark-lint
59-
35:5 warning Incorrect list-item indent: remove 1 space list-item-indent remark-lint
60-
38:1 warning Remove 1 line before node no-consecutive-blank-lines remark-lint
61-
40:1-42:4 warning Missing code-language flag fenced-code-flag remark-lint
62-
46:1-46:26 warning Code blocks should be fenced code-block-style remark-lint
63-
64-
⚠ 15 warnings
47+
bad.md
48+
7:1-7:43 warning Heading levels should increment by one level at a time heading-increment remark-lint
49+
9:1-9:33 warning Don’t use multiple top level headings (9:1) no-multiple-toplevel-headings remark-lint
50+
13:1-13:27 warning Do not use headings with similar content per section (11:1) no-duplicate-headings-in-section remark-lint
51+
15:104 warning Line must be at most 80 characters maximum-line-length remark-lint
52+
18:5 warning Incorrect list-item indent: remove 2 spaces list-item-indent remark-lint
53+
26:4 warning Incorrect list-item indent: remove 1 space list-item-indent remark-lint
54+
30:1-30:8 warning Marker style should be `-` unordered-list-marker-style remark-lint
55+
30:4 warning Incorrect list-item indent: remove 1 space list-item-indent remark-lint
56+
34:5 warning Incorrect list-item indent: remove 1 space list-item-indent remark-lint
57+
35:1-35:9 warning Marker should be `2`, was `1` ordered-list-marker-value remark-lint
58+
35:5 warning Incorrect list-item indent: remove 1 space list-item-indent remark-lint
59+
38:1 warning Remove 1 line before node no-consecutive-blank-lines remark-lint
60+
40:1-42:4 warning Missing code-language flag fenced-code-flag remark-lint
61+
46:1-46:26 warning Code blocks should be fenced code-block-style remark-lint
62+
63+
⚠ 14 warnings

0 commit comments

Comments
 (0)