@master/eslint-config-css 2.0.0-rc.75 → 2.0.0-rc.76

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.
@@ -4,12 +4,12 @@ $ tsdown --config ../../shared/tsdown-package.config.ts
4
4
  ℹ entry: src/index.ts
5
5
  ℹ tsconfig: tsconfig.prod.json
6
6
  ℹ Build start
7
- ℹ dist/index.js 0.16 kB │ gzip: 0.14 kB
7
+ ℹ dist/index.js 0.19 kB │ gzip: 0.15 kB
8
8
  ℹ dist/index.d.ts 0.15 kB │ gzip: 0.13 kB
9
- ℹ 2 files, total: 0.31 kB
9
+ ℹ 2 files, total: 0.34 kB
10
10
  [PLUGIN_TIMINGS] Your build spent significant time in plugins. Here is a breakdown:
11
- - rolldown-plugin-dts:generate (51%)
12
- - tsdown:deps (49%)
11
+ - tsdown:deps (65%)
12
+ - rolldown-plugin-dts:generate (34%)
13
13
  See https://rolldown.rs/reference/InputOptions.checks#plugintimings for more details.
14
14
 
15
- ✔ Build complete in 4692ms
15
+ ✔ Build complete in 4598ms
package/AI.md CHANGED
@@ -2,12 +2,12 @@
2
2
 
3
3
  ## Responsibility
4
4
 
5
- `@master/eslint-config-css` re-exports the recommended config from `@master/eslint-plugin-css`.
5
+ `@master/eslint-config-css` combines the recommended class linting config and stylesheet linting config from `@master/eslint-plugin-css`.
6
6
 
7
7
  ## Owns
8
8
 
9
9
  - Config wrapper package entrypoint.
10
- - Compatibility with the plugin recommended config shape.
10
+ - Compatibility with the plugin recommended and stylesheet config shapes.
11
11
 
12
12
  ## Does Not Own
13
13
 
package/README.md CHANGED
@@ -66,18 +66,16 @@ Use the flat config in `eslint.config.js`:
66
66
  import css from '@master/eslint-config-css'
67
67
 
68
68
  /** @type {import('eslint').Linter.Config[]} */
69
- export default [
70
- css
71
- ]
69
+ export default [...css]
72
70
  ```
73
71
 
74
- This package re-exports the recommended config from `@master/eslint-plugin-css`.
72
+ This package combines the recommended class linting config and the standalone stylesheet config from `@master/eslint-plugin-css`.
75
73
 
76
74
  For custom rules and settings, configure the plugin rules in the same flat config:
77
75
 
78
76
  ```js
79
77
  export default [
80
- css,
78
+ ...css,
81
79
  {
82
80
  rules: {
83
81
  '@master/css/no-invalid-classes': ['error', {
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Linter } from "eslint";
2
2
 
3
3
  //#region src/index.d.ts
4
- declare const recommended: Linter.Config;
4
+ declare const recommended: Linter.Config[];
5
5
  //#endregion
6
6
  export { recommended as default };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import css from "@master/eslint-plugin-css";
2
2
  //#region src/index.ts
3
- const recommended = css.configs.recommended;
3
+ const recommended = [css.configs.recommended, css.configs.stylesheet];
4
4
  //#endregion
5
5
  export { recommended as default };
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.75"
39
+ "@master/eslint-plugin-css": "^2.0.0-rc.76"
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.75",
48
+ "version": "2.0.0-rc.76",
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
@@ -1,6 +1,9 @@
1
1
  import css from '@master/eslint-plugin-css'
2
2
  import type { Linter } from 'eslint'
3
3
 
4
- const recommended: Linter.Config = css.configs.recommended
4
+ const recommended: Linter.Config[] = [
5
+ css.configs.recommended,
6
+ css.configs.stylesheet
7
+ ]
5
8
 
6
9
  export default recommended
@@ -2,7 +2,7 @@ import css from '@master/eslint-config-css'
2
2
  import htmlParser from '@angular-eslint/template-parser'
3
3
 
4
4
  export default [
5
- css,
5
+ ...css,
6
6
  {
7
7
  files: [
8
8
  '*.html'
@@ -11,4 +11,4 @@ export default [
11
11
  parser: htmlParser
12
12
  }
13
13
  }
14
- ]
14
+ ]
package/tests/test.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { test, expect } from 'vitest'
2
2
  import { ESLint } from 'eslint'
3
+ import css from '../src/index'
3
4
 
4
5
  test('ESLint Configuration is valid', async () => {
5
6
  const eslint = new ESLint({ cwd: __dirname })
@@ -20,3 +21,23 @@ test('ESLint Configuration is valid', async () => {
20
21
  ]
21
22
  )
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
+ })