Skip to content

Commit d1a7ec9

Browse files
maxwondercornJen Weber
authored andcommitted
Advanced linting with spellcheck corrections (ember-learn#327)
* added remark/retext linting * additional corrections * added comments for reviewers * fixed Github -> GitHub * backticks, consistency to 2.16 * add testing to travis.yml * updated readme & contributing * update test * bumped dictionary * fixed errors from conflict cleanup
1 parent b3529f2 commit d1a7ec9

File tree

475 files changed

+4446
-1085
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

475 files changed

+4446
-1085
lines changed

.local.dic

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
30KB
2+
accessor
3+
activations
4+
acyclic
5+
ActiveSupport
6+
asynchronicity
7+
Americentric
8+
assistive
9+
asynchrony
10+
autocomplete
11+
auto-rollup
12+
autoruns
13+
backend
14+
backends
15+
beforeEach
16+
blogPost
17+
bookmarklet
18+
breakpoint
19+
Browserlist
20+
camelize
21+
chainable
22+
Checkboxes
23+
checkboxes
24+
CoffeeScript
25+
componentized
26+
Ctrl-C
27+
customizations
28+
D3
29+
dasherize
30+
datepicker
31+
de
32+
debounce
33+
deps
34+
deserialization
35+
deserializing
36+
draggable
37+
durations
38+
enumerables
39+
ember-cli-deprecation-workflow
40+
ember-cli-cjs-transform
41+
ember-cli-mirage.
42+
ember-cli-tutorial-style
43+
ember-debug-handlers-polyfill
44+
ember-qunit
45+
erroring
46+
Evented
47+
facto
48+
falsy
49+
frontend
50+
fullname
51+
geocode
52+
geocoding
53+
Geolocation
54+
globbing
55+
*google
56+
hardcode
57+
hashchange
58+
Hoc
59+
htmlbars
60+
htmlbars-inline-precompile
61+
interop
62+
interoperable
63+
IndexedDB
64+
Inflector
65+
instantiation
66+
jquery-integration
67+
keyCode
68+
linters
69+
lookups
70+
Mapbox
71+
mixin
72+
mixins
73+
modularity
74+
naïve
75+
nav
76+
*NPM
77+
Param
78+
param
79+
params
80+
PascalCased
81+
pipelining
82+
Polymorphism
83+
polymorphism
84+
PR
85+
PRs
86+
preload
87+
prepend
88+
pre-transition
89+
readme
90+
readonly
91+
relayout
92+
repo
93+
rerender
94+
rerendering
95+
routable
96+
runtime
97+
sandboxed
98+
scp
99+
selectable
100+
serializer
101+
serializers
102+
singularize
103+
SSR
104+
stateful
105+
subclassing
106+
subdomain
107+
subexpression
108+
suboptimal
109+
substate
110+
substates
111+
teardown
112+
templating
113+
todo
114+
todos
115+
typeahead
116+
unsilence
117+
untrusted
118+
usecase
119+
viewport

.remarkignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
CONTRIBUTING.*
2+
README.*
3+
MAINTAINERS.md
4+
guides/v1.10.0/**/*.md
5+
guides/v1.11.0/**/*.md
6+
guides/v1.12.0/**/*.md
7+
guides/v1.13.0/**/*.md
8+
guides/v2.0.0/**/*.md
9+
guides/v2.1.0/**/*.md
10+
guides/v2.2.0/**/*.md
11+
guides/v2.3.0/**/*.md
12+
guides/v2.4.0/**/*.md
13+
guides/v2.5.0/**/*.md
14+
guides/v2.6.0/**/*.md
15+
guides/v2.7.0/**/*.md
16+
guides/v2.8.0/**/*.md
17+
guides/v2.9.0/**/*.md
18+
guides/v2.10.0/**/*.md
19+
guides/v2.11.0/**/*.md
20+
guides/v2.12.0/**/*.md
21+
guides/v2.13.0/**/*.md
22+
guides/v2.14.0/**/*.md
23+
guides/v2.15.0/**/*.md
24+
guides/v2.16.0/**/*.md
25+
guides/v2.17.0/**/*.md
26+
guides/v2.18.0/**/*.md
27+
guides/v3.0.0/**/*.md
28+
guides/v3.1.0/**/*.md
29+
guides/v3.2.0/**/*.md
30+
guides/v3.3.0/**/*.md

.remarkrc.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// .remarkrc.js
2+
/* eslint-env node */
3+
const unified = require("unified");
4+
const read = require("fs").readFileSync;
5+
const ember = require("ember-dictionary");
6+
7+
exports.plugins = [
8+
[
9+
require("remark-retext"),
10+
unified().use({
11+
plugins: [
12+
[require("retext-contractions"), { straight: true }],
13+
require("retext-english"),
14+
require("retext-indefinite-article"),
15+
require("retext-repeated-words"),
16+
require("retext-syntax-urls"),
17+
[
18+
require("retext-spell"),
19+
{
20+
dictionary: ember,
21+
personal: read("./.local.dic")
22+
}
23+
]
24+
]
25+
})
26+
],
27+
"remark-preset-lint-consistent",
28+
"remark-preset-lint-recommended",
29+
["remark-lint-list-item-indent", "space"]
30+
];

.travis.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,32 @@ language: node_js
22
node_js:
33
- '8'
44

5+
sudo: false
6+
dist: trusty
7+
8+
addons:
9+
chrome: stable
10+
11+
cache:
12+
directories:
13+
- $HOME/.npm
14+
515
env:
616
global:
717
- secure: "uh/i3/82ECzpG2ozoEpRsvdMO9o2WG8KSR4csIIDNB9kIxsvacB1xfrOStj6HM1XCTwZgcGa6zLG0rjvdZqNTFZOGT75u7mVJ7hJsReGi6rCncSNmxdWC6KUZw5LxO4Sm+G10F+ysUcdBhiW8UdeLrNTNw75DOCC3U28HWtO84/DsIzZNRgZjzLzOMGEr3E28VJvEZx6znRJyDujb57y3QCER5AE83dQ+t+Wmn0L+vG78q5waO6qSFK2Aib3bpNw57duRwALwaErRAWfi3pBzFf/WjnRGoAXnXBjKI7GRoNOxSTq0MgzE0SZHfF4jb3uplxtAL9T0I1QSp4wkjBU21OzKcYI8sznQq9sUwPyyB98ASvLYpfZEkxBsC1IAvhHBFXIqP8CcLef8nfNdEuHW11KpDdjc0X+zSzH5bj2Ske0Ip2OHmARsLQawQELneNNelYoUmMMuJTy7HtPcX925S0Z2YWjIWja1xQjfWR8Be1ReUYVEYoYyCkttMe6Qa9hobdf+Yy3dwAwIpZUZX+ZPw68TzkQdjNWSC9Nn8Su1yGnyzgOwd4kBNmiluvjcYhKU82x0I025e3zEsHR3jVbuu/KrnVOtSfqFimPbtL1oUeR5e1Yg6fFF8sbnSXeR3lCXpQFXrv9OowvbWqD4lhCUwE3Jovx5QOVZwubL1EScyo="
818

19+
before_install:
20+
- npm config set spin false
21+
- npm i -g npm@6
22+
23+
script:
24+
- set -o errexit
25+
- npm run lint:md
26+
- npm run test
27+
928
# deploy:
1029
# provider: script
1130
# script: notify-guides-app.sh
1231
# on:
1332
# branch: master
33+

CONTRIBUTING.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,31 @@ When linking to API pages:
124124
(api link)
125125
* include parenthesis when linking to an API method, i.e., <code>&#96;store.push()&#96;</code>
126126

127+
## Spellchecking/linting
128+
129+
The guides are spellchecked and linted for markdown consistency. You can test your contributions by running `npm run lint::md`. Linting and spellchecking must pass or they will fail in Travis-CI.
130+
131+
Markdown issues that will generate errors include:
132+
- Lists and text must be left justified, otherwise the linter will generate indentation errors
133+
- URL references must be followed by empty brackets `[]`. See example below
134+
- Unused URL reference definitions - comment them out if using them later
135+
- Missing URL reference definitions
136+
137+
Most other markdown errors should be self explanatory.
138+
139+
URL reference and definition:
140+
```markdown
141+
This is a link to [something][]
142+
143+
[something]: https:\\www.something.com
144+
```
145+
146+
Spellchecking uses a custom [ember-dictionary][] with words and terms common to the Ember community, such as `SemVer`. Words and terms that are associated with a specific guide can be placed in the `.local.dic` dictionary file.
147+
148+
See the [ember-dictionary][] GitHub repo for specifics on using the local dictionary and adding words to the standard dictionary.
149+
150+
## Writing
151+
127152
Write once, edit twice (at least!) before opening a PR. When you edit your own writing, ask yourself:
128153

129154
* Am I using proper grammar and spelling?
@@ -132,3 +157,5 @@ Write once, edit twice (at least!) before opening a PR. When you edit your own w
132157
* Did I include links where appropriate?
133158

134159
You'll be amazed at how much better your writing gets as you edit and re-edit!
160+
161+
[ember-dictionary]: https://github.com/maxwondercorn/ember-dictionary

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ want a buddy to pair with, you can join the
2727
[dev-ember-learning channel](https://discordapp.com/channels/480462759797063690/480777444203429888)
2828
in the [Ember Community Discord](https://discordapp.com/invite/zT3asNS).
2929

30+
## Linting/spellchecking
31+
32+
The guides are spellchecked and linted for markdown consistency. You can test your contributions by running `npm run lint::md`. Linting and spellchecking must pass or they will fail in Travis-CI. See [CONTRIBUTING.md](CONTRIBUTING.md) for more information on linting and spellchecking.
33+
3034
## Project layout
3135

3236
The Guides content takes the form of Markdown files (just like most READMEs).

guides/v1.10.0/cookbook/client_server_interaction/serving_compiled_templates_using_nodejs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ without hardcoding your paths throughout your config file.
105105

106106

107107
The second two objects are configuration objects for the ```emberTemplates``` and ```watch``` tasks.
108-
details on the options and configuration of these tasks is found in their respective github
108+
details on the options and configuration of these tasks is found in their respective GitHub
109109
repositories. Grunt tasks typically have easily read README.md files that explain the options
110110
and configurations for that package.
111111

@@ -138,4 +138,4 @@ tutorial is based on is found at http://www.github.com/stevekane/precompiled-tem
138138
As a bonus, if you are interested in using ```Emblem.js``` which has a HAML-like syntax to
139139
build your templates, there is a grunt task for precompiling emblem.js templates called
140140
```grunt-emblem```. The steps needed to configure this task are similar to the ones shown
141-
but be sure to refer to the projects github repository for details.
141+
but be sure to refer to the projects GitHub repository for details.

guides/v1.10.0/cookbook/contributing/participating_if_you_dont_know_ember.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ recipe suggestions. You can suggest a recipe by forking this repository and subm
1010
(see _Suggesting a Recipe_). Once we have written recipes, we'll be asking for help to proofread and test
1111
them.
1212

13-
See ["Watch a project"](https://help.github.com/articles/be-social#watch-a-project) on Github for information on watching projects.
13+
See ["Watch a project"](https://help.github.com/articles/be-social#watch-a-project) on GitHub for information on watching projects.

guides/v1.10.0/cookbook/contributing/suggesting_a_recipe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ it blank. These sections will be created in a later phase of the Cookbook projec
1818
The filename of your suggested recipe should be the lowercase, underscored version of your recipe's name. The
1919
filename name for this recipe &nash; "Suggesting a Recipe" &ndash; would be `suggesting_a_recipe.mdown`.
2020

21-
When you are ready to submit your recipe, push your local branch to the remote branch on your Github fork and
21+
When you are ready to submit your recipe, push your local branch to the remote branch on your GitHub fork and
2222
submit a pull request. Before submitting a pull request, make sure someone hasn't already submitted a similar
2323
recipe and that your recipe is a good fit for the Cookbook (see _Deciding If A Recipe Is A Good Fit_).
2424

guides/v1.10.0/cookbook/helpers_and_components/adding_google_analytics_tracking.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ You want to add analytics to your Ember application.
66
Subscribe to the `didTransition` event inside your application router.
77

88
In the following examples we're using Google Analytics but it could be any other analytics product.
9-
Add google analytic's base code to the html file that renders your ember app.
9+
Add Google analytic's base code to the html file that renders your ember app.
1010

1111
```html
1212
<html lang="en">

guides/v1.10.0/getting-started/adding-a-route-and-template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Next, update your `index.html` to wrap the inner contents of `<body>` in a Handl
3737

3838
</script>
3939

40-
<!-- ... Ember.js and other javascript dependencies ... -->
40+
<!-- ... Ember.js and other JavaScript dependencies ... -->
4141
<script src="js/application.js"></script>
4242
<script src="js/router.js"></script>
4343
</body>

guides/v1.10.0/testing/test-runners.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ npm install -g --save-dev testem
6464
That's it. Everything you need is installed and configured. Let's go over the configuration in more detail.
6565

6666
* `framework`
67-
- This represents the testing framework that you are going to be using. Qunit is what we are using in this example. `Testem` takes care of getting the qunit library loaded up so you don't have to worry about it.
67+
- This represents the testing framework that you are going to be using. QUnit is what we are using in this example. `Testem` takes care of getting the QUnit library loaded up so you don't have to worry about it.
6868
* `src_files`
6969
- This represents which of your source files (including both production and test code) that you want `testem` to load when running tests.
7070
* `launch_in_dev`
@@ -111,7 +111,7 @@ To get started using `karma` you will need to install a few node modules. Here i
111111
}
112112
```
113113

114-
The three dependencies are `karma` itself, `karma-qunit` which includes everything that you will need to run qunit tests and `karma-phantomjs-launcher` which is what `karma` will use to fire up an instance of the headless PhantomJS browser to run your tests in. There are a number of different launchers that you can plug into the `karma` test runner including but not limited to Google Chrome, FireFox, Safari, IE, and even [Sauce Labs][sauce_labs]. To see a complete list of all of the available launchers check out [Karma's Github][karma_github].
114+
The three dependencies are `karma` itself, `karma-qunit` which includes everything that you will need to run qunit tests and `karma-phantomjs-launcher` which is what `karma` will use to fire up an instance of the headless PhantomJS browser to run your tests in. There are a number of different launchers that you can plug into the `karma` test runner including but not limited to Google Chrome, FireFox, Safari, IE, and even [Sauce Labs][sauce_labs]. To see a complete list of all of the available launchers check out [Karma's GitHub][karma_github].
115115

116116
Now that you've got a `package.json` containing everything that you will need to get started with `karma` run the following command (in the same directory as your `package.json` file) to download and install everything.
117117

guides/v1.10.0/understanding-ember/dependency-injection-and-service-lookup.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ When an Ember application starts running, it will create and use a single instan
139139

140140
Factory names have two parts segmented by a `:`. The first segment is the framework component type, and the second is the name of the component requested. Hence, an application view would be named `view:application`.
141141

142-
If the container does not already have a requested factory, it uses a resolver to discover that factory. The resolver is responsible for mapping the factory name of `view:application` to the global variable of `App.ApplicationView`. Tools like ember-cli may use alternative rules for resolving factories. After optionally adding dependencies to the requested factory, that factory is cached and returned.
142+
If the container does not already have a requested factory, it uses a resolver to discover that factory. The resolver is responsible for mapping the factory name of `view:application` to the global variable of `App.ApplicationView`. Tools like Ember CLI may use alternative rules for resolving factories. After optionally adding dependencies to the requested factory, that factory is cached and returned.
143143

144144
Ember's container should be viewed as an implementation detail, and is not part of the supported public API.
145145

@@ -161,7 +161,7 @@ App.register('logger:main', {
161161
App.inject('route', 'logger', 'logger:main');
162162
```
163163

164-
But ember-cli applications (and libraries) will need to use a more flexible hook, an initializer:
164+
But Ember CLI applications (and libraries) will need to use a more flexible hook, an initializer:
165165

166166
```javascript
167167
Ember.Application.initializer({
@@ -254,7 +254,7 @@ application.inject('route:index', 'logger', 'logger:main');
254254

255255
Injections can be made onto all of Ember's major framework classes, including views, helpers, components, controllers, routes, and the router.
256256

257-
**Note:** For injections into models (if not using ember-cli), you need to enable the `MODEL_FACTORY_INJECTIONS`
257+
**Note:** For injections into models (if not using Ember CLI), you need to enable the `MODEL_FACTORY_INJECTIONS`
258258
flag before you initialize your application. You can do this like so:
259259

260260
```javascript

guides/v1.11.0/cookbook/contributing/participating_if_you_dont_know_ember.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ recipe suggestions. You can suggest a recipe by forking this repository and subm
1010
(see _Suggesting a Recipe_). Once we have written recipes, we'll be asking for help to proofread and test
1111
them.
1212

13-
See ["Watch a project"](https://help.github.com/articles/be-social#watch-a-project) on Github for information on watching projects.
13+
See ["Watch a project"](https://help.github.com/articles/be-social#watch-a-project) on GitHub for information on watching projects.

guides/v1.11.0/cookbook/contributing/suggesting_a_recipe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ it blank. These sections will be created in a later phase of the Cookbook projec
1818
The filename of your suggested recipe should be the lowercase, underscored version of your recipe's name. The
1919
filename name for this recipe &nash; "Suggesting a Recipe" &ndash; would be `suggesting_a_recipe.mdown`.
2020

21-
When you are ready to submit your recipe, push your local branch to the remote branch on your Github fork and
21+
When you are ready to submit your recipe, push your local branch to the remote branch on your GitHub fork and
2222
submit a pull request. Before submitting a pull request, make sure someone hasn't already submitted a similar
2323
recipe and that your recipe is a good fit for the Cookbook (see _Deciding If A Recipe Is A Good Fit_).
2424

guides/v1.11.0/cookbook/helpers_and_components/adding_google_analytics_tracking.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ You want to add analytics to your Ember application.
66
Subscribe to the `didTransition` event inside your application router.
77

88
In the following examples we're using Google Analytics but it could be any other analytics product.
9-
Add google analytic's base code to the html file that renders your ember app.
9+
Add Google analytic's base code to the html file that renders your ember app.
1010

1111
```html
1212
<html lang="en">

0 commit comments

Comments
 (0)