|
| 1 | +<h1 align="center">Welcome to @jahia/stylelint-config 👋</h1> |
| 2 | +<p> |
| 3 | + <img alt="Version" src="https://img.shields.io/badge/version-1.0.0-blue.svg?cacheSeconds=2592000" /> |
| 4 | + <a href="../../LICENSE.txt" target="_blank"> |
| 5 | + <img alt="License: JAHIA'S DUAL LICENSING" src="https://img.shields.io/badge/License-JAHIA'S DUAL LICENSING-yellow.svg" /> |
| 6 | + </a> |
| 7 | + <a href="https://twitter.com/Jahia" target="_blank"> |
| 8 | + <img alt="Twitter: Jahia" src="https://img.shields.io/twitter/follow/Jahia.svg?style=social" /> |
| 9 | + </a> |
| 10 | +</p> |
| 11 | + |
| 12 | +> Provide Jahia Stylelint shareable config to lint your style. |
| 13 | +
|
| 14 | +We extend this configurations : |
| 15 | +- [stylelint-config-standard](https://github.com/stylelint/stylelint-config-standard) |
| 16 | +- [stylelint-config-css-modules](https://github.com/pascalduez/stylelint-config-css-modules) |
| 17 | + |
| 18 | +We use this plugins : |
| 19 | +- [stylelint-order](https://github.com/hudochenkov/stylelint-order) to check the order of content and properties within declaration blocks |
| 20 | +- [stylelint-scss](https://github.com/kristerkari/stylelint-scss) to check scss synthax |
| 21 | + |
| 22 | + |
| 23 | +## Install |
| 24 | + |
| 25 | +Add `stylelint` and this package to the `devDependencies` of the project. |
| 26 | +This can be accomplished using `yarn` with the following command: |
| 27 | + |
| 28 | +```sh |
| 29 | +yarn add -D stylelint @jahia/stylelint-config |
| 30 | +``` |
| 31 | + |
| 32 | +or using `npm` with the following one: |
| 33 | + |
| 34 | +```sh |
| 35 | +npm i -D stylelint @jahia/eslint-config |
| 36 | +``` |
| 37 | + |
| 38 | + |
| 39 | +## Configure |
| 40 | + |
| 41 | +Create a file named `.stylelintrc.json` as a sibling of your `package.json`, with the following content: |
| 42 | + |
| 43 | + ```json |
| 44 | + { |
| 45 | + "extends": "@jahia/stylelint-config" |
| 46 | + } |
| 47 | + ``` |
| 48 | + |
| 49 | +Update the scripts in your `package.json` to something like: |
| 50 | + |
| 51 | + ```json |
| 52 | + { |
| 53 | + "build": "yarn stylelint && yarn webpack", |
| 54 | + "stylelint": "stylelint './src/**/*.scss'", |
| 55 | + "stylelint:fix": "stylelint './src/**/*.scss' --fix ." |
| 56 | + } |
| 57 | + ``` |
| 58 | + |
| 59 | +Additionally you may want to add a file `.stylelintignore` as a sibling of your `package.json`, with the following content: |
| 60 | + ``` |
| 61 | + node |
| 62 | + node_modules |
| 63 | + target |
| 64 | + build |
| 65 | + ``` |
| 66 | + |
| 67 | +Also depending on your need your can override some rules in the `.stylelintrc.json` file by redefining them. |
| 68 | + |
| 69 | +**IDE integrate stylelint configuration or has a stylelint plugin to do it, do not forget to activate it** |
| 70 | + |
| 71 | +- For IntelliJ : [Activating and configuring Stylelint](https://www.jetbrains.com/help/idea/using-stylelint-code-quality-tool.html) |
| 72 | +- For Atom : [Install linter-stylelint](https://github.com/AtomLinter/linter-stylelint) |
| 73 | +- For VS Code : [Install vscode-stylelint](https://github.com/stylelint/vscode-stylelint) |
| 74 | + |
| 75 | + |
| 76 | +## Usage |
| 77 | + |
| 78 | +If you added the scripts in your `package.json`, you can do: |
| 79 | + |
| 80 | +```sh |
| 81 | +yarn stylelint |
| 82 | +``` |
| 83 | + |
| 84 | +or with *npm*: |
| 85 | + |
| 86 | +```sh |
| 87 | +npm run stylelint |
| 88 | +``` |
| 89 | + |
| 90 | +## Author |
| 91 | + |
| 92 | +👤 **Jahia** |
| 93 | + |
| 94 | +* Website: https://www.jahia.com |
| 95 | +* Twitter: [@Jahia](https://twitter.com/Jahia) |
| 96 | +* Github: [@Jahia](https://github.com/Jahia) |
| 97 | + |
| 98 | +## 🤝 Contributing |
| 99 | + |
| 100 | +Contributions, issues and feature requests are welcome!<br />Feel free to check [issues page](https://jira.jahia.com). |
| 101 | + |
| 102 | +## Show your support |
| 103 | + |
| 104 | +Give a ⭐️ if this project helped you! |
| 105 | + |
| 106 | +## 📝 License |
| 107 | + |
| 108 | +Copyright © 2019 [Jahia](https://github.com/Jahia).<br /> |
| 109 | +This project is [JAHIA'S DUAL LICENSING](../../LICENSE.txt) licensed. |
| 110 | + |
| 111 | +*** |
| 112 | +_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_ |
0 commit comments