Skip to content

Commit

Permalink
Initial README restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronccasanova authored and chloerice committed Nov 10, 2022
1 parent 2ce4d38 commit ac91bc0
Showing 1 changed file with 28 additions and 44 deletions.
72 changes: 28 additions & 44 deletions stylelint-polaris/README.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,38 @@
# Stylelint Polaris (WIP)
# Stylelint Polaris

## Experimental package structure
## Package structure

```
stylelint-polaris/
├─ plugins/
│ ├─ custom-properties-allowed-list.js
| | # (Optional) Public facing plugins for advanced configurations
| | # (See advanced config example below)
| ├─ index.js
| |
├─ configs/
| | # Common rules for `polaris-react` and Polaris consumers
| ├─ shared.js
| |
| | # Applied in `polaris-react` containing:
| | # - shared.js
| | # - specific `custom-properties-allowed-list` rules
│ ├─ internal.js
|
| # Public facing config containing:
| # - shared.js
| # - specific `custom-properties-allowed-list` rules for Polaris consumers
├─ index.js
|-- plugins/
| | # Custom plugin for categorizing built-in and custom rules
| |-- coverage.js
| | # Additional custom rules
| |-- custom-properties-allowed-list.js
| | # Plugins entry point
| | # (See advanced config example below)
| |__ index.js
| # Main stylelint-polaris config
|__ index.js
```

### Polaris react usage
### Usage

```json5
// polaris-react/package.json
{
"stylelint": {
"extends": [
"@shopify/stylelint-polaris/configs/internal"
]
},
};
```

### Consumer usage

#### Basic
### Basic

```json5
// consumer/package.json
// package.json
{
"stylelint": {
"extends": [
"@shopify/stylelint-polaris"
]
"extends": ["@shopify/stylelint-polaris"]
},
};
```

#### Advanced
### Advanced

```js
// consumer/stylelintrc.js
// .stylelintrc.js
module.exports = {
extends: ['@shopify/stylelint-polaris'],
plugins: ['@shopify/stylelint-polaris/plugins'],
Expand All @@ -79,8 +55,16 @@ module.exports = {
yarn install
```

2. Run `stylelint` on `polaris-react`
2. Build `@shopify/polaris` dependencies, but not `@shopify/polaris` itself

```sh
yarn build -- --filter=@shopify/polaris^...
```

> Note: Remove the `^` character if you do want to build `@shopify/polaris`
3. Run `stylelint` on `polaris-react`

```sh
yarn lint:stylelint
cd polaris-react && yarn lint:styles
```

0 comments on commit ac91bc0

Please sign in to comment.