Skip to content

Commit 89e2f73

Browse files
Rewrote package after airbnb/javascript example
1 parent d1723d3 commit 89e2f73

File tree

11 files changed

+288
-94
lines changed

11 files changed

+288
-94
lines changed

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
end_of_line = lf
10+
# editorconfig-tools is unable to ignore longs strings or urls
11+
max_line_length = null

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# gitignore
2+
3+
node_modules
4+
5+
# Only apps should have lockfiles
6+
yarn.lock
7+
package-lock.json

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

.scss-lint.yml

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

.travis.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
language: node_js
2+
node_js:
3+
- "9"
4+
- "8"
5+
- "7"
6+
- "6"
7+
- "5"
8+
- "4"
9+
before_install:
10+
- 'nvm install-latest-npm'
11+
install:
12+
- 'if [ -n "${PACKAGE-}" ]; then cd "packages/${PACKAGE}"; fi'
13+
- 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.9" ]; then nvm install --latest-npm 0.8 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;'
14+
script:
15+
- 'if [ -n "${LINT-}" ]; then npm run lint; else npm run travis; fi'
16+
sudo: false
17+
env:
18+
matrix:
19+
- 'TEST=true PACKAGE=stylelint-config-airbnb'
20+
matrix:
21+
fast_finish: true
22+
include:
23+
- node_js: "lts/*"
24+
env: PACKAGE=stylelint-config-airbnb
25+
- node_js: "lts/*"
26+
env: LINT=true
27+
allow_failures:
28+
- node_js: "9"
29+
- node_js: "7"
30+
- node_js: "5"
31+
- env: PACKAGE=stylelint-config-airbnb

README.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ Finally, properties are what give the selected elements of a rule declaration th
6868

6969
### Formatting
7070

