diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..ec9b2bb --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,11 @@ +version: 2 + +jobs: + build: + docker: + - image: circleci/node:9-browsers + + steps: + - checkout + - run: npm install + - run: npm run test diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..bab5f1a --- /dev/null +++ b/.editorconfig @@ -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 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..fcadb2c --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text eol=lf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8de4a77 --- /dev/null +++ b/.gitignore @@ -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 diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..43c97e7 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +package-lock=false diff --git a/README.md b/README.md index 253921e..9a7a843 100644 --- a/README.md +++ b/README.md @@ -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``` + diff --git a/index.js b/index.js new file mode 100644 index 0000000..a4ed9f0 --- /dev/null +++ b/index.js @@ -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" + } +} + diff --git a/package.json b/package.json new file mode 100644 index 0000000..aea5f10 --- /dev/null +++ b/package.json @@ -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" + } +} diff --git a/test/animation.scss b/test/animation.scss new file mode 100644 index 0000000..70ea429 --- /dev/null +++ b/test/animation.scss @@ -0,0 +1,17 @@ +@keyframes exampleTest { + from { + background-color: red; + } + + to { + background-color: yellow; + } +} + +.test { + animation-name: exampleTest; +} + +.unknown { + animation-name: unknownFunction; +} diff --git a/test/indent.scss b/test/indent.scss new file mode 100644 index 0000000..68b731e --- /dev/null +++ b/test/indent.scss @@ -0,0 +1,3 @@ +.indent { + color: red; +} diff --git a/test/naming.scss b/test/naming.scss new file mode 100644 index 0000000..83e6e39 --- /dev/null +++ b/test/naming.scss @@ -0,0 +1,7 @@ +.test { + color: red; +} + +.test-class { + color: red; +} diff --git a/test/variables.scss b/test/variables.scss new file mode 100644 index 0000000..7b2fa44 --- /dev/null +++ b/test/variables.scss @@ -0,0 +1,7 @@ +$test: red; +$testColor: blue; + +.test-class { + background: $test; + color: $testColor; +}