Skip to content

Commit a3437f3

Browse files
dangreenCopilot
andauthored
feat(stylelint-config): introduce stylelint config (#107)
* feat(stylelint-config): introduce stylelint config * chore: update packages/stylelint-config/src/subconfigs/common.js Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent f83d1fd commit a3437f3

File tree

15 files changed

+1574
-1
lines changed

15 files changed

+1574
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"node": ">=20"
1818
},
1919
"scripts": {
20-
"clear": "del './packages/*/dist' ./coverage ./node_modules/.cache",
20+
"clear": "del './packages/*/package' ./coverage ./node_modules/.cache",
2121
"lint:package-json": "lint-package-json --monorepo",
2222
"lint": "eslint --flag v10_config_lookup_from_file",
2323
"test:unit": "vitest run",
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# @trigen/stylelint-config
2+
3+
[![NPM version][npm]][npm-url]
4+
[![Node version][node]][node-url]
5+
[![Dependencies status][deps]][deps-url]
6+
[![Install size][size]][size-url]
7+
[![Build status][build]][build-url]
8+
9+
[npm]: https://img.shields.io/npm/v/%40trigen/stylelint-config.svg
10+
[npm-url]: https://www.npmjs.com/package/@trigen/stylelint-config
11+
12+
[node]: https://img.shields.io/node/v/%40trigen/stylelint-config.svg
13+
[node-url]: https://nodejs.org
14+
15+
[deps]: https://img.shields.io/librariesio/release/npm/@trigen/stylelint-config
16+
[deps-url]: https://libraries.io/npm/@trigen%2Fstylelint-config/tree
17+
18+
[size]: https://packagephobia.com/badge?p=@trigen/stylelint-config
19+
[size-url]: https://packagephobia.com/result?p=@trigen/stylelint-config
20+
21+
[build]: https://img.shields.io/github/actions/workflow/status/TrigenSoftware/scripts/tests.yml?branch=main
22+
[build-url]: https://github.com/TrigenSoftware/scripts/actions
23+
24+
Trigen's Stylelint config.
25+
26+
## Install
27+
28+
```bash
29+
pnpm add -D @trigen/stylelint-config
30+
# or
31+
yarn add -D @trigen/stylelint-config
32+
# or
33+
npm i -D @trigen/stylelint-config
34+
```
35+
36+
## Configure
37+
38+
Create `stylelint.config.js` with next content:
39+
40+
```js
41+
export default {
42+
extends: ['@trigen/stylelint-config']
43+
}
44+
```
45+
46+
### Additional configs
47+
48+
There are additional configs for specific language features and strict mode:
49+
50+
| Config | Description |
51+
|--------|-------------|
52+
| @trigen/stylelint-config/scss | Rules for SCSS code. |
53+
| @trigen/stylelint-config/logical | Rules with CSS logical properties support. |
54+
| @trigen/stylelint-config/strict | Strict rules for enhanced code quality. |
55+
56+
Example:
57+
58+
`stylelint.config.js`:
59+
60+
```js
61+
export default {
62+
extends: [
63+
'@trigen/stylelint-config',
64+
'@trigen/stylelint-config/scss',
65+
'@trigen/stylelint-config/logical'
66+
]
67+
}
68+
```
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+
"@stylistic/stylelint-plugin": "^3.1.3",
43+
"postcss-scss": "^4.0.9",
44+
"stylelint-csstree-validator": "^3.0.0",
45+
"stylelint-declaration-strict-value": "^1.1.3",
46+
"stylelint-gamut": "^1.3.4",
47+
"stylelint-high-performance-animation": "^1.5.1",
48+
"stylelint-order": "^7.0.0",
49+
"stylelint-plugin-a11y": "^1.0.1",
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)