71-
* Use soft tabs (2 spaces) for indentation
72-
* Prefer dashes over camelCasing in class names.
71+
- Use soft tabs (2 spaces) for indentation
72+
- Prefer dashes over camelCasing in class names.
7373
- Underscores and PascalCasing are okay if you are using BEM (see [OOCSS and BEM](#oocss-and-bem) below).
74-
* Do not use ID selectors
75-
* When using multiple selectors in a rule declaration, give each selector its own line.
76-
* Put a space before the opening brace `{` in rule declarations
77-
* In properties, put a space after, but not before, the `:` character.
78-
* Put closing braces `}` of rule declarations on a new line
79-
* Put blank lines between rule declarations
74+
- Do not use ID selectors
75+
- When using multiple selectors in a rule declaration, give each selector its own line.
76+
- Put a space before the opening brace `{` in rule declarations
77+
- In properties, put a space after, but not before, the `:` character.
78+
- Put closing braces `}` of rule declarations on a new line
79+
- Put blank lines between rule declarations
8080

8181
**Bad**
8282

@@ -109,30 +109,30 @@ Finally, properties are what give the selected elements of a rule declaration th
109109

110110
### Comments
111111

112-
* Prefer line comments (`//` in Sass-land) to block comments.
113-
* Prefer comments on their own line. Avoid end-of-line comments.
114-
* Write detailed comments for code that isn't self-documenting:
112+
- Prefer line comments (`//` in Sass-land) to block comments.
113+
- Prefer comments on their own line. Avoid end-of-line comments.
114+
- Write detailed comments for code that isn't self-documenting:
115115
- Uses of z-index
116116
- Compatibility or browser-specific hacks
117117

118118
### OOCSS and BEM
119119

120120
We encourage some combination of OOCSS and BEM for these reasons:
121121

122-
* It helps create clear, strict relationships between CSS and HTML
123-
* It helps us create reusable, composable components
124-
* It allows for less nesting and lower specificity
125-
* It helps in building scalable stylesheets
122+
- It helps create clear, strict relationships between CSS and HTML
123+
- It helps us create reusable, composable components
124+
- It allows for less nesting and lower specificity
125+
- It helps in building scalable stylesheets
126126

127127
**OOCSS**, or “Object Oriented CSS”, is an approach for writing CSS that encourages you to think about your stylesheets as a collection of “objects”: reusable, repeatable snippets that can be used independently throughout a website.
128128

129-
* Nicole Sullivan's [OOCSS wiki](https://github.com/stubbornella/oocss/wiki)
130-
* Smashing Magazine's [Introduction to OOCSS](http://www.smashingmagazine.com/2011/12/12/an-introduction-to-object-oriented-css-oocss/)
129+
- Nicole Sullivan's [OOCSS wiki](https://github.com/stubbornella/oocss/wiki)
130+
- Smashing Magazine's [Introduction to OOCSS](http://www.smashingmagazine.com/2011/12/12/an-introduction-to-object-oriented-css-oocss/)
131131

132132
**BEM**, or “Block-Element-Modifier”, is a _naming convention_ for classes in HTML and CSS. It was originally developed by Yandex with large codebases and scalability in mind, and can serve as a solid set of guidelines for implementing OOCSS.
133133

134-
* CSS Trick's [BEM 101](https://css-tricks.com/bem-101/)
135-
* Harry Roberts' [introduction to BEM](http://csswizardry.com/2013/01/mindbemding-getting-your-head-round-bem-syntax/)
134+
- CSS Trick's [BEM 101](https://css-tricks.com/bem-101/)
135+
- Harry Roberts' [introduction to BEM](http://csswizardry.com/2013/01/mindbemding-getting-your-head-round-bem-syntax/)
136136

137137
We recommend a variant of BEM with PascalCased “blocks”, which works particularly well when combined with components (e.g. React). Underscores and dashes are still used for modifiers and children.
138138

@@ -163,9 +163,9 @@ function ListingCard() {
163163
.ListingCard__content { }
164164
```
165165

166-
* `.ListingCard` is the “block” and represents the higher-level component
167-
* `.ListingCard__title` is an “element” and represents a descendant of `.ListingCard` that helps compose the block as a whole.
168-
* `.ListingCard--featured` is a “modifier” and represents a different state or variation on the `.ListingCard` block.
166+
- `.ListingCard` is the “block” and represents the higher-level component
167+
- `.ListingCard__title` is an “element” and represents a descendant of `.ListingCard` that helps compose the block as a whole.
168+
- `.ListingCard--featured` is a “modifier” and represents a different state or variation on the `.ListingCard` block.
169169

170170
### ID selectors
171171

@@ -202,14 +202,15 @@ Use `0` instead of `none` to specify that a style has no border.
202202
border: 0;
203203
}
204204
```
205+
205206
**[⬆ back to top](#table-of-contents)**
206207

207208
## Sass
208209

209210
### Syntax
210211

211-
* Use the `.scss` syntax, never the original `.sass` syntax
212-
* Order your regular CSS and `@include` declarations logically (see below)
212+
- Use the `.scss` syntax, never the original `.sass` syntax
213+
- Order your regular CSS and `@include` declarations logically (see below)
213214

214215
### Ordering of property declarations
215216

@@ -225,7 +226,7 @@ Use `0` instead of `none` to specify that a style has no border.
225226
}
226227
```
227228

228-
2. `@include` declarations
229+
1. `@include` declarations
229230

230231
Grouping `@include`s at the end makes it easier to read the entire selector.
231232

@@ -238,7 +239,7 @@ Use `0` instead of `none` to specify that a style has no border.
238239
}
239240
```
240241

241-
3. Nested selectors
242+
1. Nested selectors
242243

243244
Nested selectors, _if necessary_, go last, and nothing goes after them. Add whitespace between your rule declarations and nested selectors, as well as between adjacent nested selectors. Apply the same guidelines as above to your nested selectors.
244245

@@ -282,10 +283,9 @@ Mixins should be used to DRY up your code, add clarity, or abstract complexity--
282283

283284
When selectors become this long, you're likely writing CSS that is:
284285
285-
* Strongly coupled to the HTML (fragile) *—OR—*
286-
* Overly specific (powerful) *—OR—*
287-
* Not reusable
288-
286+
- Strongly coupled to the HTML (fragile) *—OR—*
287+
- Overly specific (powerful) *—OR—*
288+
- Not reusable
289289
290290
Again: **never nest ID selectors!**
291291
@@ -301,7 +301,7 @@ If you must use an ID selector in the first place (and you should really try not
301301
- ![cn](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/China.png) **Chinese (Simplified)**: [Zhangjd/css-style-guide](https://github.com/Zhangjd/css-style-guide)
302302
- ![ja](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/Japan.png) **Japanese**: [nao215/css-style-guide](https://github.com/nao215/css-style-guide)
303303
- ![ko](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/South-Korea.png) **Korean**: [CodeMakeBros/css-style-guide](https://github.com/CodeMakeBros/css-style-guide)
304-
- ![PT-BR](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/Brazil.png) **Portuguese**: [felipevolpatto/css-style-guide](https://github.com/felipevolpatto/css-style-guide)
304+
- ![PT-BR](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/Brazil.png) **Portuguese**: [felipevolpatto/css-style-guide](https://github.com/felipevolpatto/css-style-guide)
305305
- ![ru](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/Russia.png) **Russian**: [Nekorsis/css-style-guide](https://github.com/Nekorsis/css-style-guide)
306306
- ![es](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/Spain.png) **Spanish**: [ismamz/guia-de-estilo-css](https://github.com/ismamz/guia-de-estilo-css)
307307
- ![vn](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/Vietnam.png) **Vietnamese**: [trungk18/css-style-guide](https://github.com/trungk18/css-style-guide)

linters/.markdownlint.json

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
{
2+
"comment": "Be explicit by listing every available rule. https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md",
3+
"comment": "Note that there will be numeric gaps, not every MD number is implemented in markdownlint.",
4+
5+
"comment": "MD001: Header levels should only increment by one level at a time",
6+
"header-increment": true,
7+
8+
"comment": "MD002: First header should be a top level header",
9+
"first-header-h1": true,
10+
11+
"comment": "MD003: Header style: start with hashes",
12+
"header-style": {
13+
"style": "atx"
14+
},
15+
16+
"comment": "MD004: Unordered list style",
17+
"ul-style": {
18+
"style": "dash"
19+
},
20+
21+
"comment": "MD005: Consistent indentation for list items at the same level",
22+
"list-indent": true,
23+
24+
"comment": "MD006: Consider starting bulleted lists at the beginning of the line",
25+
"ul-start-left": false,
26+
27+
"comment": "MD007: Unordered list indentation: 2 spaces",
28+
"ul-indent": {
29+
"indent": 2
30+
},
31+
32+
"comment": "MD009: Disallow trailing spaces",
33+
"no-trailing-spaces": {
34+
"br-spaces": 0,
35+
"comment": "Empty lines inside list items should not be indented",
36+
"list_item_empty_lines": false
37+
},
38+
39+
"comment": "MD010: No hard tabs, not even in code blocks",
40+
"no-hard-tabs": {
41+
"code_blocks": true
42+
},
43+
44+
"comment": "MD011: Prevent reversed link syntax",
45+
"no-reversed-links": true,
46+
47+
"comment": "MD012: Disallow multiple consecutive blank lines",
48+
"no-multiple-blanks": {
49+
"maximum": 1
50+
},
51+
52+
"comment": "MD013: Line length",
53+
"line-length": false,
54+
55+
"comment": "MD014: Disallow dollar signs used before commands without showing output",
56+
"commands-show-output": true,
57+
58+
"comment": "MD018: Disallow space after hash on atx style header",
59+
"no-missing-space-atx": true,
60+
61+
"comment": "MD019: Dissalow multiple spaces after hash on atx style header",
62+
"no-multiple-space-atx": true,
63+
64+
"comment": "MD020: No space inside hashes on closed atx style header",
65+
"no-missing-space-closed-atx": true,
66+
67+
"comment": "MD021: Disallow multiple spaces inside hashes on closed atx style header",
68+
"no-multiple-space-closed-atx": true,
69+
70+
"comment": "MD022: Headers should be surrounded by blank lines",
71+
"comment": "Some headers have preceeding HTML anchors. Unfortunate that we have to disable this, as it otherwise catches a real problem that trips up some Markdown renderers",
72+
"blanks-around-headers": false,
73+
74+
"comment": "MD023: Headers must start at the beginning of the line",
75+
"header-start-left": true,
76+
77+
"comment": "MD024: Disallow multiple headers with the same content",
78+
"no-duplicate-header": true,
79+
80+
"comment": "MD025: Disallow multiple top level headers in the same document",
81+
"comment": "Gotta have a matching closing brace at the end",
82+
"single-h1": false,
83+
84+
"comment": "MD026: Disallow trailing punctuation in header",
85+
"comment": "Gotta have a semicolon after the ending closing brace",
86+
"no-trailing-punctuation": {
87+
"punctuation" : ".,:!?"
88+
},
89+
"comment": "MD027: Dissalow multiple spaces after blockquote symbol",
90+
"no-multiple-space-blockquote": true,
91+
92+
"comment": "MD028: Blank line inside blockquote",
93+
"comment": "Some 'Why?' and 'Why not?' blocks are separated by a blank line",
94+
"no-blanks-blockquote": false,
95+
96+
"comment": "MD029: Ordered list item prefix",
97+
"ol-prefix": {
98+
"style": "one"
99+
},
100+
101+
"comment": "MD030: Spaces after list markers",
102+
"list-marker-space": {
103+
"ul_single": 1,
104+
"ol_single": 1,
105+
"ul_multi": 1,
106+
"ol_multi": 1
107+
},
108+
109+
"comment": "MD031: Fenced code blocks should be surrounded by blank lines",
110+
"blanks-around-fences": true,
111+
112+
"comment": "MD032: Lists should be surrounded by blank lines",
113+
"comment": "Some lists have preceeding HTML anchors. Unfortunate that we have to disable this, as it otherwise catches a real problem that trips up some Markdown renderers",
114+
"blanks-around-lists": false,
115+
116+
"comment": "MD033: Disallow inline HTML",
117+
"comment": "HTML is needed for explicit anchors",
118+
"no-inline-html": false,
119+
120+
"comment": "MD034: No bare URLs used",
121+
"no-bare-urls": true,
122+
123+
"comment": "MD035: Horizontal rule style",
124+
"hr-style": {
125+
"style": "consistent"
126+
},
127+
128+
"comment": "MD036: Do not use emphasis instead of a header",
129+
"no-emphasis-as-header": false,
130+
131+
"comment": "MD037: Disallow spaces inside emphasis markers",
132+
"no-space-in-emphasis": true,
133+
134+
"comment": "MD038: Disallow spaces inside code span elements",
135+
"no-space-in-code": true,
136+
137+
"comment": "MD039: Disallow spaces inside link text",
138+
"no-space-in-links": true,
139+
140+
"comment": "MD040: Fenced code blocks should have a language specified",
141+
"fenced-code-language": true,
142+
143+
"comment": "MD041: First line in file should be a top level header",
144+
"first-line-h1": true,
145+
146+
"comment": "MD042: No empty links",
147+
"no-empty-links": true,
148+
149+
"comment": "MD043: Required header structure",
150+
"required-headers": false,
151+
152+
"comment": "MD044: Proper names should have the correct capitalization",
153+
"proper-names": false
154+
}

0 commit comments

Comments
 (0)