@master/eslint-config-css 2.0.0-rc.8 → 2.0.0-rc.80
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/.turbo/turbo-build.log +16 -0
- package/AI.md +48 -0
- package/LICENSE +21 -0
- package/README.md +47 -6
- package/dist/index.d.ts +6 -0
- package/dist/index.js +5 -0
- package/eslint.config.js +5 -0
- package/package.json +56 -1
- package/src/index.ts +9 -0
- package/tests/eslint.config.js +15 -0
- package/tests/index.html +4 -0
- package/tests/test.ts +43 -0
- package/tsconfig.json +12 -0
- package/tsconfig.prod.json +10 -0
- package/tsconfig.typecheck.json +19 -0
- package/vitest.config.ts +4 -0
- package/flat.js +0 -3
- package/index.js +0 -3
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
$ tsdown --config ../../shared/tsdown-package.config.ts
|
|
2
|
+
[34mℹ[39m [34mtsdown v0.22.3[39m powered by [38;2;255;126;23mrolldown v1.1.3[39m
|
|
3
|
+
[34mℹ[39m config file: [4m/home/runner/work/css/css/shared/tsdown-package.config.ts[24m
|
|
4
|
+
[34mℹ[39m entry: [34msrc/index.ts[39m
|
|
5
|
+
[34mℹ[39m tsconfig: [34mtsconfig.prod.json[39m
|
|
6
|
+
[34mℹ[39m Build start
|
|
7
|
+
[34mℹ[39m [2mdist/[22m[1mindex.js[22m [2m0.19 kB[22m [2m│ gzip: 0.15 kB[22m
|
|
8
|
+
[34mℹ[39m [2mdist/[22m[32m[1mindex.d.ts[22m[39m [2m0.15 kB[22m [2m│ gzip: 0.13 kB[22m
|
|
9
|
+
[34mℹ[39m 2 files, total: 0.34 kB
|
|
10
|
+
[33m[PLUGIN_TIMINGS] [0mYour build spent significant time in plugins. Here is a breakdown:
|
|
11
|
+
- rolldown-plugin-dts:generate (40%)
|
|
12
|
+
- tsdown:deps (40%)
|
|
13
|
+
- external-virtual-modules (20%)
|
|
14
|
+
See https://rolldown.rs/reference/InputOptions.checks#plugintimings for more details.
|
|
15
|
+
|
|
16
|
+
[32m✔[39m Build complete in [32m5456ms[39m
|
package/AI.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# AI Notes For `@master/eslint-config-css`
|
|
2
|
+
|
|
3
|
+
## Responsibility
|
|
4
|
+
|
|
5
|
+
`@master/eslint-config-css` combines the recommended class linting config and stylesheet linting config from `@master/eslint-plugin-css`.
|
|
6
|
+
|
|
7
|
+
## Owns
|
|
8
|
+
|
|
9
|
+
- Config wrapper package entrypoint.
|
|
10
|
+
- Compatibility with the plugin recommended and stylesheet config shapes.
|
|
11
|
+
|
|
12
|
+
## Does Not Own
|
|
13
|
+
|
|
14
|
+
- ESLint rules.
|
|
15
|
+
- Plugin settings schema.
|
|
16
|
+
- Class parsing, validation, ordering, or autofix behavior.
|
|
17
|
+
|
|
18
|
+
## Public Surface
|
|
19
|
+
|
|
20
|
+
- Root config export.
|
|
21
|
+
|
|
22
|
+
## Key Files
|
|
23
|
+
|
|
24
|
+
- `src/index.ts`
|
|
25
|
+
|
|
26
|
+
## Risk Areas
|
|
27
|
+
|
|
28
|
+
- Public config compatibility.
|
|
29
|
+
- Drift from `@master/eslint-plugin-css` recommended config.
|
|
30
|
+
|
|
31
|
+
## Safe Changes
|
|
32
|
+
|
|
33
|
+
- Wrapper export fixes that stay aligned with the plugin.
|
|
34
|
+
- Tests for config re-export behavior.
|
|
35
|
+
|
|
36
|
+
## Dangerous Changes
|
|
37
|
+
|
|
38
|
+
- Diverging from the plugin recommended config without a clear reason.
|
|
39
|
+
- Adding rule behavior here instead of in `@master/eslint-plugin-css`.
|
|
40
|
+
|
|
41
|
+
## Validation
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
pnpm --filter @master/eslint-config-css test
|
|
45
|
+
pnpm --filter @master/eslint-config-css lint
|
|
46
|
+
pnpm --filter @master/eslint-config-css type-check
|
|
47
|
+
pnpm --filter @master/eslint-config-css build
|
|
48
|
+
```
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Aoyue Design LLC.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -41,16 +41,57 @@
|
|
|
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/
|
|
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 { defineConfig } from 'eslint/config'
|
|
67
|
+
import css from '@master/eslint-config-css'
|
|
68
|
+
|
|
69
|
+
export default defineConfig([
|
|
70
|
+
...css
|
|
71
|
+
])
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
This package combines the recommended class linting config and the standalone stylesheet 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
|
+
import { defineConfig } from 'eslint/config'
|
|
80
|
+
import css from '@master/eslint-config-css'
|
|
81
|
+
|
|
82
|
+
export default defineConfig([
|
|
83
|
+
...css,
|
|
84
|
+
{
|
|
85
|
+
rules: {
|
|
86
|
+
'@master/css/no-invalid-classes': ['error', {
|
|
87
|
+
disallowUnknownClass: true
|
|
88
|
+
}]
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
])
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Related docs
|
|
95
|
+
|
|
96
|
+
- [Code linting guide](https://rc.css.master.co/guide/code-linting)
|
|
97
|
+
- [ESLint plugin package](../eslint-plugin)
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
package/eslint.config.js
ADDED
package/package.json
CHANGED
|
@@ -1 +1,56 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "@master/eslint-config-css",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"keywords": [
|
|
5
|
+
"mastercss",
|
|
6
|
+
"eslint",
|
|
7
|
+
"eslintconfig"
|
|
8
|
+
],
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"description": "Master CSS ESLint Configuration",
|
|
11
|
+
"author": "Aoyue Design LLC.",
|
|
12
|
+
"funding": "https://rc.css.master.co/sponsor",
|
|
13
|
+
"homepage": "https://css.master.co",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/master-co/css/issues"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/master-co/css.git",
|
|
20
|
+
"directory": "packages/eslint-config"
|
|
21
|
+
},
|
|
22
|
+
"main": "./dist/index.js",
|
|
23
|
+
"module": "./dist/index.js",
|
|
24
|
+
"jsnext:main": "./dist/index.js",
|
|
25
|
+
"esnext": "./dist/index.js",
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"import": "./dist/index.js",
|
|
31
|
+
"default": "./dist/index.js"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public",
|
|
36
|
+
"provenance": true
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@master/eslint-plugin-css": "^2.0.0-rc.80"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"eslint": ">=9.0.0"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@angular-eslint/template-parser": "^21.4.0",
|
|
46
|
+
"eslint": "^10.5.0"
|
|
47
|
+
},
|
|
48
|
+
"version": "2.0.0-rc.80",
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "tsdown --config ../../shared/tsdown-package.config.ts",
|
|
51
|
+
"dev": "tsdown --config ../../shared/tsdown-package.config.ts --watch",
|
|
52
|
+
"type-check": "tsc -b tsconfig.typecheck.json",
|
|
53
|
+
"test": "vitest",
|
|
54
|
+
"lint": "eslint src *.js"
|
|
55
|
+
}
|
|
56
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineConfig } from 'eslint/config'
|
|
2
|
+
import css from '@master/eslint-config-css'
|
|
3
|
+
import htmlParser from '@angular-eslint/template-parser'
|
|
4
|
+
|
|
5
|
+
export default defineConfig([
|
|
6
|
+
...css,
|
|
7
|
+
{
|
|
8
|
+
files: [
|
|
9
|
+
'*.html'
|
|
10
|
+
],
|
|
11
|
+
languageOptions: {
|
|
12
|
+
parser: htmlParser
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
])
|
package/tests/index.html
ADDED
package/tests/test.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { test, expect } from 'vitest'
|
|
2
|
+
import { ESLint } from 'eslint'
|
|
3
|
+
import css from '../src/index'
|
|
4
|
+
|
|
5
|
+
test('ESLint Configuration is valid', async () => {
|
|
6
|
+
const eslint = new ESLint({ cwd: __dirname })
|
|
7
|
+
const result = await eslint.lintFiles('./index.html')
|
|
8
|
+
expect(result[0].errorCount).toBe(0)
|
|
9
|
+
expect(result[0].warningCount).toBe(9)
|
|
10
|
+
expect(result[0].messages.map((eachMessage) => eachMessage.message)).toEqual(
|
|
11
|
+
[
|
|
12
|
+
'No consistent class order followed.',
|
|
13
|
+
'"m:0.625rem", "m:5x", and "m:10x@sm" are overridden by "m:1.875rem" and "m:3.125rem@sm".',
|
|
14
|
+
'No consistent class order followed.',
|
|
15
|
+
'Prefer "font:xs" over "font:.75rem".',
|
|
16
|
+
'Prefer "font:2xl@sm" over "font:1.5rem@sm".',
|
|
17
|
+
'Prefer "mx:8x mt:8x" over "m:8x" because "mb:12x" overrides part of it.',
|
|
18
|
+
'Prefer "m:xl" over "m:8x".',
|
|
19
|
+
'Prefer "font:3xl@md" over "font:2rem@md".',
|
|
20
|
+
'Prefer "mb:2xl" over "mb:12x".',
|
|
21
|
+
]
|
|
22
|
+
)
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
test('Default ESLint configuration lints standalone stylesheets', async () => {
|
|
26
|
+
const diagnosticESLint = new ESLint({
|
|
27
|
+
cwd: __dirname,
|
|
28
|
+
overrideConfigFile: true,
|
|
29
|
+
overrideConfig: css
|
|
30
|
+
})
|
|
31
|
+
const fixESLint = new ESLint({
|
|
32
|
+
cwd: __dirname,
|
|
33
|
+
fix: true,
|
|
34
|
+
overrideConfigFile: true,
|
|
35
|
+
overrideConfig: css
|
|
36
|
+
})
|
|
37
|
+
const [diagnosticResult] = await diagnosticESLint.lintText('.btn { @compose contain:content; }', { filePath: 'index.css' })
|
|
38
|
+
const [fixResult] = await fixESLint.lintText('.btn { @compose contain:content; }', { filePath: 'index.css' })
|
|
39
|
+
|
|
40
|
+
expect(diagnosticResult.errorCount).toBe(0)
|
|
41
|
+
expect(diagnosticResult.warningCount).toBe(1)
|
|
42
|
+
expect(fixResult.output).toBe('.btn { contain: content; }')
|
|
43
|
+
})
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"composite": true,
|
|
5
|
+
"incremental": true,
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"declarationMap": false,
|
|
8
|
+
"emitDeclarationOnly": true,
|
|
9
|
+
"noEmit": false,
|
|
10
|
+
"rootDir": ".",
|
|
11
|
+
"outDir": ".tsbuild/typecheck",
|
|
12
|
+
"tsBuildInfoFile": ".tsbuild/typecheck/tsconfig.tsbuildinfo"
|
|
13
|
+
},
|
|
14
|
+
"references": [
|
|
15
|
+
{
|
|
16
|
+
"path": "../eslint-plugin/tsconfig.typecheck.json"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
package/vitest.config.ts
ADDED
package/flat.js
DELETED
package/index.js
DELETED