@master/eslint-config-css 2.0.0-rc.69 → 2.0.0-rc.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AI.md +27 -0
- package/README.md +44 -6
- package/package.json +1 -1
- package/tests/index.html +3 -3
- package/tests/test.ts +9 -11
- package/dist/index.cjs +0 -7
package/AI.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# AI Notes For `@master/eslint-config-css`
|
|
2
|
+
|
|
3
|
+
## Responsibility
|
|
4
|
+
|
|
5
|
+
This package re-exports the recommended config from `@master/eslint-plugin-css`.
|
|
6
|
+
|
|
7
|
+
## Main File
|
|
8
|
+
|
|
9
|
+
- `src/index.ts`
|
|
10
|
+
|
|
11
|
+
## Risks
|
|
12
|
+
|
|
13
|
+
- Public config compatibility.
|
|
14
|
+
- Dependency on plugin config shape.
|
|
15
|
+
|
|
16
|
+
## Rules
|
|
17
|
+
|
|
18
|
+
- Do not diverge from plugin recommended config without a clear reason.
|
|
19
|
+
|
|
20
|
+
## Validation
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
pnpm --filter @master/eslint-config-css test
|
|
24
|
+
pnpm --filter @master/eslint-config-css build
|
|
25
|
+
pnpm --filter @master/eslint-config-css type-check
|
|
26
|
+
```
|
|
27
|
+
|
package/README.md
CHANGED
|
@@ -41,16 +41,54 @@
|
|
|
41
41
|
<img alt="Follow @mastercorg" src="https://img.shields.io/static/v1?label=%20&message=twitter&color=f6f7f8&logo=twitter&style=for-the-badge">
|
|
42
42
|
</picture>
|
|
43
43
|
</a>
|
|
44
|
-
<a aria-label="Github Actions" href="https://github.com/master-co/css/actions/workflows/release.yml">
|
|
44
|
+
<a aria-label="Github Actions" href="https://github.com/master-co/css/actions/workflows/ci-release.yml">
|
|
45
45
|
<picture>
|
|
46
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/actions/workflow/status/master-co/css/release.yml?branch=rc&label=%20&message=twitter&color=212022&logo=githubactions&style=for-the-badge">
|
|
47
|
-
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/github/actions/workflow/status/master-co/css/release.yml?branch=rc&label=%20&message=twitter&color=f6f7f8&logo=githubactions&style=for-the-badge&logoColor=%23000">
|
|
48
|
-
<img alt="Github release actions" src="https://img.shields.io/github/actions/workflow/status/master-co/css/release.yml?branch=rc&label=%20&message=twitter&color=f6f7f8&logo=githubactions&style=for-the-badge&logoColor=%23000">
|
|
46
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/actions/workflow/status/master-co/css/ci-release.yml?branch=rc&label=%20&message=twitter&color=212022&logo=githubactions&style=for-the-badge">
|
|
47
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/github/actions/workflow/status/master-co/css/ci-release.yml?branch=rc&label=%20&message=twitter&color=f6f7f8&logo=githubactions&style=for-the-badge&logoColor=%23000">
|
|
48
|
+
<img alt="Github release actions" src="https://img.shields.io/github/actions/workflow/status/master-co/css/ci-release.yml?branch=rc&label=%20&message=twitter&color=f6f7f8&logo=githubactions&style=for-the-badge&logoColor=%23000">
|
|
49
49
|
</picture>
|
|
50
50
|
</a>
|
|
51
51
|
</p>
|
|
52
52
|
|
|
53
53
|
</div>
|
|
54
54
|
|
|
55
|
-
##
|
|
56
|
-
|
|
55
|
+
## Installation
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npm install -D @master/eslint-config-css
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Usage
|
|
62
|
+
|
|
63
|
+
Use the flat config in `eslint.config.js`:
|
|
64
|
+
|
|
65
|
+
```js
|
|
66
|
+
import css from '@master/eslint-config-css'
|
|
67
|
+
|
|
68
|
+
/** @type {import('eslint').Linter.Config[]} */
|
|
69
|
+
export default [
|
|
70
|
+
css
|
|
71
|
+
]
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
This package re-exports the recommended config from `@master/eslint-plugin-css`.
|
|
75
|
+
|
|
76
|
+
For custom rules and settings, configure the plugin rules in the same flat config:
|
|
77
|
+
|
|
78
|
+
```js
|
|
79
|
+
export default [
|
|
80
|
+
css,
|
|
81
|
+
{
|
|
82
|
+
rules: {
|
|
83
|
+
'@master/css/class-validation': ['error', {
|
|
84
|
+
disallowUnknownClass: true
|
|
85
|
+
}]
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Related docs
|
|
92
|
+
|
|
93
|
+
- [Code linting guide](https://rc.css.master.co/guide/code-linting)
|
|
94
|
+
- [ESLint plugin package](../eslint-plugin)
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@master/eslint-config-css","type":"module","scripts":{"build":"techor build \"src/**/*.ts\"","dev":"pnpm build --watch","type-check":"tsc --noEmit","test":"vitest","lint":"eslint"},"keywords":["mastercss","eslint","eslintconfig"],"license":"MIT","description":"Master CSS ESLint Configuration","author":"Aoyue Design LLC.","funding":"https://rc.css.master.co/sponsor","homepage":"https://css.master.co","bugs":{"url":"https://github.com/master-co/css/issues"},"repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/eslint-config"},"main":"./dist/index.
|
|
1
|
+
{"name":"@master/eslint-config-css","type":"module","scripts":{"build":"techor build \"src/**/*.ts\" --formats esm","dev":"pnpm build --watch","type-check":"tsc --noEmit","test":"vitest","lint":"eslint src *.mjs"},"keywords":["mastercss","eslint","eslintconfig"],"license":"MIT","description":"Master CSS ESLint Configuration","author":"Aoyue Design LLC.","funding":"https://rc.css.master.co/sponsor","homepage":"https://css.master.co","bugs":{"url":"https://github.com/master-co/css/issues"},"repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/eslint-config"},"main":"./dist/index.mjs","module":"./dist/index.mjs","jsnext:main":"./dist/index.mjs","esnext":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","default":"./dist/index.mjs"}},"publishConfig":{"access":"public","provenance":true},"dependencies":{"@master/eslint-plugin-css":"^2.0.0-rc.70"},"peerDependencies":{"eslint":">=9.0.0"},"devDependencies":{"@angular-eslint/template-parser":"^21.4.0","eslint":"^10.5.0"},"version":"2.0.0-rc.70"}
|
package/tests/index.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<div class="m:
|
|
2
|
-
<div class="font
|
|
1
|
+
<div class="m:0.625rem m:5x m:1.875rem m:10x@sm m:3.125rem@sm">...</div>
|
|
2
|
+
<div class="font:.75rem font:1.5rem@sm m:8x block font:2rem@md mb:12x">...</div>
|
|
3
3
|
<button class="btn">...</button>
|
|
4
|
-
<div class="bg:indigo width:error">...</div>
|
|
4
|
+
<div class="bg:indigo width:error">...</div>
|
package/tests/test.ts
CHANGED
|
@@ -4,19 +4,17 @@ import { ESLint } from 'eslint'
|
|
|
4
4
|
test('ESLint Configuration is valid', async () => {
|
|
5
5
|
const eslint = new ESLint({ cwd: __dirname })
|
|
6
6
|
const result = await eslint.lintFiles('./index.html')
|
|
7
|
-
expect(result[0].errorCount).toBe(
|
|
8
|
-
expect(result[0].warningCount).toBe(
|
|
7
|
+
expect(result[0].errorCount).toBe(0)
|
|
8
|
+
expect(result[0].warningCount).toBe(7)
|
|
9
9
|
expect(result[0].messages.map((eachMessage) => eachMessage.message)).toEqual(
|
|
10
10
|
[
|
|
11
|
-
'"m:10" applies the same declarations as "m:20" and "m:30".',
|
|
12
|
-
'"m:20" applies the same declarations as "m:10" and "m:30".',
|
|
13
|
-
'"m:30" applies the same declarations as "m:10" and "m:20".',
|
|
14
|
-
'"m:40@sm" applies the same declarations as "m:50@sm".',
|
|
15
|
-
'"m:50@sm" applies the same declarations as "m:40@sm".',
|
|
16
11
|
'No consistent class order followed.',
|
|
17
|
-
'
|
|
12
|
+
'"m:0.625rem" applies the same declarations as "m:5x" and "m:1.875rem".',
|
|
13
|
+
'"m:5x" applies the same declarations as "m:0.625rem" and "m:1.875rem".',
|
|
14
|
+
'"m:1.875rem" applies the same declarations as "m:0.625rem" and "m:5x".',
|
|
15
|
+
'"m:10x@sm" applies the same declarations as "m:3.125rem@sm".',
|
|
16
|
+
'"m:3.125rem@sm" applies the same declarations as "m:10x@sm".',
|
|
17
|
+
'No consistent class order followed.',
|
|
18
18
|
]
|
|
19
19
|
)
|
|
20
|
-
}
|
|
21
|
-
timeout: 15000 // for Mac OS CI test timed out in 5000ms.
|
|
22
|
-
})
|
|
20
|
+
})
|