@master/eslint-config-css 2.0.0-rc.83 → 2.0.0-rc.85
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 +3 -3
- package/README.md +50 -50
- package/eslint.config.js +1 -1
- package/package.json +2 -2
- package/src/index.ts +2 -2
- package/tests/eslint.config.js +8 -8
- package/tests/test.ts +33 -33
- package/tsconfig.json +10 -10
- package/tsconfig.prod.json +8 -8
- package/tsconfig.typecheck.json +17 -17
package/.turbo/turbo-build.log
CHANGED
|
@@ -8,8 +8,8 @@ $ tsdown --config ../../shared/tsdown-package.config.ts
|
|
|
8
8
|
[34mℹ[39m [2mdist/[22m[32m[1mindex.d.ts[22m[39m [2m0.15 kB[22m [2m│ gzip: 0.13 kB[22m
|
|
9
9
|
[34mℹ[39m 2 files, total: 0.34 kB
|
|
10
10
|
[33m[PLUGIN_TIMINGS] [0mYour build spent significant time in plugins. Here is a breakdown:
|
|
11
|
-
- rolldown-plugin-dts:generate (
|
|
12
|
-
- tsdown:deps (
|
|
11
|
+
- rolldown-plugin-dts:generate (66%)
|
|
12
|
+
- tsdown:deps (33%)
|
|
13
13
|
See https://rolldown.rs/reference/InputOptions.checks#plugintimings for more details.
|
|
14
14
|
|
|
15
|
-
[32m✔[39m Build complete in [
|
|
15
|
+
[32m✔[39m Build complete in [32m5894ms[39m
|
package/README.md
CHANGED
|
@@ -2,52 +2,52 @@
|
|
|
2
2
|
<div align="center">
|
|
3
3
|
|
|
4
4
|
<p align="center">
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
<a href="https://css.master.co">
|
|
6
|
+
<picture>
|
|
7
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/33840671/201701649-3bb7d698-abec-4d5f-ac30-ccc4d7bafcd4.svg">
|
|
8
|
+
<source media="(prefers-color-scheme: light)" srcset="https://user-images.githubusercontent.com/33840671/201703010-77bf2373-9899-40cc-98f5-30cf9b546941.svg">
|
|
9
|
+
<img alt="Master CSS" src="https://user-images.githubusercontent.com/33840671/201703010-77bf2373-9899-40cc-98f5-30cf9b546941.svg" width="100%">
|
|
10
|
+
</picture>
|
|
11
|
+
</a>
|
|
12
12
|
</p>
|
|
13
13
|
<p align="center">An ESLint config enforcing a consistent coding style for Master CSS</p>
|
|
14
14
|
|
|
15
15
|
<p align="center">
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
16
|
+
<a aria-label="GitHub release (latest by date including pre-releases)" href="https://github.com/master-co/css/releases">
|
|
17
|
+
<picture>
|
|
18
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/v/release/master-co/css?include_prereleases&color=212022&label=&style=for-the-badge&logo=github&logoColor=fff">
|
|
19
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/github/v/release/master-co/css?include_prereleases&color=f6f7f8&label=&style=for-the-badge&logo=github&logoColor=%23000">
|
|
20
|
+
<img alt="NPM Version" src="https://img.shields.io/github/v/release/master-co/css?include_prereleases&color=f6f7f8&label=&style=for-the-badge&logo=github">
|
|
21
|
+
</picture>
|
|
22
|
+
</a>
|
|
23
|
+
<a aria-label="NPM Package" href="https://www.npmjs.com/package/@master/eslint-config-css">
|
|
24
|
+
<picture>
|
|
25
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/dm/@master/eslint-config-css?color=212022&label=%20&logo=npm&style=for-the-badge">
|
|
26
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/npm/dm/@master/eslint-config-css?color=f6f7f8&label=%20&logo=npm&style=for-the-badge">
|
|
27
|
+
<img alt="NPM package ( download / month )" src="https://img.shields.io/npm/dm/@master/eslint-config-css?color=f6f7f8&label=%20&logo=npm&style=for-the-badge">
|
|
28
|
+
</picture>
|
|
29
|
+
</a>
|
|
30
|
+
<a aria-label="Discord Community" href="https://discord.gg/sZNKpAAAw6">
|
|
31
|
+
<picture>
|
|
32
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/discord/917780624314613760?color=212022&label=%20&logo=discord&style=for-the-badge">
|
|
33
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/discord/917780624314613760?color=f6f7f8&label=%20&logo=discord&style=for-the-badge">
|
|
34
|
+
<img alt="Discord online" src="https://img.shields.io/discord/917780624314613760?color=f6f7f8&label=%20&logo=discord&style=for-the-badge">
|
|
35
|
+
</picture>
|
|
36
|
+
</a>
|
|
37
|
+
<a aria-label="Follow @mastercorg" href="https://twitter.com/mastercorg">
|
|
38
|
+
<picture>
|
|
39
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/static/v1?label=%20&message=twitter&color=212022&logo=twitter&style=for-the-badge">
|
|
40
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/static/v1?label=%20&message=twitter&color=f6f7f8&logo=twitter&style=for-the-badge">
|
|
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
|
+
</picture>
|
|
43
|
+
</a>
|
|
44
|
+
<a aria-label="Github Actions" href="https://github.com/master-co/css/actions/workflows/ci-release.yml">
|
|
45
|
+
<picture>
|
|
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
|
+
</picture>
|
|
50
|
+
</a>
|
|
51
51
|
</p>
|
|
52
52
|
|
|
53
53
|
</div>
|
|
@@ -67,7 +67,7 @@ import { defineConfig } from 'eslint/config'
|
|
|
67
67
|
import css from '@master/eslint-config-css'
|
|
68
68
|
|
|
69
69
|
export default defineConfig([
|
|
70
|
-
|
|
70
|
+
...css
|
|
71
71
|
])
|
|
72
72
|
```
|
|
73
73
|
|
|
@@ -80,14 +80,14 @@ import { defineConfig } from 'eslint/config'
|
|
|
80
80
|
import css from '@master/eslint-config-css'
|
|
81
81
|
|
|
82
82
|
export default defineConfig([
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
83
|
+
...css,
|
|
84
|
+
{
|
|
85
|
+
rules: {
|
|
86
|
+
'@master/css/no-invalid-classes': ['error', {
|
|
87
|
+
disallowUnknownClass: true
|
|
88
|
+
}]
|
|
90
89
|
}
|
|
90
|
+
}
|
|
91
91
|
])
|
|
92
92
|
```
|
|
93
93
|
|
package/eslint.config.js
CHANGED
package/package.json
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"provenance": true
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@master/eslint-plugin-css": "^2.0.0-rc.
|
|
39
|
+
"@master/eslint-plugin-css": "^2.0.0-rc.85"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"eslint": ">=9.0.0"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@angular-eslint/template-parser": "^21.4.0",
|
|
46
46
|
"eslint": "^10.5.0"
|
|
47
47
|
},
|
|
48
|
-
"version": "2.0.0-rc.
|
|
48
|
+
"version": "2.0.0-rc.85",
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "tsdown --config ../../shared/tsdown-package.config.ts",
|
|
51
51
|
"dev": "tsdown --config ../../shared/tsdown-package.config.ts --watch",
|
package/src/index.ts
CHANGED
|
@@ -2,8 +2,8 @@ import css from '@master/eslint-plugin-css'
|
|
|
2
2
|
import type { Linter } from 'eslint'
|
|
3
3
|
|
|
4
4
|
const recommended: Linter.Config[] = [
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
css.configs.recommended,
|
|
6
|
+
css.configs.stylesheet
|
|
7
7
|
]
|
|
8
8
|
|
|
9
9
|
export default recommended
|
package/tests/eslint.config.js
CHANGED
|
@@ -3,13 +3,13 @@ import css from '@master/eslint-config-css'
|
|
|
3
3
|
import htmlParser from '@angular-eslint/template-parser'
|
|
4
4
|
|
|
5
5
|
export default defineConfig([
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
6
|
+
...css,
|
|
7
|
+
{
|
|
8
|
+
files: [
|
|
9
|
+
'*.html'
|
|
10
|
+
],
|
|
11
|
+
languageOptions: {
|
|
12
|
+
parser: htmlParser
|
|
14
13
|
}
|
|
14
|
+
}
|
|
15
15
|
])
|
package/tests/test.ts
CHANGED
|
@@ -3,41 +3,41 @@ import { ESLint } from 'eslint'
|
|
|
3
3
|
import css from '../src/index'
|
|
4
4
|
|
|
5
5
|
test('ESLint Configuration is valid', async () => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
23
|
})
|
|
24
24
|
|
|
25
25
|
test('Default ESLint configuration lints standalone stylesheets', async () => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
expect(diagnosticResult.errorCount).toBe(0)
|
|
41
|
+
expect(diagnosticResult.warningCount).toBe(1)
|
|
42
|
+
expect(fixResult.output).toBe('.btn { contain: content; }')
|
|
43
43
|
})
|
package/tsconfig.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
"extends": "../../tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"outDir": "dist",
|
|
5
|
+
"strict": false
|
|
6
|
+
},
|
|
7
|
+
"include": [
|
|
8
|
+
"src/**/*.ts",
|
|
9
|
+
"tests/**/*.test.ts",
|
|
10
|
+
"tests/**/test.ts"
|
|
11
|
+
]
|
|
12
12
|
}
|
package/tsconfig.prod.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"rootDir": "src",
|
|
5
|
+
"outDir": "dist",
|
|
6
|
+
},
|
|
7
|
+
"include": [
|
|
8
|
+
"src/**/*"
|
|
9
|
+
]
|
|
10
10
|
}
|
package/tsconfig.typecheck.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
19
|
}
|