@infra-x/create-eslint-config 0.2.2 → 0.2.4

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @infra-x/eslint-config@0.1.8 build /home/runner/work/infra-code/infra-code/packages/eslint-config
2
+ > @infra-x/eslint-config@0.1.11 build /home/runner/work/infra-code/infra-code/packages/eslint-config
3
3
  > tsdown
4
4
 
5
5
  ℹ tsdown v0.21.4 powered by rolldown v1.0.0-rc.9
@@ -7,7 +7,7 @@
7
7
  ℹ entry: src/index.ts
8
8
  ℹ tsconfig: tsconfig.json
9
9
  ℹ Build start
10
- ℹ dist/index.mjs 16.59 kB │ gzip: 4.75 kB
11
- ℹ dist/index.d.mts  7.11 kB │ gzip: 2.31 kB
12
- ℹ 2 files, total: 23.70 kB
13
- ✔ Build complete in 1852ms
10
+ ℹ dist/index.mjs 16.92 kB │ gzip: 4.89 kB
11
+ ℹ dist/index.d.mts  7.34 kB │ gzip: 2.42 kB
12
+ ℹ 2 files, total: 24.26 kB
13
+ ✔ Build complete in 1658ms
@@ -1,5 +1,23 @@
1
1
  # @infra-x/eslint-config
2
2
 
3
+ ## 0.1.11
4
+
5
+ ### Patch Changes
6
+
7
+ - ce4df19: fix tailwind entryPoint default filename
8
+
9
+ ## 0.1.10
10
+
11
+ ### Patch Changes
12
+
13
+ - Add `better-tailwindcss/enforce-canonical-classes` rule with rootFontSize 16
14
+
15
+ ## 0.1.9
16
+
17
+ ### Patch Changes
18
+
19
+ - 4125221: Remove `import-x/no-unused-modules` rule which is a no-op in ESLint 10 due to the removal of the `FileEnumerator` API. Translate remaining Chinese comments to English.
20
+
3
21
  ## 0.1.5
4
22
 
5
23
  ### Patch Changes
@@ -2,14 +2,6 @@
2
2
 
3
3
  Composable ESLint flat config factory for infra-x projects.
4
4
 
5
- ## Release
6
-
7
- ```bash
8
- pnpm release
9
- ```
10
-
11
- 交互式选择版本号,自动 bump `package.json`、提交、打 tag。
12
-
13
5
  ## Installation
14
6
 
