Skip to content

Commit cf4cff7

Browse files
committed
feat(stylelint-config): introduce stylelint config
1 parent 7094d9e commit cf4cff7

21 files changed

+3424
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# @trigen/stylelint-config
2+
3+
[![NPM version][npm]][npm-url]
4+
[![Node version][node]][node-url]
5+
[![Peer dependencies status][peer-deps]][peer-deps-url]
6+
[![Dependencies status][deps]][deps-url]
7+
[![Build status][build]][build-url]
8+
[![Dependabot badge][dependabot]][dependabot-url]
9+
10+
[npm]: https://img.shields.io/npm/v/%40trigen/stylelint-config.svg
11+
[npm-url]: https://npmjs.com/package/@trigen/stylelint-config
12+
13+
[node]: https://img.shields.io/node/v/%40trigen/stylelint-config.svg
14+
[node-url]: https://nodejs.org
15+
16+
[peer-deps]: https://david-dm.org/TrigenSoftware/scripts/peer-status.svg?path=packages/stylelint-config
17+
[peer-deps-url]: https://david-dm.org/TrigenSoftware/scripts?type=peer&path=packages/stylelint-config
18+
19+
[deps]: https://david-dm.org/TrigenSoftware/scripts.svg?path=packages/stylelint-config
20+
[deps-url]: https://david-dm.org/TrigenSoftware/scripts?path=packages/stylelint-config
21+
22+
[build]: https://img.shields.io/github/actions/workflow/status/TrigenSoftware/scripts/ci.yml?branch=main
23+
[build-url]: https://github.com/TrigenSoftware/scripts/actions
24+
25+
[dependabot]: https://api.dependabot.com/badges/status?host=github&repo=TrigenSoftware/scripts
26+
[dependabot-url]: https://dependabot.com/
27+
28+
Trigen's Stylelint config
29+
30+
## Install
31+
32+
```bash
33+
npm i -D @trigen/stylelint-config
34+
#or
35+
yarn add -D @trigen/stylelint-config
36+
```
37+
38+
## Configure
39+
40+
Create `.stylelintrc` with next content:
41+
42+
```json
43+
{
44+
"extends": "@trigen/stylelint-config"
45+
}
46+
```
47+
48+
### Other configs
49+
50+
There are other configs for different syntax:
51+
52+
| Config | Description |
53+
|--------|-------------|
54+
| @trigen/stylelint-config/css | Rules for CSS code. |
55+
| @trigen/stylelint-config/scss | Rules for SCSS code. |
56+
| @trigen/stylelint-config/stylable | Rules for Stylable code. |
57+
58+
Example:
59+
60+
```json
61+
{
62+
"extends": [
63+
"@trigen/stylelint-config"
64+
"@trigen/stylelint-config/scss"
65+
]
66+
}
67+
```
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import moduleConfig from '@trigen/eslint-config/module'
2+
import rootConfig from '../../eslint.config.js'
3+
4+
export default [
5+
...rootConfig,
6+
...moduleConfig,
7+
{
8+
rules: {
9+
'no-magic-numbers': 'off',
10+
'import/no-default-export': 'off',
11+
'import/no-anonymous-default-export': 'off'
12+
}
13+
}
14+
]
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"name": "@trigen/stylelint-config",
3+
"type": "module",
4+
"version": "8.0.0-alpha.33",
5+
"description": "Trigen's Stylelint config.",
6+
"author": "dangreen",
7+
"license": "MIT",
8+
"repository": {
9+
"type": "git",
10+
"url": "https://github.com/TrigenSoftware/scripts.git",
11+
"directory": "packages/stylelint-config"
12+
},
13+
"bugs": {
14+
"url": "https://github.com/TrigenSoftware/scripts/issues"
15+
},
16+
"keywords": [
17+
"stylelint",
18+
"stylelint-config",
19+
"css",
20+
"scss"
21+
],
22+
"engines": {
23+
"node": ">=20"
24+
},
25+
"exports": {
26+
".": "./src/index.js",
27+
"./*": "./src/*.js"
28+
},
29+
"publishConfig": {
30+
"access": "public",
31+
"directory": "package",
32+
"linkDirectory": false
33+
},
34+
"scripts": {
35+
"prepublishOnly": "del ./package && clean-publish",
36+
"postpublish": "del ./package"
37+
},
38+
"peerDependencies": {
39+
"stylelint": ">=12.0.0"
40+
},
41+
"dependencies": {
42+
"@double-great/stylelint-a11y": "^3.0.4",
43+
"@stylistic/stylelint-plugin": "^3.1.3",
44+
"postcss-scss": "^4.0.9",
45+
"stylelint-csstree-validator": "^3.0.0",
46+
"stylelint-declaration-strict-value": "^1.1.3",
47+
"stylelint-gamut": "^1.3.4",
48+
"stylelint-high-performance-animation": "^1.5.1",
49+
"stylelint-order": "^7.0.0",
50+
"stylelint-plugin-logical-css": "^1.2.3",
51+
"stylelint-scss": "^6.12.1"
52+
},
53+
"devDependencies": {
54+
"stylelint": "^16.21.1"
55+
}
56+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/**
2+
* Export common subconfig
3+
*/
4+
5+
export { default } from './subconfigs/common.js'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/**
2+
* Export logical subconfig
3+
*/
4+
5+
export { default } from './subconfigs/logical.js'
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* Export SCSS subconfig
3+
*/
4+
5+
import scssConfig from './subconfigs/scss.js'
6+
7+
export default {
8+
overrides: [
9+
{
10+
files: ['**/*.scss'],
11+
...scssConfig
12+
}
13+
]
14+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/**
2+
* Export strict subconfig
3+
*/
4+
5+
export { default } from './subconfigs/strict.js'

0 commit comments

Comments
 (0)