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

Commit 8d86268

Browse files
author
Mike Nikles
authored
Merge pull request #121 from mobify/release-v2.5.2
Release v2.5.2
2 parents 10d378e + fe4767e commit 8d86268

File tree

12 files changed

+762
-45
lines changed

12 files changed

+762
-45
lines changed

CHANGELOG

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
2.5.2
2+
- Fix #43 by updating all underlines in Sass code examples
3+
- Fix #114 by removing invalid options from CSSComb config file
4+
- Add a React rule to make sure propTypes are ordered, required ones declared first and callbacks (e.g. onChange) declared last.
5+
- Update ES6 indent rule on switch statements
6+
- Add ignore patterns for unused vars/args to the React configuration
7+
- Ignore non-JS files and node_modules in the ES6 import module
8+
- Add a new ES5 configuration ported to ESLint 2 and up
19
2.5.1
210
- Update line length to 200
311
- Remove rule for no-unresolved import

README.md

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,29 @@ A repo to document code standards for different languages and provide tools for
44

55
[![NPM version](https://badge.fury.io/js/mobify-code-style.svg)](http://badge.fury.io/js/mobify-code-style)
66

7-
## JavaScript (ES5)
7+
## JavaScript (ES5) with Grunt
88

9-
Typically, we lint our javascript files using [Grunt](http://gruntjs.com/) and [grunt-eslint](https://github.com/sindresorhus/grunt-eslint). grunt-eslint is a Grunt helper for the [ESLint](http://eslint.org/) linter.
9+
Typically, we lint our javascript files using
10+
[Grunt](http://gruntjs.com/) and
11+
[grunt-eslint](https://github.com/sindresorhus/grunt-eslint). grunt-eslint
12+
is a Grunt helper for the [ESLint](http://eslint.org/) linter.
1013

1114
To add javascript linting to your project:
1215

1316
1. Install the NPM `mobify-code-style` and `grunt-eslint` modules.
14-
2. Create a [Gruntfile](http://gruntjs.com/sample-gruntfile) if you don't have one already.
15-
3. In the initConfig of your gruntfile, add a section for eslint pointing to the correct linting file.
17+
2. Create a [Gruntfile](http://gruntjs.com/sample-gruntfile) if you
18+
don't have one already.
19+
3. Create an `.eslintrc.yml` file in the root of your project directory
20+
4. In the initConfig of your gruntfile, add a section for eslint pointing to the correct linting file.
21+
22+
The `.eslintrc.yml` file should contain, to begin with:
23+
```yaml
24+
extends:
25+
- './node_modules/mobify-code-style/es5/mobify-es5.yml'
26+
```
1627
17-
Sample eslint config:
28+
29+
Sample eslint Grunt config:
1830
1931
```javascript
2032
eslint:{
@@ -24,20 +36,36 @@ eslint:{
2436
// When true, eslint will test _only_ the rules set in the provided
2537
// configuration file
2638
reset: false,
27-
config: 'node_modules/mobify-code-style/javascript/.eslintrc'
39+
configFile: './.eslintrc.yml'
2840
}
2941
}
3042
}
3143
```
3244

45+
### Migrating from ESLint 0.x or 1.x to ESlint 2.x or 3.x
46+
47+
If you upgrade the version of `grunt-eslint` you use from one that
48+
pulls in ESLint 1.x or lower to one that pulls
49+
in ESLint 2.x or greater, you must modify the configuration files to
50+
include the new style of configuration.
51+
52+
If the Grunt config includes the default config
53+
`./node_modules/mobify-code-style/javascript/.eslintrc`, replace that
54+
with `./.eslintrc.yml`, and add an `.eslintrc.yml` to the project root
55+
as described above.
56+
57+
If there are modifications to the lint configuration in the project,
58+
please check the migration guides at [http://eslint.org/] to port the
59+
modified lint config to ESLint 3.x.
60+
3361
## ES6/JSX
3462

3563
We use [ESLint](http://eslint.org/) to lint ES6 and React/JSX code. If ESLint is installed in a project, we can use the configuration from this module by creating a file in the project root named `.eslintrc.yml`. If the project does not use JSX, the file contents should be
3664

3765
```yaml
3866
extends:
3967
- './node_modules/mobify-code-style/es6/mobify-es6.yml'
40-
```
68+
```
4169
4270
and for a React/JSX project:
4371
@@ -46,6 +74,15 @@ extends:
4674
- './node_modules/mobify-code-style/es6/mobify-es6-react.yml'
4775
```
4876
77+
If using a custom Webpack configuration, add the lines:
78+
```yaml
79+
settings:
80+
import/resolver:
81+
webpack:
82+
config: '<path-to-webpack-config>'
83+
```
84+
to the `.eslintrc.yml`
85+
4986
Make sure to install the following NPM modules:
5087
- `eslint` > 3.0
5188
- `eslint-plugin-import`

RELEASE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## Mobify Code Style
2+
- [ ] Branch off of `develop` and create a `release-vX.Y.Z` branch.
3+
- [ ] Create a new pull request with the following settings:
4+
* Base: `master`
5+
* Compare: `release-vX.Y.Z`
6+
Paste the contents of this checklist into this pull request.
7+
- [ ] Increment the version in `package.json`.
8+
- [ ] In the CHANGELOG.md file of this release branch, change the 'To be released' header to 'vX.Y.Z'.
9+
- [ ] Merge `release-vX.Y.Z` into `master` using the pull request, then delete the release branch.
10+
- [ ] [Publish to npm](https://docs.npmjs.com/cli/publish) from the `master` branch.
11+
- [ ] Draft a new Github release with the following settings:
12+
* Tag version: `X.Y.Z` @ `master`
13+
* Release title: `X.Y.Z`
14+
* Description: Use highlights from the CHANGELOG.md (only pick out the most significant changes)
15+
- [ ] Merge `master` into `develop` (no need for review on PR, just merge).

css/.csscomb.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@
1313
"combinator-space": [" ", " "],
1414
"element-case": "lower",
1515
"eof-newline": true,
16-
"leading-zero": null,
1716
"rule-indent": " ",
1817
"stick-brace": " ",
1918
"unitless-zero": true,
20-
"quotes": false,
2119
"remove-empty-rulesets": true,
2220
"space-before-closing-brace": "\n",
2321
"space-before-colon": "",
@@ -29,7 +27,7 @@
2927
"space-after-selector-delimiter": "\n",
3028
"space-before-selector-delimiter": "",
3129
"strip-spaces": true,
32-
"tab-size": true,
30+
"tab-size": 4,
3331
"unitless-zero": true,
3432
"sort-order": [
3533
[

css/comments/Readme.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ Headings in CSS comments should follow the following format:
1515

1616
```
1717
// Heading Level 1
18-
// ===============
18+
// ===
1919
//
2020
// Heading Level 2
21-
// ---------------
21+
// ---
2222
//
2323
// ### Heading Level 3 and beyond
2424
```
@@ -36,16 +36,16 @@ For example...
3636

3737
```
3838
// Documentation Headings Example
39-
// ==============================
39+
// ===
4040
//
4141
// The First Example
42-
// -----------------
42+
// ---
4343
//
4444
// Notice how there is only a single line between the level 1 and 2 headings above.
4545
4646
4747
// The Second Example
48-
// ------------------
48+
// ---
4949
//
5050
// All headings that don't immediately follow another heading will have two spaces
5151
// above, like the heading directly above.
@@ -100,7 +100,7 @@ Bad example:
100100

101101
```
102102
// Buttons
103-
// =======
103+
// ===
104104
105105
.button {
106106
display: block; // This must be a block because reasons. Reasons like because
@@ -114,7 +114,7 @@ Better example:
114114

115115
```
116116
// Buttons
117-
// =======
117+
// ===
118118
//
119119
// Notes:
120120
//
@@ -132,7 +132,7 @@ Notice how we can apply the same line comment to multiple lines:
132132

133133
```
134134
// Modal
135-
// =====
135+
// ===
136136
//
137137
// Notes:
138138
//
@@ -157,7 +157,7 @@ Example:
157157

158158
```
159159
// Checkout
160-
// ========
160+
// ===
161161
//
162162
// @url http://www.website.com/checkout
163163
```
@@ -169,26 +169,26 @@ Example:
169169

170170
```
171171
// Checkout
172-
// ========
172+
// ===
173173
//
174174
// @url http://www.website.com/checkout
175175
176176
.t-checkout {
177177
178178
// Global
179-
// ------
179+
// ---
180180
//
181181
// ...
182182
183183
184184
// Your Details
185-
// ------------
185+
// ---
186186
//
187187
// ...
188188
189189
190190
// Credit Card Info
191-
// ----------------
191+
// ---
192192
//
193193
// ...
194194
}
@@ -198,13 +198,13 @@ Alternatively:
198198

199199
```
200200
// Checkout
201-
// ========
201+
// ===
202202
//
203203
// @url http://www.website.com/checkout
204204
205205
206206
// Global
207-
// ------
207+
// ---
208208
//
209209
// ...
210210
@@ -213,7 +213,7 @@ Alternatively:
213213
214214
215215
// Your Details
216-
// ------------
216+
// ---
217217
//
218218
// ...
219219
@@ -222,7 +222,7 @@ Alternatively:
222222
223223
224224
// Credit Card Info
225-
// ----------------
225+
// ---
226226
//
227227
// ...
228228
@@ -235,7 +235,7 @@ the base template scope and with a level 2 heading. Example:
235235

236236
```
237237
// Checkout
238-
// ========
238+
// ===
239239
//
240240
// @url http://www.website.com/checkout
241241
@@ -244,14 +244,14 @@ the base template scope and with a level 2 heading. Example:
244244
245245
246246
// Checkout: Form
247-
// --------------
247+
// ---
248248
249249
.t-checkout__form {
250250
}
251251
252252
253253
// Checkout: Sidebar
254-
// -----------------
254+
// ---
255255
256256
.t-checkout__sidebar {
257257
}
@@ -278,7 +278,7 @@ SCSS file.
278278

279279
```
280280
// Breadcrumbs
281-
// ===========
281+
// ===
282282
283283
.c-breadcrumbs {
284284
}
@@ -293,7 +293,7 @@ use a level 2 heading for each sub-component.
293293

294294
```
295295
// Breadcrumbs: Link
296-
// -----------------
296+
// ---
297297
298298
.c-breadcrumbs__link {
299299
}
@@ -308,7 +308,7 @@ Notice the lack of any "Link Arrow" heading in the following example:
308308

309309
```
310310
// Breadcrumbs: Link
311-
// -----------------
311+
// ---
312312
313313
.c-breadcrumbs__link {
314314
}
@@ -331,7 +331,7 @@ Method 1: Nested
331331

332332
```
333333
// Breadcrumbs: Link
334-
// -----------------
334+
// ---
335335
336336
.c-breadcrumbs__link {
337337
@@ -344,7 +344,7 @@ Method 2: Unnested
344344

345345
```
346346
// Breadcrumbs: Link
347-
// -----------------
347+
// ---
348348
349349
.c-breadcrumbs__link {
350350
}
@@ -360,14 +360,14 @@ breadcrumb link styles. That could be enough to warrant a heading:
360360

361361
```
362362
// Breadcrumbs: Link
363-
// -----------------
363+
// ---
364364
365365
.c-breadcrumbs__link {
366366
}
367367
368368
369369
// Breadcrumbs: Current Link
370-
// -------------------------
370+
// ---
371371
372372
.c-breadcrumbs__link.c--current {
373373
}
@@ -406,7 +406,7 @@ An example of both the doc block and dependencies can be seen here:
406406

407407
```
408408
// My Function
409-
// ===========
409+
// ===
410410
//
411411
// Standard definition section goes here.
412412
//

0 commit comments

Comments
 (0)