Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/apostrophecms/stylelint-config-apostrophe
An stylelint configuration for Apostrophe.
https://github.com/apostrophecms/stylelint-config-apostrophe
Last synced: about 2 months ago
JSON representation
An stylelint configuration for Apostrophe.
- Host: GitHub
- URL: https://github.com/apostrophecms/stylelint-config-apostrophe
- Owner: apostrophecms
- Created: 2021-01-20T14:42:12.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-09-18T08:28:47.000Z (3 months ago)
- Last Synced: 2024-09-18T11:12:41.465Z (3 months ago)
- Language: JavaScript
- Size: 61.5 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# stylelint-config-apostrophe
> An stylelint configuration for the Apostrophe team.
Extends `stylelint-config-standard`
This config also leverages the following plugins to fine tune our rules.
```json
"stylelint-order"
"stylelint-declaration-strict-value"
"stylelint-scss"
"stylelint-selector-bem-pattern"
```## Installation
```bash
npm i stylelint-config-apostrophe --save-dev
```## Package versions
Choose the appropriate for your application `stylelint-config-apostrophe` version based on the `stylelint` dependency introduced on a project level:
| Stylelint | Apostrophe config |
| :-------------- | ----------------: |
| >= v13.8.x < 14 | v1.x.x |
| v14.x.x | v2.x.x |
| v16.x.x | v2.x.x |[Migrating to stylelint v14](https://stylelint.io/migration-guide/to-14/)
## Usage
If you've installed `stylelint-config-apostrophe` locally within your project, just set your `stylelint` config to:
```json
{
"extends": "stylelint-config-apostrophe"
}
```In order to also use the `stylelint-selector-bem-pattern` rules, you'll also need to configure this rule at a project level.
If using our build tools you can configure this as in your `webpack.config` by setting the `prefix` option of the `prefixer` setting. You may also use the `ignore` option to allow vendor prefixes to be allowed.
```js
prefixer: {
prefix: 'my-project',
ignore: [ /apos-/ ]
}
```If you're not using our build tools, you may simply configure your rules in your `.stylelintrc` file per the instructions from the [`stylelint-selector-bem-pattern` plugin](https://github.com/simonsmith/stylelint-selector-bem-pattern#usage).
## Viewing differences between the standard configuration and ours
From this project's root, run
```
npm run compare
```This will print a report in your terminal which shows which rules we not added to our config and which rules we have specifically modified.
All missing rules should be added to the `.stylelintrc.json` with a definition even if we agree with the standard. This ensures that we are aware of any new rules or changed definitions that are made to the standard and will allow us to lock down the rule definitions that we agree with.