@jsse/eslint-config 0.3.7 → 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 +16 -0
- package/dist/cli.js +3 -3
- package/dist/esm/config-fns.d.ts +114 -34
- package/dist/esm/config-fns.js +117 -35
- package/dist/esm/configs/{comments.d.ts → de-morgan.d.ts} +1 -1
- package/dist/esm/configs/de-morgan.js +9 -0
- package/dist/esm/configs/eslint-comments.d.ts +2 -0
- package/dist/esm/configs/{comments.js → eslint-comments.js} +1 -1
- package/dist/esm/configs/gql.d.ts +2 -2
- package/dist/esm/configs/markdown.js +1 -1
- package/dist/esm/configs/pnpm.d.ts +2 -0
- package/dist/esm/configs/pnpm.js +34 -0
- package/dist/esm/configs/prettier.d.ts +2 -2
- package/dist/esm/configs/react.d.ts +3 -3
- package/dist/esm/configs/stylistic.js +1 -1
- package/dist/esm/configs/tailwind.d.ts +1 -2
- package/dist/esm/configs/tailwind.js +81 -48
- package/dist/esm/configs/ts/parser.d.ts +2 -2
- package/dist/esm/configs/ts/parser.js +7 -5
- package/dist/esm/configs/ts/typescript-rules.d.ts +9 -4
- package/dist/esm/configs/ts/typescript-rules.js +26 -62
- package/dist/esm/configs/ts/typescript.js +56 -43
- package/dist/esm/define-config.d.ts +3 -3
- package/dist/esm/define-config.js +47 -28
- package/dist/esm/fixable.d.ts +2 -1
- package/dist/esm/fixable.js +3 -395
- package/dist/esm/generated/fixable-rules-map.d.ts +2 -0
- package/dist/esm/generated/fixable-rules-map.js +443 -0
- package/dist/esm/generated/version.d.ts +1 -1
- package/dist/esm/generated/version.js +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/lager.d.ts +1 -1
- package/dist/esm/lager.js +1 -1
- package/dist/esm/plugins-all.d.ts +11 -8
- package/dist/esm/plugins-all.js +103 -10
- package/dist/esm/plugins.d.ts +2 -6
- package/dist/esm/plugins.js +2 -16
- package/dist/esm/presets.d.ts +16 -0
- package/dist/esm/presets.js +65 -2
- package/dist/esm/types.d.ts +47 -22
- package/dist/esm/utils.d.ts +5 -5
- package/dist/esm/utils.js +1 -1
- package/dist/index.d.ts +3907 -2560
- package/dist/index.js +275 -751
- package/package.json +29 -37
- package/dist/esm/plugindex.d.ts +0 -7
- package/dist/esm/plugindex.js +0 -60
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @jsse/eslint-config
|
|
2
2
|
|
|
3
|
+
## 0.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- added eslint-plugin-pnpm
|
|
8
|
+
|
|
9
|
+
## 0.4.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 7751e66: removed tailwind support
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- e15fd48: re-orged several things. fixed type aware lints
|
|
18
|
+
|
|
3
19
|
## 0.3.7
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/cli.ts
|
|
2
|
-
import fs from "
|
|
3
|
-
import process2 from "
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import process2 from "process";
|
|
4
4
|
|
|
5
5
|
// node_modules/.pnpm/cac@6.7.14/node_modules/cac/dist/index.mjs
|
|
6
6
|
import { EventEmitter } from "events";
|
|
@@ -588,7 +588,7 @@ var CAC = class extends EventEmitter {
|
|
|
588
588
|
var cac = (name = "") => new CAC(name);
|
|
589
589
|
|
|
590
590
|
// src/generated/version.ts
|
|
591
|
-
var VERSION = "0.
|
|
591
|
+
var VERSION = "0.4.1";
|
|
592
592
|
|
|
593
593
|
// src/cli.ts
|
|
594
594
|
var cli = cac("jsselint");
|
package/dist/esm/config-fns.d.ts
CHANGED
|
@@ -1,40 +1,120 @@
|
|
|
1
1
|
import { reactHooks } from "./configs/react.js";
|
|
2
|
-
export declare
|
|
3
|
-
antfu:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
2
|
+
export declare const CONFIGS_MAPPING: {
|
|
3
|
+
antfu: {
|
|
4
|
+
fn: import("./types.js").EslintConfigFn<{
|
|
5
|
+
topLevelFunction: "error" | "off";
|
|
6
|
+
}>;
|
|
7
|
+
typeName: string;
|
|
8
|
+
};
|
|
9
|
+
command: {
|
|
10
|
+
fn: import("./types.js").EslintConfigFn;
|
|
11
|
+
typeName: string;
|
|
12
|
+
};
|
|
13
|
+
"de-morgan": {
|
|
14
|
+
fn: import("./types.js").EslintConfigFn;
|
|
15
|
+
typeName: string;
|
|
16
|
+
};
|
|
17
|
+
"eslint-comments": {
|
|
18
|
+
fn: import("./types.js").EslintConfigFn;
|
|
19
|
+
typeName: string;
|
|
20
|
+
};
|
|
21
|
+
ignores: {
|
|
22
|
+
fn: import("./types.js").EslintConfigFn;
|
|
23
|
+
typeName: string;
|
|
24
|
+
};
|
|
25
|
+
imports: {
|
|
26
|
+
fn: import("./types.js").EslintConfigFn<import("./types.js").OptionsStylistic>;
|
|
27
|
+
typeName: string;
|
|
28
|
+
};
|
|
29
|
+
javascript: {
|
|
30
|
+
fn: import("./types.js").EslintConfigFn<import("./types.js").OptionsIsInEditor & import("./types.js").OptionsOverrides & {
|
|
31
|
+
reportUnusedDisableDirectives?: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
typeName: string;
|
|
34
|
+
};
|
|
35
|
+
jsdoc: {
|
|
36
|
+
fn: import("./types.js").EslintConfigFn;
|
|
37
|
+
typeName: string;
|
|
38
|
+
};
|
|
39
|
+
jsonc: {
|
|
40
|
+
fn: import("./types.js").EslintConfigFn<import("./types.js").OptionsStylistic & import("./types.js").OptionsOverrides>;
|
|
41
|
+
typeName: string;
|
|
42
|
+
};
|
|
43
|
+
markdown: {
|
|
44
|
+
fn: import("./types.js").EslintConfigFn<import("./types.js").OptionsComponentExts & import("./types.js").OptionsOverrides>;
|
|
45
|
+
typeName: string;
|
|
46
|
+
};
|
|
47
|
+
n: {
|
|
48
|
+
fn: import("./types.js").EslintConfigFn;
|
|
49
|
+
typeName: string;
|
|
50
|
+
};
|
|
51
|
+
"no-only-tests": {
|
|
52
|
+
fn: import("./types.js").EslintConfigFn<import("./types.js").OptionsIsInEditor & import("./types.js").OptionsOverrides>;
|
|
53
|
+
typeName: string;
|
|
54
|
+
};
|
|
55
|
+
perfectionist: {
|
|
56
|
+
fn: import("./types.js").EslintConfigFn;
|
|
57
|
+
typeName: string;
|
|
58
|
+
};
|
|
59
|
+
pnpm: {
|
|
60
|
+
fn: import("./types.js").EslintConfigFn;
|
|
61
|
+
typeName: string;
|
|
62
|
+
};
|
|
63
|
+
prettier: {
|
|
64
|
+
fn: import("./types.js").EslintConfigFn;
|
|
65
|
+
typeName: string;
|
|
66
|
+
};
|
|
67
|
+
react: {
|
|
68
|
+
fn: import("./types.js").EslintConfigFn<import("./types.js").OptionsComponentExts & import("./types.js").OptionsOverrides & import("./types.js").OptionsTypeScriptWithTypes & import("./types.js").OptionsTypeScriptParserOptions & import("./types.js").OptionsReact>;
|
|
69
|
+
typeName: string;
|
|
70
|
+
};
|
|
71
|
+
"react-hooks": {
|
|
72
|
+
fn: typeof reactHooks;
|
|
73
|
+
typeName: string;
|
|
74
|
+
};
|
|
75
|
+
"sort-package-json": {
|
|
76
|
+
fn: import("./types.js").EslintConfigFn;
|
|
77
|
+
typeName: string;
|
|
78
|
+
};
|
|
79
|
+
"sort-tsconfig": {
|
|
80
|
+
fn: import("./types.js").EslintConfigFn<{
|
|
81
|
+
extendTsconfigGlobs?: string[];
|
|
82
|
+
}>;
|
|
83
|
+
typeName: string;
|
|
84
|
+
};
|
|
85
|
+
stylistic: {
|
|
86
|
+
fn: import("./types.js").EslintConfigFn<import("./types.js").StylisticConfig>;
|
|
87
|
+
typeName: string;
|
|
88
|
+
};
|
|
89
|
+
toml: {
|
|
90
|
+
fn: import("./types.js").EslintConfigFn<import("./types.js").OptionsOverrides & import("./types.js").OptionsFiles & import("./types.js").OptionsStylistic>;
|
|
91
|
+
typeName: string;
|
|
92
|
+
};
|
|
93
|
+
tsdoc: {
|
|
94
|
+
fn: import("./types.js").EslintConfigFn;
|
|
95
|
+
typeName: string;
|
|
96
|
+
};
|
|
97
|
+
typescript: {
|
|
98
|
+
fn: import("./types.js").EslintConfigFn<import("./types.js").OptionsComponentExts & import("./types.js").OptionsOverrides & import("./types.js").OptionsTypeScriptWithTypes & import("./types.js").OptionsTypeScriptParserOptions & import("./types.js").OptionsReact & import("./types.js").OptionsPrefix>;
|
|
99
|
+
typeName: string;
|
|
100
|
+
};
|
|
101
|
+
unicorn: {
|
|
102
|
+
fn: import("./types.js").EslintConfigFn;
|
|
103
|
+
typeName: string;
|
|
104
|
+
};
|
|
105
|
+
vitest: {
|
|
106
|
+
fn: import("./types.js").EslintConfigFn<import("./types.js").OptionsIsInEditor & import("./types.js").OptionsOverrides>;
|
|
107
|
+
typeName: string;
|
|
108
|
+
};
|
|
109
|
+
yml: {
|
|
110
|
+
fn: import("./types.js").EslintConfigFn<import("./types.js").OptionsOverrides & import("./types.js").OptionsStylistic & import("./types.js").OptionsFiles>;
|
|
111
|
+
typeName: string;
|
|
112
|
+
};
|
|
34
113
|
};
|
|
35
114
|
export { antfu } from "./configs/antfu.js";
|
|
36
115
|
export { command } from "./configs/command.js";
|
|
37
|
-
export {
|
|
116
|
+
export { deMorgan } from "./configs/de-morgan.js";
|
|
117
|
+
export { eslintComments } from "./configs/eslint-comments.js";
|
|
38
118
|
export { ignores } from "./configs/ignores.js";
|
|
39
119
|
export { imports } from "./configs/imports.js";
|
|
40
120
|
export { javascript } from "./configs/javascript.js";
|
|
@@ -44,12 +124,12 @@ export { markdown } from "./configs/markdown.js";
|
|
|
44
124
|
export { n } from "./configs/n.js";
|
|
45
125
|
export { noOnlyTests } from "./configs/no-only-tests.js";
|
|
46
126
|
export { perfectionist } from "./configs/perfectionist.js";
|
|
127
|
+
export { pnpm } from "./configs/pnpm.js";
|
|
47
128
|
export { prettier } from "./configs/prettier.js";
|
|
48
129
|
export { react, reactHooks } from "./configs/react.js";
|
|
49
130
|
export { sortPackageJson } from "./configs/sort-package-json.js";
|
|
50
131
|
export { sortTsconfig } from "./configs/sort-tsconfig.js";
|
|
51
132
|
export { stylistic } from "./configs/stylistic.js";
|
|
52
|
-
export { tailwind } from "./configs/tailwind.js";
|
|
53
133
|
export { toml } from "./configs/toml.js";
|
|
54
134
|
export { typescript } from "./configs/ts/typescript.js";
|
|
55
135
|
export { tsdoc } from "./configs/tsdoc.js";
|
package/dist/esm/config-fns.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { antfu } from "./configs/antfu.js";
|
|
2
2
|
import { command } from "./configs/command.js";
|
|
3
|
-
import {
|
|
3
|
+
import { deMorgan } from "./configs/de-morgan.js";
|
|
4
|
+
import { eslintComments } from "./configs/eslint-comments.js";
|
|
4
5
|
import { ignores } from "./configs/ignores.js";
|
|
5
6
|
import { imports } from "./configs/imports.js";
|
|
6
7
|
import { javascript } from "./configs/javascript.js";
|
|
@@ -10,52 +11,133 @@ import { markdown } from "./configs/markdown.js";
|
|
|
10
11
|
import { n } from "./configs/n.js";
|
|
11
12
|
import { noOnlyTests } from "./configs/no-only-tests.js";
|
|
12
13
|
import { perfectionist } from "./configs/perfectionist.js";
|
|
14
|
+
import { pnpm } from "./configs/pnpm.js";
|
|
13
15
|
import { prettier } from "./configs/prettier.js";
|
|
14
16
|
import { react, reactHooks } from "./configs/react.js";
|
|
15
17
|
import { sortPackageJson } from "./configs/sort-package-json.js";
|
|
16
18
|
import { sortTsconfig } from "./configs/sort-tsconfig.js";
|
|
17
19
|
import { stylistic } from "./configs/stylistic.js";
|
|
18
|
-
import { tailwind } from "./configs/tailwind.js";
|
|
19
20
|
import { toml } from "./configs/toml.js";
|
|
20
21
|
import { typescript } from "./configs/ts/typescript.js";
|
|
21
22
|
import { tsdoc } from "./configs/tsdoc.js";
|
|
22
23
|
import { unicorn } from "./configs/unicorn.js";
|
|
23
24
|
import { vitest } from "./configs/vitest.js";
|
|
24
25
|
import { yml } from "./configs/yml.js";
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
26
|
+
export const CONFIGS_MAPPING = {
|
|
27
|
+
antfu: {
|
|
28
|
+
fn: antfu,
|
|
29
|
+
typeName: "AntfuRuleOptions",
|
|
30
|
+
},
|
|
31
|
+
command: {
|
|
32
|
+
fn: command,
|
|
33
|
+
typeName: "CommandRuleOptions",
|
|
34
|
+
},
|
|
35
|
+
"de-morgan": {
|
|
36
|
+
fn: deMorgan,
|
|
37
|
+
typeName: "DeMorganRuleOptions",
|
|
38
|
+
},
|
|
39
|
+
"eslint-comments": {
|
|
40
|
+
fn: eslintComments,
|
|
41
|
+
typeName: "EslintCommentsRuleOptions",
|
|
42
|
+
},
|
|
43
|
+
ignores: {
|
|
44
|
+
fn: ignores,
|
|
45
|
+
typeName: "IgnoresRuleOptions",
|
|
46
|
+
},
|
|
47
|
+
imports: {
|
|
48
|
+
fn: imports,
|
|
49
|
+
typeName: "ImportsRuleOptions",
|
|
50
|
+
},
|
|
51
|
+
javascript: {
|
|
52
|
+
fn: javascript,
|
|
53
|
+
typeName: "JavascriptRuleOptions",
|
|
54
|
+
},
|
|
55
|
+
jsdoc: {
|
|
56
|
+
fn: jsdoc,
|
|
57
|
+
typeName: "JsdocRuleOptions",
|
|
58
|
+
},
|
|
59
|
+
jsonc: {
|
|
60
|
+
fn: jsonc,
|
|
61
|
+
typeName: "JsoncRuleOptions",
|
|
62
|
+
},
|
|
63
|
+
markdown: {
|
|
64
|
+
fn: markdown,
|
|
65
|
+
typeName: "MarkdownRuleOptions",
|
|
66
|
+
},
|
|
67
|
+
n: {
|
|
68
|
+
fn: n,
|
|
69
|
+
typeName: "NRuleOptions",
|
|
70
|
+
},
|
|
71
|
+
"no-only-tests": {
|
|
72
|
+
fn: noOnlyTests,
|
|
73
|
+
typeName: "NoOnlyTestsRuleOptions",
|
|
74
|
+
},
|
|
75
|
+
perfectionist: {
|
|
76
|
+
fn: perfectionist,
|
|
77
|
+
typeName: "PerfectionistRuleOptions",
|
|
78
|
+
},
|
|
79
|
+
pnpm: {
|
|
80
|
+
fn: pnpm,
|
|
81
|
+
typeName: "PnpmRuleOptions",
|
|
82
|
+
},
|
|
83
|
+
prettier: {
|
|
84
|
+
fn: prettier,
|
|
85
|
+
typeName: "PrettierRuleOptions",
|
|
86
|
+
},
|
|
87
|
+
react: {
|
|
88
|
+
fn: react,
|
|
89
|
+
typeName: "ReactRuleOptions",
|
|
90
|
+
},
|
|
91
|
+
"react-hooks": {
|
|
92
|
+
fn: reactHooks,
|
|
93
|
+
typeName: "ReactHooksRuleOptions",
|
|
94
|
+
},
|
|
95
|
+
"sort-package-json": {
|
|
96
|
+
fn: sortPackageJson,
|
|
97
|
+
typeName: "SortPackageJsonRuleOptions",
|
|
98
|
+
},
|
|
99
|
+
"sort-tsconfig": {
|
|
100
|
+
fn: sortTsconfig,
|
|
101
|
+
typeName: "SortTsconfigRuleOptions",
|
|
102
|
+
},
|
|
103
|
+
stylistic: {
|
|
104
|
+
fn: stylistic,
|
|
105
|
+
typeName: "StylisticRuleOptions",
|
|
106
|
+
},
|
|
107
|
+
toml: {
|
|
108
|
+
fn: toml,
|
|
109
|
+
typeName: "TomlRuleOptions",
|
|
110
|
+
},
|
|
111
|
+
tsdoc: {
|
|
112
|
+
fn: tsdoc,
|
|
113
|
+
typeName: "TsdocRuleOptions",
|
|
114
|
+
},
|
|
115
|
+
// deprecated
|
|
116
|
+
// tailwind: {
|
|
117
|
+
// typeName: "TailwindRuleOptions",
|
|
118
|
+
// fn: tailwind,
|
|
119
|
+
// },
|
|
120
|
+
typescript: {
|
|
121
|
+
fn: typescript,
|
|
122
|
+
typeName: "TypescriptRuleOptions",
|
|
123
|
+
},
|
|
124
|
+
unicorn: {
|
|
125
|
+
fn: unicorn,
|
|
126
|
+
typeName: "UnicornRuleOptions",
|
|
127
|
+
},
|
|
128
|
+
vitest: {
|
|
129
|
+
fn: vitest,
|
|
130
|
+
typeName: "VitestRuleOptions",
|
|
131
|
+
},
|
|
132
|
+
yml: {
|
|
133
|
+
fn: yml,
|
|
134
|
+
typeName: "YmlRuleOptions",
|
|
135
|
+
},
|
|
136
|
+
};
|
|
56
137
|
export { antfu } from "./configs/antfu.js";
|
|
57
138
|
export { command } from "./configs/command.js";
|
|
58
|
-
export {
|
|
139
|
+
export { deMorgan } from "./configs/de-morgan.js";
|
|
140
|
+
export { eslintComments } from "./configs/eslint-comments.js";
|
|
59
141
|
export { ignores } from "./configs/ignores.js";
|
|
60
142
|
export { imports } from "./configs/imports.js";
|
|
61
143
|
export { javascript } from "./configs/javascript.js";
|
|
@@ -65,12 +147,12 @@ export { markdown } from "./configs/markdown.js";
|
|
|
65
147
|
export { n } from "./configs/n.js";
|
|
66
148
|
export { noOnlyTests } from "./configs/no-only-tests.js";
|
|
67
149
|
export { perfectionist } from "./configs/perfectionist.js";
|
|
150
|
+
export { pnpm } from "./configs/pnpm.js";
|
|
68
151
|
export { prettier } from "./configs/prettier.js";
|
|
69
152
|
export { react, reactHooks } from "./configs/react.js";
|
|
70
153
|
export { sortPackageJson } from "./configs/sort-package-json.js";
|
|
71
154
|
export { sortTsconfig } from "./configs/sort-tsconfig.js";
|
|
72
155
|
export { stylistic } from "./configs/stylistic.js";
|
|
73
|
-
export { tailwind } from "./configs/tailwind.js";
|
|
74
156
|
export { toml } from "./configs/toml.js";
|
|
75
157
|
export { typescript } from "./configs/ts/typescript.js";
|
|
76
158
|
export { tsdoc } from "./configs/tsdoc.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { EslintConfigFn } from "../types.js";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const deMorgan: EslintConfigFn;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function gql():
|
|
1
|
+
import type { Config } from "src/types.js";
|
|
2
|
+
export declare function gql(): Config[];
|
|
@@ -18,7 +18,7 @@ export const markdown = async (options) => {
|
|
|
18
18
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
19
19
|
pluginMarkdown.processors.markdown,
|
|
20
20
|
processorPassThrough,
|
|
21
|
-
]
|
|
21
|
+
]);
|
|
22
22
|
return [
|
|
23
23
|
{
|
|
24
24
|
name: "jsse/markdown/setup",
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { pluginPnpm } from "../plugins.js";
|
|
2
|
+
export const pnpm = async () => {
|
|
3
|
+
return [
|
|
4
|
+
{
|
|
5
|
+
files: ["package.json", "**/package.json"],
|
|
6
|
+
languageOptions: {
|
|
7
|
+
parser: await import("jsonc-eslint-parser"),
|
|
8
|
+
},
|
|
9
|
+
name: "jsse/pnpm/package-json",
|
|
10
|
+
plugins: {
|
|
11
|
+
pnpm: pluginPnpm,
|
|
12
|
+
},
|
|
13
|
+
rules: {
|
|
14
|
+
"pnpm/json-enforce-catalog": "error",
|
|
15
|
+
"pnpm/json-prefer-workspace-settings": "error",
|
|
16
|
+
"pnpm/json-valid-catalog": "error",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
files: ["pnpm-workspace.yaml"],
|
|
21
|
+
languageOptions: {
|
|
22
|
+
parser: await import("yaml-eslint-parser"),
|
|
23
|
+
},
|
|
24
|
+
name: "jsse/pnpm/pnpm-workspace-yaml",
|
|
25
|
+
plugins: {
|
|
26
|
+
pnpm: pluginPnpm,
|
|
27
|
+
},
|
|
28
|
+
rules: {
|
|
29
|
+
"pnpm/yaml-no-duplicate-catalog-item": "error",
|
|
30
|
+
"pnpm/yaml-no-unused-catalog-item": "error",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Config, EslintConfigFn } from "../types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Copied from https://raw.githubusercontent.com/prettier/eslint-config-prettier/main/index.js
|
|
4
4
|
* Main difference is we exclude rules we don't care about.... (flow/babel/etc)
|
|
5
5
|
*/
|
|
6
|
-
export declare function eslintConfigPrettierRules():
|
|
6
|
+
export declare function eslintConfigPrettierRules(): Config["rules"];
|
|
7
7
|
export declare const prettier: EslintConfigFn;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { EslintConfigFn, OptionsComponentExts, OptionsOverrides, OptionsReact, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes
|
|
2
|
-
export declare function reactRules():
|
|
3
|
-
export declare function reactHooks(): Promise<
|
|
1
|
+
import type { Config, EslintConfigFn, OptionsComponentExts, OptionsOverrides, OptionsReact, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes } from "../types.js";
|
|
2
|
+
export declare function reactRules(): Config["rules"];
|
|
3
|
+
export declare function reactHooks(): Promise<Config[]>;
|
|
4
4
|
type ReactOptions = OptionsComponentExts & OptionsOverrides & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & OptionsReact;
|
|
5
5
|
export declare const react: EslintConfigFn<ReactOptions>;
|
|
6
6
|
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const tailwind: EslintConfigFn<Partial<TailwindEslintSettings>>;
|
|
1
|
+
export {};
|
|
@@ -1,48 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
};
|
|
1
|
+
/* eslint-disable unicorn/no-empty-file */
|
|
2
|
+
// import { err, ok } from "neverthrow";
|
|
3
|
+
// import type {
|
|
4
|
+
// EslintConfigFn,
|
|
5
|
+
// TailwindEslintSettings,
|
|
6
|
+
// TailwindOptions,
|
|
7
|
+
// } from "../types.js";
|
|
8
|
+
// import { GLOB_SRC } from "../globs.js";
|
|
9
|
+
// import { log } from "../log.js";
|
|
10
|
+
// import { interopDefault } from "../utils.js";
|
|
11
|
+
export {};
|
|
12
|
+
// async function importPluginTailwind() {
|
|
13
|
+
// // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
14
|
+
// const pluginTailwind = await interopDefault(
|
|
15
|
+
// // @ts-expect-error - bad types
|
|
16
|
+
// import("eslint-plugin-tailwindcss"),
|
|
17
|
+
// );
|
|
18
|
+
// // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
19
|
+
// return { pluginTailwind };
|
|
20
|
+
// }
|
|
21
|
+
// async function safeImportPluginTailwind() {
|
|
22
|
+
// try {
|
|
23
|
+
// const plugin = await importPluginTailwind();
|
|
24
|
+
// return ok(plugin);
|
|
25
|
+
// } catch (e: unknown) {
|
|
26
|
+
// const msg =
|
|
27
|
+
// (e instanceof Error ? e.message : String(e)) ||
|
|
28
|
+
// `unknown error ${String(e)}`;
|
|
29
|
+
// return err(new Error(msg));
|
|
30
|
+
// }
|
|
31
|
+
// }
|
|
32
|
+
// const TAILWIND_ESLINT_SETTINGS_DEFAULT: TailwindEslintSettings = {
|
|
33
|
+
// // These are the default values but feel free to customize
|
|
34
|
+
// callees: ["classnames", "clsx", "ctl", "cn", "cx", "twMerge", "twJoin"],
|
|
35
|
+
// classRegex: "^class(Name)?$", // can be modified to support custom attributes. E.g. "^tw$" for `twin.macro`
|
|
36
|
+
// config: "tailwind.config.js", // returned from `loadConfig()` utility if not provided
|
|
37
|
+
// cssFiles: ["**/*.css", "!**/node_modules", "!**/.*", "!**/dist", "!**/build"],
|
|
38
|
+
// cssFilesRefreshRate: 5000,
|
|
39
|
+
// removeDuplicates: true,
|
|
40
|
+
// skipClassAttribute: false,
|
|
41
|
+
// tags: [], // can be set to e.g. ['tw'] for use in tw`bg-blue`
|
|
42
|
+
// whitelist: [],
|
|
43
|
+
// };
|
|
44
|
+
// function tailwindSettings(options?: TailwindOptions): TailwindEslintSettings {
|
|
45
|
+
// if (typeof options === "boolean") {
|
|
46
|
+
// return TAILWIND_ESLINT_SETTINGS_DEFAULT;
|
|
47
|
+
// }
|
|
48
|
+
// return { ...TAILWIND_ESLINT_SETTINGS_DEFAULT, ...options };
|
|
49
|
+
// }
|
|
50
|
+
// export const tailwind: EslintConfigFn<Partial<TailwindEslintSettings>> = async (
|
|
51
|
+
// options,
|
|
52
|
+
// ) => {
|
|
53
|
+
// // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
54
|
+
// const importResult = await safeImportPluginTailwind();
|
|
55
|
+
// return importResult.match(
|
|
56
|
+
// ({ pluginTailwind }) => {
|
|
57
|
+
// return [
|
|
58
|
+
// {
|
|
59
|
+
// files: [GLOB_SRC],
|
|
60
|
+
// name: "jsse/tailwind/rules",
|
|
61
|
+
// plugins: {
|
|
62
|
+
// // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
63
|
+
// tailwindcss: pluginTailwind,
|
|
64
|
+
// },
|
|
65
|
+
// // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
66
|
+
// rules: {
|
|
67
|
+
// // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
68
|
+
// ...pluginTailwind.configs.recommended.rules,
|
|
69
|
+
// },
|
|
70
|
+
// settings: {
|
|
71
|
+
// tailwindcss: tailwindSettings(options),
|
|
72
|
+
// },
|
|
73
|
+
// },
|
|
74
|
+
// ];
|
|
75
|
+
// },
|
|
76
|
+
// (error) => {
|
|
77
|
+
// log.error(error.message);
|
|
78
|
+
// return [];
|
|
79
|
+
// },
|
|
80
|
+
// );
|
|
81
|
+
// };
|