@jsse/eslint-config 0.4.0 → 0.4.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/CHANGELOG.md +6 -0
- package/dist/cli.js +1 -1
- package/dist/esm/config-fns.d.ts +5 -0
- package/dist/esm/config-fns.js +6 -0
- package/dist/esm/configs/pnpm.d.ts +2 -0
- package/dist/esm/configs/pnpm.js +34 -0
- package/dist/esm/configs/tailwind.d.ts +1 -2
- package/dist/esm/configs/tailwind.js +81 -48
- package/dist/esm/define-config.js +11 -2
- package/dist/esm/fixable.d.ts +1 -1
- package/dist/esm/generated/fixable-rules-map.js +8 -1
- package/dist/esm/generated/version.d.ts +1 -1
- package/dist/esm/generated/version.js +1 -1
- package/dist/esm/plugins-all.d.ts +1 -1
- package/dist/esm/plugins-all.js +6 -2
- package/dist/esm/plugins.d.ts +1 -6
- package/dist/esm/plugins.js +1 -18
- package/dist/esm/presets.js +0 -32
- package/dist/esm/types.d.ts +13 -0
- package/dist/index.d.ts +405 -159
- package/dist/index.js +99 -637
- package/package.json +23 -24
package/dist/esm/plugins.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { err, ok } from "neverthrow";
|
|
2
1
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment,@typescript-eslint/explicit-function-return-type */
|
|
3
2
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
4
3
|
// @ts-nocheck
|
|
@@ -12,6 +11,7 @@ export { default as pluginDeMorgan } from "eslint-plugin-de-morgan";
|
|
|
12
11
|
export * as pluginImport from "eslint-plugin-import-x";
|
|
13
12
|
export { default as pluginN } from "eslint-plugin-n";
|
|
14
13
|
export { default as pluginPerfectionist } from "eslint-plugin-perfectionist";
|
|
14
|
+
export { default as pluginPnpm } from "eslint-plugin-pnpm";
|
|
15
15
|
export { default as pluginUnicorn } from "eslint-plugin-unicorn";
|
|
16
16
|
export { default as pluginUnusedImports } from "eslint-plugin-unused-imports";
|
|
17
17
|
export async function importPluginUnicorn() {
|
|
@@ -95,20 +95,3 @@ export async function importPluginStylistic() {
|
|
|
95
95
|
const pluginStylistic = await interopDefault(import("@stylistic/eslint-plugin"));
|
|
96
96
|
return { pluginStylistic };
|
|
97
97
|
}
|
|
98
|
-
export async function importPluginTailwind() {
|
|
99
|
-
const pluginTailwind = await interopDefault(
|
|
100
|
-
// @ts-expect-error - bad types
|
|
101
|
-
import("eslint-plugin-tailwindcss"));
|
|
102
|
-
return { pluginTailwind };
|
|
103
|
-
}
|
|
104
|
-
export async function safeImportPluginTailwind() {
|
|
105
|
-
try {
|
|
106
|
-
const plugin = await importPluginTailwind();
|
|
107
|
-
return ok(plugin);
|
|
108
|
-
}
|
|
109
|
-
catch (e) {
|
|
110
|
-
const msg = (e instanceof Error ? e.message : String(e)) ||
|
|
111
|
-
`unknown error ${String(e)}`;
|
|
112
|
-
return err(new Error(msg));
|
|
113
|
-
}
|
|
114
|
-
}
|
package/dist/esm/presets.js
CHANGED
|
@@ -30,7 +30,6 @@ export const jsseReact = (options, ...configs) => {
|
|
|
30
30
|
return jsse({
|
|
31
31
|
react: true,
|
|
32
32
|
reactRefresh: true,
|
|
33
|
-
tailwind: true,
|
|
34
33
|
typescript: {
|
|
35
34
|
tsconfig: ["./tsconfig.json", "./tsconfig.eslint.json"],
|
|
36
35
|
},
|
|
@@ -50,32 +49,6 @@ export const presetJavascript = makePresetFn([
|
|
|
50
49
|
jsdoc,
|
|
51
50
|
deMorgan,
|
|
52
51
|
]);
|
|
53
|
-
// export const presetJavaScript = async (): Promise<Config[]> => {
|
|
54
|
-
// const promises = [
|
|
55
|
-
// ignores(),
|
|
56
|
-
// javascript(),
|
|
57
|
-
// comments(),
|
|
58
|
-
// imports(),
|
|
59
|
-
// unicorn(),
|
|
60
|
-
// n(),
|
|
61
|
-
// jsdoc(),
|
|
62
|
-
// deMorgan(),
|
|
63
|
-
// ];
|
|
64
|
-
//
|
|
65
|
-
// const r = await Promise.allSettled(promises);
|
|
66
|
-
//
|
|
67
|
-
// const ok = [];
|
|
68
|
-
// const err = [];
|
|
69
|
-
// for (const p of r) {
|
|
70
|
-
// if (p.status === "fulfilled") {
|
|
71
|
-
// ok.push(...p.value);
|
|
72
|
-
// } else {
|
|
73
|
-
// err.push(p.reason);
|
|
74
|
-
// }
|
|
75
|
-
// }
|
|
76
|
-
//
|
|
77
|
-
// return ok;
|
|
78
|
-
// };
|
|
79
52
|
/** Includes basic json(c) file support and sorting json keys */
|
|
80
53
|
const presetJsonc = makePresetFn([
|
|
81
54
|
jsonc,
|
|
@@ -87,11 +60,6 @@ const presetJsonc = makePresetFn([
|
|
|
87
60
|
export const presetLangsExtensions = makePresetFn([markdown, yml, presetJsonc]);
|
|
88
61
|
/** Includes `presetJavaScript` and typescript support */
|
|
89
62
|
export const presetBasic = makePresetFn([presetJavascript, typescript]);
|
|
90
|
-
// Config[] => [
|
|
91
|
-
// presetJavaScript(),
|
|
92
|
-
// typescript(),
|
|
93
|
-
// // ...sortImports(),
|
|
94
|
-
// ];
|
|
95
63
|
/**
|
|
96
64
|
* Includes
|
|
97
65
|
* - `presetBasic` (JS+TS) support
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -173,6 +173,19 @@ export type OptionsConfig = {
|
|
|
173
173
|
* PLUGIN!.
|
|
174
174
|
*/
|
|
175
175
|
prettier?: boolean;
|
|
176
|
+
/**
|
|
177
|
+
* Enable eslint-plugin-pnpm.
|
|
178
|
+
*
|
|
179
|
+
* @default false
|
|
180
|
+
*/
|
|
181
|
+
pnpm?: boolean;
|
|
182
|
+
/**
|
|
183
|
+
* Enable Tailwind CSS support.
|
|
184
|
+
*
|
|
185
|
+
* Passing an object to configure the options.
|
|
186
|
+
*
|
|
187
|
+
* @default true
|
|
188
|
+
*/
|
|
176
189
|
tailwind?: TailwindOptions;
|
|
177
190
|
/**
|
|
178
191
|
* The prefix for the name of the config item.
|