-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement stylelint-bezier
package for easy use of bezier design token
#2412
Changes from all commits
ff79b03
6538b96
1943b0d
9aa0335
68abf52
e44e7f0
35743ef
97d4336
6c50d0c
1c0f418
4bd5f75
6a7f31b
966a60d
147f561
fba8172
7238ec9
038c916
71b10d8
9948d30
57e83c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@channel.io/stylelint-bezier': minor | ||
--- | ||
|
||
Release of `stylelint-bezier` package. It includes stylelint configuration for token validation rules to make `bezier-tokens` easy to use. |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,5 @@ module.exports = { | |
rules: { | ||
'no-restricted-imports': 'off', | ||
}, | ||
ignorePatterns: ['**/fixtures/*'], | ||
} |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* @type {import('eslint').Linter.Config} | ||
*/ | ||
module.exports = { | ||
root: true, | ||
extends: ['bezier'], | ||
parserOptions: { | ||
tsconfigRootDir: __dirname, | ||
project: './tsconfig.eslint.json', | ||
}, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Stylelint Bezier | ||
|
||
Stylelint configuration for Bezier design system. | ||
|
||
## Installation | ||
|
||
### npm | ||
|
||
```bash | ||
npm i -D @channel.io/stylelint-bezier | ||
``` | ||
|
||
### yarn | ||
|
||
```bash | ||
yarn add -D @channel.io/stylelint-bezier | ||
``` | ||
|
||
## Usage | ||
|
||
Extend @channel.io/stylelint-bezier in your stylelint config. | ||
|
||
```json | ||
{ | ||
"extends": ["@channel.io/stylelint-bezier"] | ||
} | ||
``` | ||
|
||
## Rules | ||
|
||
### validate-token | ||
|
||
Disallows use of tokens not in bezier-tokens. If you want to use css variable other than bezier design token, you can set a specific prefix and add it to ignorePrefix. | ||
|
||
```tsx | ||
{ | ||
rule: { | ||
'bezier/validate-token': [ | ||
true, | ||
{ | ||
ignorePrefix: ['b-'], | ||
severity: 'warning', | ||
}, | ||
], | ||
} | ||
} | ||
``` | ||
|
||
## Version Matchups | ||
|
||
| @channel.io/stylelint-bezier | @channel.io/bezier-react | | ||
| ---------------------------- | ------------------------ | | ||
| 0.1.0 | 2.2.4 | | ||
Comment on lines
+49
to
+53
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"name": "@channel.io/stylelint-bezier", | ||
"version": "0.0.0", | ||
"description": "Stylelint configuration for Bezier design system.", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/channel-io/bezier-react", | ||
"directory": "packages/stylelint-bezier" | ||
}, | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"build": "tsc --build --verbose", | ||
"dev": "tsc --watch", | ||
"lint": "TIMING=1 eslint --cache .", | ||
"typecheck": "tsc --noEmit", | ||
"clean": "run-s 'clean:*'", | ||
"clean:build": "rm -rf dist", | ||
"clean:cache": "rm -rf node_modules .turbo .eslintcache stats.html" | ||
}, | ||
"author": "Channel Corp.", | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
"@channel.io/bezier-tokens": "0.2.6" | ||
}, | ||
"devDependencies": { | ||
"eslint-config-bezier": "workspace:*", | ||
"postcss-styled-syntax": "^0.6.4", | ||
"tsconfig": "workspace:*" | ||
}, | ||
"peerDependencies": { | ||
"stylelint": ">=16.0.0" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module.exports = { | ||
plugins: ['./plugins/validate-token'], | ||
rules: { | ||
'bezier/validate-token': true, | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['**/*.{ts,tsx}'], | ||
customSyntax: 'postcss-styled-syntax', | ||
}, | ||
], | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