Skip to content

Commit fb1415e

Browse files
unbuild FTW
1 parent 8fb5d61 commit fb1415e

20 files changed

+3734
-4540
lines changed

.eslint-doc-generatorrc.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
/* eslint-disable unicorn/prevent-abbreviations */
2+
import prettier from "prettier";
3+
24
/** @type {import('eslint-doc-generator').GenerateOptions} */
35
const config = {
46
// configEmoji: [['recommended', '✅']],
5-
// ignoreConfig: ['all', 'flat/all', 'flat/recommended'],
6-
ignoreDeprecatedRules: true,
7-
// ruleDocNotices: [],
8-
// ruleDocSectionExclude: [],
9-
// ruleDocSectionInclude: [],
7+
ignoreConfig: ["legacy-all", "legacy-recommended"],
8+
postprocess: async (content, path) =>
9+
prettier.format(content, {
10+
...(await prettier.resolveConfig(path)),
11+
parser: "markdown",
12+
}),
1013
ruleDocTitleFormat: "desc",
1114
ruleListColumns: [
1215
"name",
@@ -17,9 +20,6 @@ const config = {
1720
"hasSuggestions",
1821
"requiresTypeChecking",
1922
],
20-
// ruleListSplit: [],
21-
// urlConfigs: 'https://github.com/...#preset-configs-eslintconfigjs',
2223
};
2324

24-
// eslint-disable-next-line no-undef
25-
module.exports = config;
25+
export default config;

CONTRIBUTING.md

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -23,41 +23,6 @@ I worked on this repo using `pnpm` but it should work with other package manager
2323

2424
`pnpm test`
2525

26-
or
27-
28-
`pnpm test:jest`
29-
30-
#### `jest` or `vitest`
31-
32-
Tests were setup to work with `jest` and `vitest` both comes with pros and cons…
33-
34-
I would recommend Vitest but I also added Jest in case you want it.
35-
36-
| Jest | Vitest |
37-
| :----------------------- | :--------------------------------------------- |
38-
| Based on `commonjs` | Based on `ESM` |
39-
| ✅ Mocking | ✅ Mocking |
40-
| ✅ Snapshots | ✅ Snapshots |
41-
| ✅ Parallel testing | ✅ Parallel testing |
42-
| ✅ Fast | ✅ Often faster |
43-
| - | ✅ Support benches |
44-
| ❌ Require `ts-jest` lib | ❌ Requires `setupFile` and `vitest.config.ts` |
45-
46-
NB: In order to use, the [`RuleTester`](https://typescript-eslint.io/packages/rule-tester) from `@typescript-eslint/rule-tester`, we must:
47-
48-
- Have a `tsconfig.json` with:
49-
```
50-
{
51-
"compilerOptions": {
52-
"module": "nodenext",
53-
"moduleResolution": "nodenext"
54-
}
55-
}
56-
```
57-
More info can be found on [`v6`: Cannot find module `@typescript-eslint/*` or its corresponding type declarations](https://github.com/typescript-eslint/typescript-eslint/issues/7284).
58-
> You can use `bundler`, `node16`, or `nodenext` for `moduleResolution`.
59-
- Use `eslint` with `v8`, [`typescript-eslint` does not support `v9` yet](https://github.com/typescript-eslint/typescript-eslint/issues/8211)
60-
6126
### Docs
6227

6328
`pnpm docs:init` will create new files for each rule if necessary.

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
## Rules
66

77
<!-- begin auto-generated rules list -->
8+
9+
💡 Manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).
10+
11+
| Name | Description | 💡 |
12+
| :------------------------------- | :--------------------- | :-- |
13+
| [my-rule](docs/rules/my-rule.md) | An example ESLint rule | 💡 |
14+
815
<!-- end auto-generated rules list -->
916

1017
## Settings

docs/rules/my-rule.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# An example ESLint rule
2+
3+
💡 This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).
4+
5+
<!-- end auto-generated rule header -->
6+
7+
## Options
8+
9+
<!-- begin auto-generated rule options list -->
10+
11+
| Name | Description | Type | Choices | Default |
12+
| :--------- | :-------------------- | :------ | :---------------- | :------- |
13+
| `someBool` | someBool description. | Boolean | | `true` |
14+
| `someEnum` | someEnum description. | String | `always`, `never` | `always` |
15+
16+
<!-- end auto-generated rule options list -->

jest.config.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

package.json

Lines changed: 40 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
{
22
"name": "eslint-plugin-tailwindcss",
33
"version": "4.0.0-alpha.1",
4+
"license": "MIT",
45
"description": "Rules enforcing best practices while using Tailwind CSS",
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/francoismassart/eslint-plugin-tailwindcss"
9+
},
510
"keywords": [
611
"eslint",
712
"eslintplugin",
@@ -11,40 +16,41 @@
1116
"typescript"
1217
],
1318
"author": "François Massart",
14-
"repository": {
15-
"type": "git",
16-
"url": "https://github.com/francoismassart/eslint-plugin-tailwindcss"
17-
},
1819
"homepage": "https://github.com/francoismassart/eslint-plugin-tailwindcss",
1920
"bugs": "https://github.com/francoismassart/eslint-plugin-tailwindcss/issues",
20-
"main": "lib/index.js",
21-
"types": "lib/index.d.ts",
22-
"files": [
23-
"docs/",
24-
"lib/"
25-
],
26-
"peerDependencies": {
27-
"tailwindcss": "^4.0.0"
28-
},
2921
"type": "module",
22+
"main": "./lib/index.cjs",
23+
"module": "./lib/index.mjs",
24+
"types": "./lib/index.d.cts",
3025
"exports": {
3126
".": {
32-
"default": "./lib/index.js"
27+
"module": {
28+
"types": "./lib/index.d.mts",
29+
"default": "./lib/index.mjs"
30+
},
31+
"import": {
32+
"types": "./lib/index.d.mts",
33+
"default": "./lib/index.mjs"
34+
},
35+
"require": {
36+
"types": "./lib/index.d.cts",
37+
"default": "./lib/index.cjs"
38+
}
3339
},
3440
"./package.json": "./package.json"
3541
},
42+
"files": [
43+
"docs/",
44+
"lib/"
45+
],
3646
"scripts": {
3747
"lint": "eslint .",
3848
"lint:fix": "eslint . --fix",
39-
"build": "tsc --build",
40-
"build:diagnostics": "tsc --build --diagnostics",
41-
"watch": "tsc --watch",
42-
"tsup": "tsup ./src/index.ts --outDir lib/",
43-
"tsup:watch": "tsup ./src/index.ts --watch --outDir lib/",
49+
"build": "unbuild --config unbuild.config.ts",
4450
"docs:init": "pnpm build && eslint-doc-generator --init-rule-docs",
4551
"docs:update": "pnpm build && eslint-doc-generator",
46-
"test:jest": "jest",
47-
"test": "vitest"
52+
"test": "vitest",
53+
"tsc": "tsc --noEmit"
4854
},
4955
"dependencies": {
5056
"@typescript-eslint/utils": "^8.37.0",
@@ -57,7 +63,6 @@
5763
"@eslint/js": "^9.16.0",
5864
"@tailwindcss/typography": "^0.5.16",
5965
"@types/eslint": "^8.56.10",
60-
"@types/jest": "^29.5.12",
6166
"@typescript-eslint/parser": "^8.37.0",
6267
"@typescript-eslint/rule-tester": "^8.37.0",
6368
"eslint": "^9.31.0",
@@ -66,18 +71,24 @@
6671
"eslint-plugin-simple-import-sort": "^12.1.1",
6772
"eslint-plugin-unicorn": "^56.0.1",
6873
"globals": "^15.13.0",
69-
"jest": "^29.7.0",
74+
"prettier": "^3.5.3",
7075
"tailwindcss": "^4.0.0",
71-
"ts-jest": "^29.1.4",
72-
"tsup": "^8.1.0",
73-
"typescript": "^5.4.5",
74-
"typescript-eslint": "^8.18.0",
76+
"typescript": "^5.9.2",
77+
"typescript-eslint": "^8.42.0",
78+
"unbuild": "^3.3.1",
7579
"vitest": "^1.6.0",
7680
"vue-eslint-parser": "^10.2.0"
7781
},
82+
"peerDependencies": {
83+
"tailwindcss": "^4.0.0"
84+
},
85+
"peerDependenciesMeta": {
86+
"typescript": {
87+
"optional": true
88+
}
89+
},
7890
"engines": {
7991
"node": ">=20.10.0"
8092
},
81-
"packageManager": "pnpm@8.15.5",
82-
"license": "MIT"
93+
"packageManager": "pnpm@9.15.5"
8394
}

0 commit comments

Comments
 (0)