15
7
  ```bash
@@ -53,7 +53,7 @@
53
53
  "typescript-eslint": "^8.56.1"
54
54
  },
55
55
  "peerDependencies": {
56
- "eslint": "^9.39.2 || ^10.0.0",
56
+ "eslint": "^10.0.0",
57
57
  "globals": "17.4.0",
58
58
  "jiti": "2.6.1",
59
59
  "storybook": ">=10.0.0",
@@ -13,7 +13,15 @@ import type { Linter } from 'eslint'
13
13
  * Tailwind CSS rule configuration
14
14
  */
15
15
  export function tailwind(options: TailwindOptions = {}): Linter.Config[] {
16
- const { files = [GLOB_JSX], overrides = {}, entryPoint = 'src/styles/global.css' } = options
16
+ const { files = [GLOB_JSX], overrides = {}, entryPoint = 'src/styles/globals.css', rootFontSize } = options
17
+
18
+ if (rootFontSize === undefined) {
19
+ console.warn(
20
+ '[eslint-config] tailwind: `rootFontSize` is not set. '
21
+ + 'This affects `enforce-canonical-classes` — set it to your `<html>` font size (usually 16). '
22
+ + 'Defaulting to 16.',
23
+ )
24
+ }
17
25
 
18
26
  return defineConfig({
19
27
  name: 'tailwind/rules',
@@ -23,11 +31,13 @@ export function tailwind(options: TailwindOptions = {}): Linter.Config[] {
23
31
  ],
24
32
  rules: {
25
33
  'better-tailwindcss/enforce-consistent-line-wrapping': ['error', { printWidth: 0 }],
34
+ 'better-tailwindcss/enforce-canonical-classes': 'error',
26
35
  ...overrides,
27
36
  },
28
37
  settings: {
29
38
  'better-tailwindcss': {
30
39
  entryPoint,
40
+ rootFontSize: rootFontSize ?? 16,
31
41
  },
32
42
  },
33
43
  })
@@ -78,7 +78,7 @@ export function imports(options: ImportsOptions = {}): Linter.Config[] {
78
78
  ],
79
79
  'import-x/consistent-type-specifier-style': 'error',
80
80
  'import-x/no-named-as-default': 'warn',
81
- // maxDepth 避免全图遍历导致性能问题
81
+ // maxDepth prevents full-graph traversal for performance
82
82
  'import-x/no-cycle': ['error', { maxDepth: 5 }],
83
83
  'import-x/no-deprecated': 'warn',
84
84
  'import-x/no-extraneous-dependencies': 'error',
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import reactPlugin from '@eslint-react/eslint-plugin'
5
5
  import { defineConfig } from 'eslint/config'
6
- // import reactHooksPlugin from 'eslint-plugin-react-hooks'// reactPlugin 新版本已经包含了 reactHooksPlugin
6
+ // import reactHooksPlugin from 'eslint-plugin-react-hooks' // reactPlugin already includes reactHooksPlugin in newer versions
7
7
  import reactRefresh from 'eslint-plugin-react-refresh'
8
8
 
9
9
  import { GLOB_JSX } from '../utils'
@@ -26,7 +26,7 @@ export function react(options: ReactOptions = {}): Linter.Config[] {
26
26
  ...(vite ? [reactRefresh.configs.recommended] : []),
27
27
  ],
28
28
  rules: {
29
- // attributes: false 允许在 JSX 事件属性(如 onClick)上传入 async 函数,此场景仅在 React 中存在
29
+ // attributes: false allows passing async functions to JSX event attributes (e.g. onClick), which is valid in React
30
30
  '@typescript-eslint/no-misused-promises': [
31
31
  'error',
32
32
  {
@@ -34,7 +34,7 @@ export function typescript(options: TypeScriptOptions = {}): Linter.Config[] {
34
34
  '@typescript-eslint/consistent-type-imports': 'error',
35
35
  '@typescript-eslint/no-unused-vars': 'off',
36
36
  '@typescript-eslint/no-deprecated': 'warn',
37
- // '@typescript-eslint/no-inferrable-types': 'off', 会导致冗余的类型注解
37
+ // '@typescript-eslint/no-inferrable-types': 'off', would cause redundant type annotations
38
38
  '@typescript-eslint/unbound-method': 'warn',
39
39
 
40
40
  ...overrides,
@@ -38,6 +38,12 @@ export interface OptionsTailwind {
38
38
  * @default 'src/global.css'
39
39
  */
40
40
  entryPoint?: string
41
+ /**
42
+ * Font size of the `<html>` element in pixels.
43
+ * Used by `enforce-canonical-classes` to determine if arbitrary values can be replaced with predefined sizing scales.
44
+ * @default 16
45
+ */
46
+ rootFontSize?: number
41
47
  }
42
48
 
43
49
  // ============================================================================
@@ -106,7 +112,7 @@ export interface ImportsOptions extends OptionsOverrides {
106
112
  */
107
113
  noRelativeParentImports?: boolean
108
114
  /**
109
- * Root directory for tsconfig.json lookup; restricts resolver scope in monorepo to avoid cross-app漫游
115
+ * Root directory for tsconfig.json lookup; restricts resolver scope in monorepo to avoid cross-app roaming
110
116
  * Automatically injected by composeConfig from the global typescript.tsconfigRootDir option
111
117
  */
112
118
  tsconfigRootDir?: string
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@infra-x/create-eslint-config",
3
3
  "type": "module",
4
- "version": "0.2.2",
4
+ "version": "0.2.4",
5
5
  "description": "CLI to copy ESLint config source into a monorepo.",
6
6
  "author": "infra-x",
7
7
  "license": "MIT",
@@ -29,7 +29,7 @@
29
29
  "eslint": "^10.0.2",
30
30
  "tsdown": "^0.21.0",
31
31
  "typescript": "^5.9.3",
32
- "@infra-x/eslint-config": "0.1.8",
32
+ "@infra-x/eslint-config": "0.1.11",
33
33
  "@infra-x/typescript-config": "0.1.6"
34
34
  },
35
35
  "exports": {