@debbl/eslint-config 3.1.8 → 3.2.0-beta.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/dist/index.cjs +27 -17
- package/dist/index.d.cts +4 -6
- package/dist/index.d.ts +4 -6
- package/dist/index.js +27 -17
- package/package.json +21 -15
package/dist/index.cjs
CHANGED
|
@@ -1383,7 +1383,7 @@ async function perfectionist() {
|
|
|
1383
1383
|
}
|
|
1384
1384
|
|
|
1385
1385
|
// src/configs/prettier.ts
|
|
1386
|
-
var prettier = async (
|
|
1386
|
+
var prettier = async (options) => {
|
|
1387
1387
|
const [pluginPrettier, configPrettier] = await Promise.all([
|
|
1388
1388
|
interopDefault(import("eslint-plugin-prettier")),
|
|
1389
1389
|
// @ts-expect-error missing types
|
|
@@ -1458,18 +1458,11 @@ var prettier = async ({ tailwindcss: tailwindcss2, ...options }) => {
|
|
|
1458
1458
|
name: "eslint/prettier/rules",
|
|
1459
1459
|
ignores: [GLOB_TOML],
|
|
1460
1460
|
rules: {
|
|
1461
|
-
// disable rules with prettier conflicts
|
|
1462
1461
|
...configPrettier.rules,
|
|
1463
|
-
|
|
1464
|
-
...{
|
|
1465
|
-
"prettier/prettier": "error",
|
|
1466
|
-
"arrow-body-style": "off",
|
|
1467
|
-
"prefer-arrow-callback": "off"
|
|
1468
|
-
},
|
|
1462
|
+
...pluginPrettier.configs.recommended.rules,
|
|
1469
1463
|
"prettier/prettier": [
|
|
1470
1464
|
"warn",
|
|
1471
1465
|
{
|
|
1472
|
-
plugins: tailwindcss2 ? ["prettier-plugin-tailwindcss"] : [],
|
|
1473
1466
|
quoteProps: "consistent",
|
|
1474
1467
|
...options
|
|
1475
1468
|
}
|
|
@@ -1520,7 +1513,11 @@ async function next() {
|
|
|
1520
1513
|
];
|
|
1521
1514
|
}
|
|
1522
1515
|
var react = async (options) => {
|
|
1523
|
-
const {
|
|
1516
|
+
const {
|
|
1517
|
+
next: enableNext = false,
|
|
1518
|
+
reactCompiler: enableReactCompiler = false,
|
|
1519
|
+
overrides = {}
|
|
1520
|
+
} = options;
|
|
1524
1521
|
const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all(
|
|
1525
1522
|
[
|
|
1526
1523
|
// @ts-expect-error missing types
|
|
@@ -1573,6 +1570,24 @@ var react = async (options) => {
|
|
|
1573
1570
|
}
|
|
1574
1571
|
}
|
|
1575
1572
|
];
|
|
1573
|
+
const reactCompiler = [
|
|
1574
|
+
{
|
|
1575
|
+
name: "eslint/react/compiler",
|
|
1576
|
+
files: [GLOB_TSX, GLOB_JSX],
|
|
1577
|
+
plugins: {
|
|
1578
|
+
"react-compiler": await interopDefault(
|
|
1579
|
+
// @ts-expect-error missing types
|
|
1580
|
+
import("eslint-plugin-react-compiler")
|
|
1581
|
+
)
|
|
1582
|
+
},
|
|
1583
|
+
rules: {
|
|
1584
|
+
"react-compiler/react-compiler": "error"
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
];
|
|
1588
|
+
if (enableReactCompiler) {
|
|
1589
|
+
_react.push(...reactCompiler);
|
|
1590
|
+
}
|
|
1576
1591
|
return combine(_react, enableNext ? next() : []);
|
|
1577
1592
|
};
|
|
1578
1593
|
|
|
@@ -1664,16 +1679,11 @@ function config(options = {}) {
|
|
|
1664
1679
|
})
|
|
1665
1680
|
);
|
|
1666
1681
|
}
|
|
1667
|
-
if (
|
|
1682
|
+
if (enableTailwindcss) {
|
|
1668
1683
|
configs.push(tailwindcss());
|
|
1669
1684
|
}
|
|
1670
1685
|
if (options.prettier ?? true) {
|
|
1671
|
-
configs.push(
|
|
1672
|
-
prettier({
|
|
1673
|
-
...getConfigOption(options.prettier),
|
|
1674
|
-
tailwindcss: enableTailwindcss === "prettier"
|
|
1675
|
-
})
|
|
1676
|
-
);
|
|
1686
|
+
configs.push(prettier(getConfigOption(options.prettier)));
|
|
1677
1687
|
}
|
|
1678
1688
|
const merged = combine(...configs, options.customConfig ?? []);
|
|
1679
1689
|
return merged;
|
package/dist/index.d.cts
CHANGED
|
@@ -4,6 +4,7 @@ import { RequiredOptions } from 'prettier';
|
|
|
4
4
|
|
|
5
5
|
type ReactConfig = (options: {
|
|
6
6
|
next?: boolean;
|
|
7
|
+
reactCompiler?: boolean;
|
|
7
8
|
} & OptionsOverrides) => ReturnType<ConfigFn>;
|
|
8
9
|
|
|
9
10
|
declare function comments(): Promise<ConfigItem[]>;
|
|
@@ -71,9 +72,7 @@ declare const test: TestConfig;
|
|
|
71
72
|
declare function perfectionist(): Promise<ConfigItem[]>;
|
|
72
73
|
|
|
73
74
|
type PrettierRequiredOptions = Partial<RequiredOptions>;
|
|
74
|
-
type PrettierConfig = (
|
|
75
|
-
tailwindcss?: boolean;
|
|
76
|
-
}) => Promise<ConfigItem[]>;
|
|
75
|
+
type PrettierConfig = (options: PrettierRequiredOptions) => Promise<ConfigItem[]>;
|
|
77
76
|
declare const prettier: PrettierConfig;
|
|
78
77
|
|
|
79
78
|
type Awaitable<T> = T | Promise<T>;
|
|
@@ -182,13 +181,12 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
182
181
|
*
|
|
183
182
|
* @default true
|
|
184
183
|
*/
|
|
185
|
-
prettier?: boolean |
|
|
184
|
+
prettier?: boolean | GetConfigOption<PrettierConfig>;
|
|
186
185
|
/**
|
|
187
186
|
* Enable Tailwind CSS support.
|
|
188
|
-
* if set to "prettier", it will use `prettier-plugin-tailwindcss` @see https://github.com/tailwindlabs/prettier-plugin-tailwindcss
|
|
189
187
|
* @default false
|
|
190
188
|
*/
|
|
191
|
-
tailwindcss?: boolean
|
|
189
|
+
tailwindcss?: boolean;
|
|
192
190
|
/**
|
|
193
191
|
* Custom config
|
|
194
192
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { RequiredOptions } from 'prettier';
|
|
|
4
4
|
|
|
5
5
|
type ReactConfig = (options: {
|
|
6
6
|
next?: boolean;
|
|
7
|
+
reactCompiler?: boolean;
|
|
7
8
|
} & OptionsOverrides) => ReturnType<ConfigFn>;
|
|
8
9
|
|
|
9
10
|
declare function comments(): Promise<ConfigItem[]>;
|
|
@@ -71,9 +72,7 @@ declare const test: TestConfig;
|
|
|
71
72
|
declare function perfectionist(): Promise<ConfigItem[]>;
|
|
72
73
|
|
|
73
74
|
type PrettierRequiredOptions = Partial<RequiredOptions>;
|
|
74
|
-
type PrettierConfig = (
|
|
75
|
-
tailwindcss?: boolean;
|
|
76
|
-
}) => Promise<ConfigItem[]>;
|
|
75
|
+
type PrettierConfig = (options: PrettierRequiredOptions) => Promise<ConfigItem[]>;
|
|
77
76
|
declare const prettier: PrettierConfig;
|
|
78
77
|
|
|
79
78
|
type Awaitable<T> = T | Promise<T>;
|
|
@@ -182,13 +181,12 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
182
181
|
*
|
|
183
182
|
* @default true
|
|
184
183
|
*/
|
|
185
|
-
prettier?: boolean |
|
|
184
|
+
prettier?: boolean | GetConfigOption<PrettierConfig>;
|
|
186
185
|
/**
|
|
187
186
|
* Enable Tailwind CSS support.
|
|
188
|
-
* if set to "prettier", it will use `prettier-plugin-tailwindcss` @see https://github.com/tailwindlabs/prettier-plugin-tailwindcss
|
|
189
187
|
* @default false
|
|
190
188
|
*/
|
|
191
|
-
tailwindcss?: boolean
|
|
189
|
+
tailwindcss?: boolean;
|
|
192
190
|
/**
|
|
193
191
|
* Custom config
|
|
194
192
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1301,7 +1301,7 @@ async function perfectionist() {
|
|
|
1301
1301
|
}
|
|
1302
1302
|
|
|
1303
1303
|
// src/configs/prettier.ts
|
|
1304
|
-
var prettier = async (
|
|
1304
|
+
var prettier = async (options) => {
|
|
1305
1305
|
const [pluginPrettier, configPrettier] = await Promise.all([
|
|
1306
1306
|
interopDefault(import("eslint-plugin-prettier")),
|
|
1307
1307
|
// @ts-expect-error missing types
|
|
@@ -1376,18 +1376,11 @@ var prettier = async ({ tailwindcss: tailwindcss2, ...options }) => {
|
|
|
1376
1376
|
name: "eslint/prettier/rules",
|
|
1377
1377
|
ignores: [GLOB_TOML],
|
|
1378
1378
|
rules: {
|
|
1379
|
-
// disable rules with prettier conflicts
|
|
1380
1379
|
...configPrettier.rules,
|
|
1381
|
-
|
|
1382
|
-
...{
|
|
1383
|
-
"prettier/prettier": "error",
|
|
1384
|
-
"arrow-body-style": "off",
|
|
1385
|
-
"prefer-arrow-callback": "off"
|
|
1386
|
-
},
|
|
1380
|
+
...pluginPrettier.configs.recommended.rules,
|
|
1387
1381
|
"prettier/prettier": [
|
|
1388
1382
|
"warn",
|
|
1389
1383
|
{
|
|
1390
|
-
plugins: tailwindcss2 ? ["prettier-plugin-tailwindcss"] : [],
|
|
1391
1384
|
quoteProps: "consistent",
|
|
1392
1385
|
...options
|
|
1393
1386
|
}
|
|
@@ -1438,7 +1431,11 @@ async function next() {
|
|
|
1438
1431
|
];
|
|
1439
1432
|
}
|
|
1440
1433
|
var react = async (options) => {
|
|
1441
|
-
const {
|
|
1434
|
+
const {
|
|
1435
|
+
next: enableNext = false,
|
|
1436
|
+
reactCompiler: enableReactCompiler = false,
|
|
1437
|
+
overrides = {}
|
|
1438
|
+
} = options;
|
|
1442
1439
|
const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all(
|
|
1443
1440
|
[
|
|
1444
1441
|
// @ts-expect-error missing types
|
|
@@ -1491,6 +1488,24 @@ var react = async (options) => {
|
|
|
1491
1488
|
}
|
|
1492
1489
|
}
|
|
1493
1490
|
];
|
|
1491
|
+
const reactCompiler = [
|
|
1492
|
+
{
|
|
1493
|
+
name: "eslint/react/compiler",
|
|
1494
|
+
files: [GLOB_TSX, GLOB_JSX],
|
|
1495
|
+
plugins: {
|
|
1496
|
+
"react-compiler": await interopDefault(
|
|
1497
|
+
// @ts-expect-error missing types
|
|
1498
|
+
import("eslint-plugin-react-compiler")
|
|
1499
|
+
)
|
|
1500
|
+
},
|
|
1501
|
+
rules: {
|
|
1502
|
+
"react-compiler/react-compiler": "error"
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
];
|
|
1506
|
+
if (enableReactCompiler) {
|
|
1507
|
+
_react.push(...reactCompiler);
|
|
1508
|
+
}
|
|
1494
1509
|
return combine(_react, enableNext ? next() : []);
|
|
1495
1510
|
};
|
|
1496
1511
|
|
|
@@ -1582,16 +1597,11 @@ function config(options = {}) {
|
|
|
1582
1597
|
})
|
|
1583
1598
|
);
|
|
1584
1599
|
}
|
|
1585
|
-
if (
|
|
1600
|
+
if (enableTailwindcss) {
|
|
1586
1601
|
configs.push(tailwindcss());
|
|
1587
1602
|
}
|
|
1588
1603
|
if (options.prettier ?? true) {
|
|
1589
|
-
configs.push(
|
|
1590
|
-
prettier({
|
|
1591
|
-
...getConfigOption(options.prettier),
|
|
1592
|
-
tailwindcss: enableTailwindcss === "prettier"
|
|
1593
|
-
})
|
|
1594
|
-
);
|
|
1604
|
+
configs.push(prettier(getConfigOption(options.prettier)));
|
|
1595
1605
|
}
|
|
1596
1606
|
const merged = combine(...configs, options.customConfig ?? []);
|
|
1597
1607
|
return merged;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@debbl/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.1
|
|
4
|
+
"version": "3.2.0-beta.1",
|
|
5
5
|
"description": "Brendan Dash's ESLint config",
|
|
6
6
|
"author": "Debbl <me@aiwan.run> (https://github.com/Debbl/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -23,38 +23,43 @@
|
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"eslint": ">=8.40.0"
|
|
26
|
+
"eslint": ">=8.40.0",
|
|
27
|
+
"eslint-plugin-tailwindcss": "^3.15.1"
|
|
28
|
+
},
|
|
29
|
+
"peerDependenciesMeta": {
|
|
30
|
+
"eslint-plugin-tailwindcss": {
|
|
31
|
+
"optional": true
|
|
32
|
+
}
|
|
27
33
|
},
|
|
28
34
|
"dependencies": {
|
|
29
35
|
"@next/eslint-plugin-next": "^14.2.3",
|
|
30
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
31
|
-
"@typescript-eslint/parser": "^7.
|
|
36
|
+
"@typescript-eslint/eslint-plugin": "^7.9.0",
|
|
37
|
+
"@typescript-eslint/parser": "^7.9.0",
|
|
32
38
|
"eslint-config-prettier": "^9.1.0",
|
|
33
39
|
"eslint-mdx": "^3.1.5",
|
|
34
40
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
35
41
|
"eslint-plugin-import-x": "^0.5.0",
|
|
36
|
-
"eslint-plugin-jsdoc": "^48.2.
|
|
42
|
+
"eslint-plugin-jsdoc": "^48.2.5",
|
|
37
43
|
"eslint-plugin-jsonc": "^2.15.1",
|
|
38
44
|
"eslint-plugin-markdown": "^5.0.0",
|
|
39
45
|
"eslint-plugin-mdx": "^3.1.5",
|
|
40
|
-
"eslint-plugin-n": "^17.
|
|
46
|
+
"eslint-plugin-n": "^17.7.0",
|
|
41
47
|
"eslint-plugin-no-only-tests": "^3.1.0",
|
|
42
48
|
"eslint-plugin-perfectionist": "^2.10.0",
|
|
43
49
|
"eslint-plugin-prettier": "^5.1.3",
|
|
44
50
|
"eslint-plugin-react": "^7.34.1",
|
|
51
|
+
"eslint-plugin-react-compiler": "0.0.0-experimental-c8b3f72-20240517",
|
|
45
52
|
"eslint-plugin-react-hooks": "4.6.2",
|
|
46
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
47
|
-
"eslint-plugin-tailwindcss": "^3.15.2",
|
|
53
|
+
"eslint-plugin-react-refresh": "^0.4.7",
|
|
48
54
|
"eslint-plugin-toml": "^0.11.0",
|
|
49
|
-
"eslint-plugin-unicorn": "^
|
|
55
|
+
"eslint-plugin-unicorn": "^53.0.0",
|
|
50
56
|
"eslint-plugin-unused-imports": "^3.2.0",
|
|
51
57
|
"eslint-plugin-vitest": "^0.5.4",
|
|
52
|
-
"eslint-plugin-vue": "^9.
|
|
58
|
+
"eslint-plugin-vue": "^9.26.0",
|
|
53
59
|
"eslint-plugin-yml": "^1.14.0",
|
|
54
|
-
"globals": "^15.
|
|
60
|
+
"globals": "^15.2.0",
|
|
55
61
|
"jsonc-eslint-parser": "^2.4.0",
|
|
56
62
|
"prettier": "^3.2.5",
|
|
57
|
-
"prettier-plugin-tailwindcss": "^0.5.14",
|
|
58
63
|
"toml-eslint-parser": "^0.9.3",
|
|
59
64
|
"vue-eslint-parser": "^9.4.2",
|
|
60
65
|
"yaml-eslint-parser": "^1.2.2"
|
|
@@ -62,11 +67,12 @@
|
|
|
62
67
|
"devDependencies": {
|
|
63
68
|
"@eslint/config-inspector": "^0.4.8",
|
|
64
69
|
"@types/eslint": "^8.56.10",
|
|
65
|
-
"@types/node": "^20.12.
|
|
66
|
-
"@types/react": "^18.3.
|
|
70
|
+
"@types/node": "^20.12.12",
|
|
71
|
+
"@types/react": "^18.3.2",
|
|
67
72
|
"bumpp": "^9.4.1",
|
|
68
73
|
"eslint": "^8.57.0",
|
|
69
|
-
"
|
|
74
|
+
"eslint-plugin-tailwindcss": "^3.15.2",
|
|
75
|
+
"execa": "^9.1.0",
|
|
70
76
|
"fast-glob": "^3.3.2",
|
|
71
77
|
"fs-extra": "^11.2.0",
|
|
72
78
|
"react": "^18.3.1",
|