@octohash/eslint-config 0.1.0 → 0.1.2

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/README.md CHANGED
@@ -4,6 +4,88 @@
4
4
  [![JSDocs][jsdocs-src]][jsdocs-href]
5
5
  [![License][license-src]][license-href]
6
6
 
7
+ A comprehensive ESLint configuration package optimized for **application development**, built on top of [@antfu/eslint-config](https://github.com/antfu/eslint-config). This configuration provides a robust foundation for modern web applications with built-in support for Vue, TypeScript, and **Tailwind CSS v4**.
8
+
9
+ Since the target is web application development, CSS and HTML formatting are enabled by default.
10
+
11
+ ## Installation
12
+
13
+ ```bash
14
+ pnpm add -D @octohash/eslint-config
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ ### Basic Setup
20
+
21
+ Create an `eslint.config.js` file in your project root:
22
+
23
+ ```javascript
24
+ import { defineConfig } from '@octohash/eslint-config'
25
+
26
+ export default defineConfig()
27
+ ```
28
+
29
+ ### With Custom Options
30
+
31
+ ```javascript
32
+ import { defineConfig } from '@octohash/eslint-config'
33
+
34
+ export default defineConfig(
35
+ {
36
+ vue: true,
37
+ formatters: {
38
+ css: true,
39
+ html: true,
40
+ },
41
+ },
42
+ {
43
+ files: ['**/*.test.ts'],
44
+ rules: {
45
+ 'no-unused-vars': 'off',
46
+ },
47
+ }
48
+ )
49
+ ```
50
+
51
+ ### Tailwind CSS v4 Setup
52
+
53
+ 1. Install Tailwind CSS v4:
54
+ ```bash
55
+ pnpm add tailwindcss@4
56
+ ```
57
+
58
+ 2. Create your CSS file with v4 syntax:
59
+ ```css
60
+ @import 'tailwindcss';
61
+
62
+ /* Your custom styles */
63
+ ```
64
+
65
+ 3. The ESLint configuration will automatically detect and validate your Tailwind CSS usage.
66
+
67
+ ## Migration from @antfu/eslint-config
68
+
69
+ If you're currently using `@antfu/eslint-config` directly, you can easily migrate:
70
+
71
+ **Before:**
72
+ ```javascript
73
+ import antfu from '@antfu/eslint-config'
74
+
75
+ export default antfu()
76
+ ```
77
+
78
+ **After:**
79
+ ```javascript
80
+ import { defineConfig } from '@octohash/eslint-config'
81
+
82
+ export default defineConfig()
83
+ ```
84
+
85
+ ## License
86
+
87
+ [MIT](./LICENSE) License © [jinghaihan](https://github.com/jinghaihan)
88
+
7
89
  <!-- Badges -->
8
90
 
9
91
  [npm-version-src]: https://img.shields.io/npm/v/@octohash/eslint-config?style=flat&colorA=080f12&colorB=1fa669
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _antfu_eslint_config0 from "@antfu/eslint-config";
2
2
  import { Awaitable, OptionsConfig, TypedFlatConfigItem } from "@antfu/eslint-config";
3
- import * as eslint_flat_config_utils2 from "eslint-flat-config-utils";
3
+ import * as eslint_flat_config_utils0 from "eslint-flat-config-utils";
4
4
  import { FlatConfigComposer } from "eslint-flat-config-utils";
5
5
  import { Linter } from "eslint";
6
6
 
@@ -10,6 +10,6 @@ type AntfuOptions = OptionsConfig & Omit<TypedFlatConfigItem, 'files'>;
10
10
  type UserConfig = Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | FlatConfigComposer<any, any> | Linter.Config[]>[];
11
11
  //#endregion
12
12
  //#region src/index.d.ts
13
- declare function defineConfig(options?: Options, ...userConfigs: UserConfig): eslint_flat_config_utils2.FlatConfigComposer<_antfu_eslint_config0.TypedFlatConfigItem, _antfu_eslint_config0.ConfigNames>;
13
+ declare function defineConfig(options?: Options, ...userConfigs: UserConfig): eslint_flat_config_utils0.FlatConfigComposer<_antfu_eslint_config0.TypedFlatConfigItem, _antfu_eslint_config0.ConfigNames>;
14
14
  //#endregion
15
15
  export { defineConfig };
package/dist/index.js CHANGED
@@ -8,11 +8,12 @@ import { join } from "pathe";
8
8
  //#region src/tailwindcss.ts
9
9
  function tailwindCSS(dir) {
10
10
  const installed = isPackageExists("tailwindcss");
11
- if (!installed) return;
12
- dir = dir ?? process.cwd();
11
+ if (!installed) return [];
12
+ const config = findTailwindImportCSS(dir ?? process.cwd());
13
+ if (!config) return [];
13
14
  return {
14
15
  ...tailwindPlugin.configs["flat/recommended"],
15
- settings: { tailwindcss: { config: findTailwindImportCSS(dir) } }
16
+ settings: { tailwindcss: { config } }
16
17
  };
17
18
  }
18
19
  function findTailwindImportCSS(dir) {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@octohash/eslint-config",
3
3
  "type": "module",
4
- "version": "0.1.0",
5
- "description": "ESLint configuration based on @antfu/eslint-config, optimized for application development. Includes built-in support for Vue, TypeScript, and Tailwind CSS",
4
+ "version": "0.1.2",
5
+ "description": "ESLint configuration based on @antfu/eslint-config, includes built-in support for Tailwind CSS v4.",
6
6
  "author": "jinghaihan",
7
7
  "license": "MIT",
8
8
  "homepage": "https://github.com/jinghaihan/eslint-config#readme",
@@ -32,27 +32,28 @@
32
32
  "dist"
33
33
  ],
34
34
  "dependencies": {
35
- "@antfu/eslint-config": "^4.16.2",
35
+ "@antfu/eslint-config": "^5.0.0",
36
36
  "eslint-plugin-format": "^1.0.1",
37
- "eslint-plugin-tailwindcss": "npm:@hyoban/eslint-plugin-tailwindcss@4.0.0-alpha.13",
37
+ "eslint-plugin-tailwindcss": "^4.0.0-beta.0",
38
38
  "local-pkg": "^1.1.1",
39
39
  "pathe": "^2.0.3"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@octohash/tsconfig": "^0.1.0",
43
- "@types/node": "^24.0.12",
44
- "bumpp": "^10.2.0",
45
- "czg": "^1.11.2",
46
- "eslint": "^9.30.1",
47
- "eslint-flat-config-utils": "^2.1.0",
43
+ "@types/eslint-plugin-tailwindcss": "^3.17.0",
44
+ "@types/node": "^24.1.0",
45
+ "bumpp": "^10.2.1",
46
+ "czg": "^1.12.0",
47
+ "eslint": "^9.32.0",
48
+ "eslint-flat-config-utils": "^2.1.1",
48
49
  "lint-staged": "^16.1.2",
49
- "pncat": "^0.2.6",
50
+ "pncat": "^0.4.0",
50
51
  "simple-git-hooks": "^2.13.0",
51
52
  "taze": "^19.1.0",
52
- "tsdown": "^0.12.9",
53
+ "tsdown": "^0.13.0",
53
54
  "typescript": "^5.8.3",
54
55
  "vitest": "^3.2.4",
55
- "@octohash/eslint-config": "0.1.0"
56
+ "@octohash/eslint-config": "0.1.2"
56
57
  },
57
58
  "simple-git-hooks": {
58
59
  "pre-commit": "pnpm lint-staged"