@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.
@@ -0,0 +1,16 @@
1
+ $ tsdown --config ../../shared/tsdown-package.config.ts
2
+ ℹ tsdown v0.22.3 powered by rolldown v1.1.3
3
+ ℹ config file: /home/runner/work/css/css/shared/tsdown-package.config.ts
4
+ ℹ entry: src/index.ts
5
+ ℹ tsconfig: tsconfig.prod.json
6
+ ℹ Build start
7
+ ℹ dist/index.js 0.19 kB │ gzip: 0.15 kB
8
+ ℹ dist/index.d.ts 0.15 kB │ gzip: 0.13 kB
9
+ ℹ 2 files, total: 0.34 kB
10
+ [PLUGIN_TIMINGS] Your 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
+ ✔ Build complete in 5456ms
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/1aron/repo/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
- ## Documentation
56
- Check out the official [documentation](https://rc.css.master.co/docs/code-linting).
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)
@@ -0,0 +1,6 @@
1
+ import { Linter } from "eslint";
2
+
3
+ //#region src/index.d.ts
4
+ declare const recommended: Linter.Config[];
5
+ //#endregion
6
+ export { recommended as default };
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ import css from "@master/eslint-plugin-css";
2
+ //#region src/index.ts
3
+ const recommended = [css.configs.recommended, css.configs.stylesheet];
4
+ //#endregion
5
+ export { recommended as default };
@@ -0,0 +1,5 @@
1
+ import common from '../../eslint.config.js'
2
+
3
+ export default [
4
+ ...common
5
+ ]
package/package.json CHANGED
@@ -1 +1,56 @@
1
- {"name":"@master/eslint-config-css","keywords":["mastercss","eslint","eslintconfig"],"license":"MIT","description":"Master CSS ESLint Plugin Config","author":"Aoyue Design LLC.","funding":"https://css.master.co/docs/donate","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":"index.js","exports":{".":"./index.js","./flat":"./flat.js"},"publishConfig":{"access":"public"},"dependencies":{"@master/eslint-plugin-css":"^2.0.0-rc.8"},"version":"2.0.0-rc.8"}
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,9 @@
1
+ import css from '@master/eslint-plugin-css'
2
+ import type { Linter } from 'eslint'
3
+
4
+ const recommended: Linter.Config[] = [
5
+ css.configs.recommended,
6
+ css.configs.stylesheet
7
+ ]
8
+
9
+ export default recommended
@@ -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
+ ])
@@ -0,0 +1,4 @@
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
+ <button class="btn">...</button>
4
+ <div class="bg:indigo width:error">...</div>
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,12 @@
1
+ {
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
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "rootDir": "src",
5
+ "outDir": "dist",
6
+ },
7
+ "include": [
8
+ "src/**/*"
9
+ ]
10
+ }
@@ -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
+ }
@@ -0,0 +1,4 @@
1
+ import { defineConfig } from 'vitest/config'
2
+ import config from '../../shared/vitest.config'
3
+
4
+ export default defineConfig(config)
package/flat.js DELETED
@@ -1,3 +0,0 @@
1
- const { configs } = require('@master/eslint-plugin-css')
2
-
3
- module.exports = configs.flat
package/index.js DELETED
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- extends: ['plugin:@master/css/recommended']
3
- }