@octohash/eslint-config 0.1.0 → 0.1.1
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 +80 -0
- package/dist/index.js +3 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,9 +1,89 @@
|
|
|
1
1
|
# @octohash/eslint-config
|
|
2
2
|
|
|
3
3
|
[![npm version][npm-version-src]][npm-version-href]
|
|
4
|
+
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
5
|
+
[![bundle][bundle-src]][bundle-href]
|
|
4
6
|
[![JSDocs][jsdocs-src]][jsdocs-href]
|
|
5
7
|
[![License][license-src]][license-href]
|
|
6
8
|
|
|
9
|
+
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**.
|
|
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
|
+
```javascript
|
|
72
|
+
// Before
|
|
73
|
+
import antfu from '@antfu/eslint-config'
|
|
74
|
+
|
|
75
|
+
export default antfu()
|
|
76
|
+
|
|
77
|
+
// After
|
|
78
|
+
import { defineConfig } from '@octohash/eslint-config'
|
|
79
|
+
|
|
80
|
+
export default defineConfig()
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## License
|
|
84
|
+
|
|
85
|
+
[MIT](./LICENSE) License © [jinghaihan](https://github.com/jinghaihan)
|
|
86
|
+
|
|
7
87
|
<!-- Badges -->
|
|
8
88
|
|
|
9
89
|
[npm-version-src]: https://img.shields.io/npm/v/@octohash/eslint-config?style=flat&colorA=080f12&colorB=1fa669
|
package/dist/index.js
CHANGED
|
@@ -9,10 +9,11 @@ import { join } from "pathe";
|
|
|
9
9
|
function tailwindCSS(dir) {
|
|
10
10
|
const installed = isPackageExists("tailwindcss");
|
|
11
11
|
if (!installed) return;
|
|
12
|
-
|
|
12
|
+
const config = findTailwindImportCSS(dir ?? process.cwd());
|
|
13
|
+
if (!config) return;
|
|
13
14
|
return {
|
|
14
15
|
...tailwindPlugin.configs["flat/recommended"],
|
|
15
|
-
settings: { tailwindcss: { config
|
|
16
|
+
settings: { tailwindcss: { config } }
|
|
16
17
|
};
|
|
17
18
|
}
|
|
18
19
|
function findTailwindImportCSS(dir) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octohash/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.1",
|
|
5
5
|
"description": "ESLint configuration based on @antfu/eslint-config, optimized for application development. Includes built-in support for Vue, TypeScript, and Tailwind CSS",
|
|
6
6
|
"author": "jinghaihan",
|
|
7
7
|
"license": "MIT",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"tsdown": "^0.12.9",
|
|
53
53
|
"typescript": "^5.8.3",
|
|
54
54
|
"vitest": "^3.2.4",
|
|
55
|
-
"@octohash/eslint-config": "0.1.
|
|
55
|
+
"@octohash/eslint-config": "0.1.1"
|
|
56
56
|
},
|
|
57
57
|
"simple-git-hooks": {
|
|
58
58
|
"pre-commit": "pnpm lint-staged"
|