Skip to content

Commit

Permalink
ready for 1.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmondok committed Apr 10, 2020
1 parent f039a85 commit 324e057
Show file tree
Hide file tree
Showing 10 changed files with 660 additions and 1 deletion.
34 changes: 34 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab

[*.php]
indent_size = 4

[{*.js,*.ts}]
indent_style = space
indent_size = 2
quote_type = single

[*.css]
indent_style = space
indent_size = 2

[*.scss]
indent_style = space
indent_size = 2

[{*.json,*.yml}]
indent_style = space
indent_size = 2

[*.py]
indent_size = 4

[*.md]
trim_trailing_whitespace = false
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
### Mac OSX + Windows ###
.DS_Store
Thumbs.db

### Node ###
.node/
node_modules/
npm-debug.log

### Idea ###
.idea/

### Vim ###
*.sw[op]
*.un~

package-lock.json
14 changes: 14 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.DS_Store
Thumbs.db
.git/
.node/
.npmrc
node_modules/
npm-debug.log
package-lock.json
yarn.lock
*.sw[op]
*.un~
test/
.circleci/
scripts/
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 1.0.0

- Initial release
108 changes: 107 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,108 @@
# stylelint-config-woda
Woda's stylelint config

> The standard shareable config for stylelint used by Woda.
Extends [`stylelint-config-standard`](https://github.com/stylelint/stylelint-config-standard) which in turn is an extension of [`stylelint-config-recommended`](https://github.com/stylelint/stylelint-config-recommended).

`stylelint-config-standard` turns on additional rules to enforce the common stylistic conventions found within a handful of CSS styleguides, including:
* [The Idiomatic CSS Principles](https://github.com/necolas/idiomatic-css),
* [Google's CSS Style Guide](https://google.github.io/styleguide/htmlcssguide.html#CSS_Formatting_Rules)
* [Airbnb's Styleguide](https://github.com/airbnb/css#css)
* [@mdo's Code Guide](http://codeguide.co/#css).

Additionally we set some custom rules that you can check out in the [main config file](./stylint-config-woda.js).

## Order

This config adds additional order rules utilizing the stylelint plugin [`stylelint-order`](https://github.com/hudochenkov/stylelint-order).

To see the order specific rules, please check out out the [order config](./order.js).

To see the property order specific rules, please check out the [property order config](./property-order.js).

The config sorts related property declarations by grouping together following the order:

1. Grid Layout
2. Flexbox
3. Positioning
4. Textual Content
5. Box Model
6. Background
7. Special Content Types
8. Animations

## SCSS

This config also adds additional SCSS rules utilizing the stylelint plugin [`stylelint-sass`](https://github.com/kristerkari/stylelint-scss).

The SASS rules are losely based on [sass-guidelin.es](https://sass-guidelin.es/) and [stylelint-config-sass-guidelines](https://github.com/bjankord/stylelint-config-sass-guidelines)

To see the SASS specific rules that this config uses, please check out the [scss config](./sass.js).

## Installation

```bash
npm install stylelint-config-woda --save-dev
```

## Usage

If you've installed `stylelint-config-woda` locally within your project, just set your `stylelint` config to:

```json
{
"extends": "stylelint-config-woda"
}
```

If you've globally installed `stylelint-config-woda` using the `-g` flag, then you'll need to use the absolute path to `stylelint-config-woda` in your config e.g.

```json
{
"extends": "/absolute/path/to/stylelint-config-woda"
}
```

Since [stylelint 9.7.0](https://github.com/stylelint/stylelint/blob/9.7.0/CHANGELOG.md#970), you can simply use the globally installed configuration name instead of the absolute path:

```json
{
"extends": "stylelint-config-woda"
}
```

## Customization

Simply add a `"rules"` key to your config, then add your overrides and additions there.

For example, to change the `at-rule-no-unknown` rule to use its `ignoreAtRules` option, change the `indentation` to tabs, turn off the `number-leading-zero` rule,and add the `unit-whitelist` rule:

```json
{
"extends": "stylelint-config-woda",
"rules": {
"at-rule-no-unknown": [
true,
{
"ignoreAtRules": ["extends", "ignores"]
}
],
"indentation": "tab",
"number-leading-zero": null,
"unit-whitelist": ["em", "rem", "s"]
}
}
```

## Docs

* [stylelint](https://stylelint.io/)
* [stylelint-order](https://github.com/hudochenkov/stylelint-order)
* [`order`](./rules/order/README.md): Specify the order of content within declaration blocks.
* [`properties-order`](./rules/properties-order/README.md): Specify the order of properties within declaration blocks.
* [`properties-alphabetical-order`](./rules/properties-alphabetical-order/README.md): Specify the alphabetical order of properties within declaration blocks.
* [stylelint-scss](https://github.com/kristerkari/stylelint-scss)

## [Changelog](CHANGELOG.md)

## [License](LICENSE)
29 changes: 29 additions & 0 deletions order.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module.exports = [
"custom-properties",
"dollar-variables",
{
"type": "at-rule",
"name": "extend"
},
{
"type": "at-rule",
"name": "include",
"hasBlock": false
},
"declarations",
{
"type": "at-rule",
"name": "include",
"hasBlock": true
},
"rules",
{
"type": "at-rule",
"name": "media"
},
{
"type": "at-rule",
"name": "include",
"parameter": "breakpoint"
}
]
42 changes: 42 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "stylelint-config-woda",
"version": "1.0.0",
"description": "Woda's stylelint config",
"main": "stylelint-config-woda.js",
"repository": {
"type": "git",
"url": "git+https://github.com/wwwoda/stylelint-config-woda.git"
},
"keywords": [
"config",
"css",
"sass",
"scss",
"less",
"styleguide",
"stylelint",
"woda"
],
"authors": [
{
"name": "Woda",
"email": "[email protected]",
"homepage": "https://www.woda.at"
},
{
"name": "David Mondok",
"email": "[email protected]"
}
],
"license": "GPL-3.0+",
"bugs": {
"url": "https://github.com/wwwoda/stylelint-config-woda/issues"
},
"homepage": "https://github.com/wwwoda/stylelint-config-woda#readme",
"dependencies": {
"stylelint": "^13.3.1",
"stylelint-config-standard": "^20.0.0",
"stylelint-order": "^4.0.0",
"stylelint-scss": "^3.16.1"
}
}
Loading

0 comments on commit 324e057

Please sign in to comment.