Skip to content

Commit

Permalink
initialize basic stylelint config (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz authored Apr 17, 2018
1 parent 1e26360 commit cb4bbe5
Show file tree
Hide file tree
Showing 12 changed files with 255 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2

jobs:
build:
docker:
- image: circleci/node:9-browsers

steps:
- checkout
- run: npm install
- run: npm run test
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# editorconfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text eol=lf
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# NPM
node_modules
package-lock.json
npm-debug.log

# OS generated files
._*
.DS_Store
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# IDEs
.idea
*.iml
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,31 @@
# stylelint-config-ma
Stylelint config for MASSIVE ART

![CircleCi](https://circleci.com/gh/massiveart/stylelint-config-ma/tree/master.png)

Stylelint shareable config used by MASSIVE ART.

## Installation

To make use of this config, install this package as development dependency of your project:

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

## Usage

Create a [`.stylelintrc`](http://stylelint.io/user-guide/configuration/) config file:

### .stylelintrc

```js
{
"extends": "stylelint-config-ma"
}
```

## [Update & Publish to NPM](https://docs.npmjs.com/cli/version)
```npm version [ major | minor | patch ]```

```npm publish```

118 changes: 118 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
"use strict"

module.exports = {
"extends": "stylelint-config-standard",
"plugins": [
"stylelint-scss"
],
"ignoreFiles": [
"sass/vendor/*.scss"
],
"rules": {
"at-rule-empty-line-before": [
"always",
{
"except": [
"blockless-after-same-name-blockless",
"first-nested"
],
"ignore": [
"after-comment"
],
"ignoreAtRules": [
"extend",
"include"
]
}
],
"at-rule-no-unknown": [
true,
{
"ignoreAtRules": [
"content",
"extend",
"include",
"mixin"
]
}
],
"function-comma-newline-before": "never-multi-line",
"function-name-case": [
"lower",
{
"ignoreFunctions": [
"/^[a-z][a-z-A-Z0-9]*$/"
]
}
],
"string-quotes": "single",
"value-keyword-case": "lower",
"declaration-empty-line-before": "never",
"selector-attribute-quotes": "always",
"selector-class-pattern": "^[a-z][a-z-A-Z0-9]*$",
"selector-max-compound-selectors": [
3,
{
"severity": "warning"
}
],
"selector-max-id": 0,
"selector-max-type": [
2,
{
"severity": "warning"
}
],
"selector-max-combinators": [
2,
{
"severity": "warning"
}
],
"selector-max-universal": 1,
"selector-max-specificity": "0,3,0",
"selector-list-comma-newline-before": "never-multi-line",
"selector-list-comma-space-after": "always-single-line",
"custom-media-pattern": "^[a-z][a-z-A-Z0-9]*$",
"media-query-list-comma-newline-before": "never-multi-line",
"at-rule-semicolon-space-before": "never",
"indentation": 4,
"max-line-length": 120,
"no-descending-specificity": [
true,
{
"severity": "warning"
}
],
"no-duplicate-selectors": true,
"no-empty-source": null,
"block-no-empty": null,
"color-hex-length": "long",
"color-hex-case": ["upper"],
"shorthand-property-no-redundant-values": null,
"scss/dollar-variable-pattern": "^[a-z][a-z-A-Z0-9]*$",
"scss/dollar-variable-colon-space-after": "always-single-line",
"scss/dollar-variable-colon-space-before": "never",
"scss/dollar-variable-empty-line-before": [
"always",
{
"except": [
"first-nested",
"after-comment",
"after-dollar-variable"
]
}
],
"scss/percent-placeholder-pattern": "^[a-z][a-z-A-Z0-9]*$",
"scss/double-slash-comment-whitespace-inside": "always",
"scss/declaration-nested-properties": "never",
"scss/operator-no-newline-after": true,
"scss/operator-no-newline-before": true,
"scss/operator-no-unspaced": true,
"scss/at-else-if-parentheses-space-before": "always",
"scss/at-function-parentheses-space-before": "never",
"scss/at-function-pattern": "^[a-z][a-z-A-Z0-9]*$",
"scss/at-mixin-parentheses-space-before": "never"
}
}

34 changes: 34 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "stylelint-config-ma",
"version": "1.0.0",
"description": "Stylelint shareable config used by MASSIVE ART",
"main": "index.js",
"scripts": {
"test": "stylelint --formatter verbose --config ./index.js --syntax scss test/*.scss"
},
"repository": {
"type": "git",
"url": "git+https://github.com/massiveart/stylelint-config-ma.git"
},
"keywords": [
"stylelint",
"stylelintconfig",
"massiveart"
],
"author": "MASSIVE ART Webservices GmbH",
"license": "MIT",
"bugs": {
"url": "https://github.com/massiveart/stylelint-config-ma/issues"
},
"homepage": "https://github.com/massiveart/stylelint-config-ma#readme",
"dependencies": {
"stylelint-config-standard": "^18.2.0",
"stylelint-scss": "^3.0.0"
},
"devDependencies": {
"stylelint": "^9.2.0"
},
"peerDependencies": {
"stylelint": "^8.3.0 || ^9.0.0"
}
}
17 changes: 17 additions & 0 deletions test/animation.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@keyframes exampleTest {
from {
background-color: red;
}

to {
background-color: yellow;
}
}

.test {
animation-name: exampleTest;
}

.unknown {
animation-name: unknownFunction;
}
3 changes: 3 additions & 0 deletions test/indent.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.indent {
color: red;
}
7 changes: 7 additions & 0 deletions test/naming.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.test {
color: red;
}

.test-class {
color: red;
}
7 changes: 7 additions & 0 deletions test/variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
$test: red;
$testColor: blue;

.test-class {
background: $test;
color: $testColor;
}

0 comments on commit cb4bbe5

Please sign in to comment.