@jsse/eslint-config 0.3.6 → 0.4.0
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/README.md +17 -12
- package/dist/cli.js +3 -3
- package/dist/esm/config-fns.d.ts +109 -34
- package/dist/esm/config-fns.js +111 -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/prettier.d.ts +2 -2
- package/dist/esm/configs/react.d.ts +3 -3
- package/dist/esm/configs/sort-package-json.js +19 -6
- package/dist/esm/configs/stylistic.js +1 -1
- package/dist/esm/configs/ts/parser.d.ts +2 -2
- package/dist/esm/configs/ts/parser.js +7 -5
- package/dist/esm/configs/ts/requires-type-checking.js +1 -0
- 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 +38 -28
- package/dist/esm/fixable.d.ts +2 -1
- package/dist/esm/fixable.js +3 -391
- package/dist/esm/generated/fixable-rules-map.d.ts +2 -0
- package/dist/esm/generated/fixable-rules-map.js +436 -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 +99 -10
- package/dist/esm/plugins.d.ts +1 -0
- package/dist/esm/plugins.js +4 -1
- package/dist/esm/presets.d.ts +16 -0
- package/dist/esm/presets.js +96 -1
- package/dist/esm/types.d.ts +34 -22
- package/dist/esm/utils.d.ts +5 -5
- package/dist/esm/utils.js +1 -1
- package/dist/index.d.ts +7445 -6300
- package/dist/index.js +373 -238
- package/package.json +23 -30
- 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.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 7751e66: removed tailwind support
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- e15fd48: re-orged several things. fixed type aware lints
|
|
12
|
+
|
|
13
|
+
## 0.3.7
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- b9b98b1: update sorting package json
|
|
18
|
+
|
|
3
19
|
## 0.3.6
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -7,7 +7,8 @@ Eslint config
|
|
|
7
7
|
- eslint flat config
|
|
8
8
|
- double quotes + semi
|
|
9
9
|
- react, react-hooks & react-refresh, OH MY!
|
|
10
|
-
- no vue (I don't use vue (as of 2023-10-12) don't want/need the vue
|
|
10
|
+
- no vue (I don't use vue (as of 2023-10-12) don't want/need the vue
|
|
11
|
+
plugins/parsers/etc)
|
|
11
12
|
- assumes you're using prettier
|
|
12
13
|
- Based on:
|
|
13
14
|
- My old, very long, and very messy (non-flat) eslint config (`.eslintrc.js`)
|
|
@@ -24,7 +25,8 @@ pnpm i -D eslint @jsse/eslint-config
|
|
|
24
25
|
|
|
25
26
|
### Create config file
|
|
26
27
|
|
|
27
|
-
With [`"type": "module"`](https://nodejs.org/api/packages.html#type) in
|
|
28
|
+
With [`"type": "module"`](https://nodejs.org/api/packages.html#type) in
|
|
29
|
+
`package.json` (recommended):
|
|
28
30
|
|
|
29
31
|
```js
|
|
30
32
|
// eslint.config.js
|
|
@@ -52,7 +54,8 @@ module.exports = require("@jsse/eslint-config").jsse({
|
|
|
52
54
|
});
|
|
53
55
|
```
|
|
54
56
|
|
|
55
|
-
> Note that `.eslintignore` no longer works in Flat config, see
|
|
57
|
+
> Note that `.eslintignore` no longer works in Flat config, see
|
|
58
|
+
> [customization](#customization) for more details.
|
|
56
59
|
|
|
57
60
|
### Add script for package.json
|
|
58
61
|
|
|
@@ -69,8 +72,9 @@ For example:
|
|
|
69
72
|
|
|
70
73
|
### Type Aware Rules
|
|
71
74
|
|
|
72
|
-
You can optionally enable the
|
|
73
|
-
|
|
75
|
+
You can optionally enable the
|
|
76
|
+
[type aware rules](https://typescript-eslint.io/linting/typed-linting/) by
|
|
77
|
+
passing the options object to the `typescript` config:
|
|
74
78
|
|
|
75
79
|
```js
|
|
76
80
|
// eslint.config.js
|
|
@@ -85,8 +89,8 @@ export default jsse({
|
|
|
85
89
|
|
|
86
90
|
## Thanks
|
|
87
91
|
|
|
88
|
-
- [antfu](https://github.com/antfu) and [sxzz](https://github.com/sxzz) for
|
|
89
|
-
this is based on
|
|
92
|
+
- [antfu](https://github.com/antfu) and [sxzz](https://github.com/sxzz) for
|
|
93
|
+
their eslint-configs which this is based on
|
|
90
94
|
- Younger me for being more willing to spend time configuring eslint
|
|
91
95
|
- My fans for being my fans
|
|
92
96
|
|
|
@@ -94,15 +98,16 @@ export default jsse({
|
|
|
94
98
|
|
|
95
99
|
### Why use prettier?
|
|
96
100
|
|
|
97
|
-
I DO NOT CARE ANYMORE... My current stance on formatters is pick one that is
|
|
98
|
-
default config.
|
|
101
|
+
I DO NOT CARE ANYMORE... My current stance on formatters is pick one that is
|
|
102
|
+
stable, and use it, preferably with the default config.
|
|
99
103
|
|
|
100
|
-
A younger me (jessekrubin) would take the time to configure a
|
|
101
|
-
don't care anymore...
|
|
104
|
+
A younger me (jessekrubin) would take the time to configure a
|
|
105
|
+
formatter/linter/code style to my liking, but I really don't care anymore...
|
|
102
106
|
|
|
103
107
|
## License
|
|
104
108
|
|
|
105
|
-
[MIT](./LICENSE) License © 2023-PRESENT
|
|
109
|
+
[MIT](./LICENSE) License © 2023-PRESENT
|
|
110
|
+
[jesse rubin](https://github.com/jessekrubin)
|
|
106
111
|
|
|
107
112
|
[package-url]: https://www.npmjs.com/package/@jsse/eslint-config
|
|
108
113
|
[npm-version-svg]: https://badge.fury.io/js/@jsse%2Feslint-config.svg
|
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.0";
|
|
592
592
|
|
|
593
593
|
// src/cli.ts
|
|
594
594
|
var cli = cac("jsselint");
|
package/dist/esm/config-fns.d.ts
CHANGED
|
@@ -1,40 +1,116 @@
|
|
|
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
|
+
prettier: {
|
|
60
|
+
fn: import("./types.js").EslintConfigFn;
|
|
61
|
+
typeName: string;
|
|
62
|
+
};
|
|
63
|
+
react: {
|
|
64
|
+
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>;
|
|
65
|
+
typeName: string;
|
|
66
|
+
};
|
|
67
|
+
"react-hooks": {
|
|
68
|
+
fn: typeof reactHooks;
|
|
69
|
+
typeName: string;
|
|
70
|
+
};
|
|
71
|
+
"sort-package-json": {
|
|
72
|
+
fn: import("./types.js").EslintConfigFn;
|
|
73
|
+
typeName: string;
|
|
74
|
+
};
|
|
75
|
+
"sort-tsconfig": {
|
|
76
|
+
fn: import("./types.js").EslintConfigFn<{
|
|
77
|
+
extendTsconfigGlobs?: string[];
|
|
78
|
+
}>;
|
|
79
|
+
typeName: string;
|
|
80
|
+
};
|
|
81
|
+
stylistic: {
|
|
82
|
+
fn: import("./types.js").EslintConfigFn<import("./types.js").StylisticConfig>;
|
|
83
|
+
typeName: string;
|
|
84
|
+
};
|
|
85
|
+
toml: {
|
|
86
|
+
fn: import("./types.js").EslintConfigFn<import("./types.js").OptionsOverrides & import("./types.js").OptionsFiles & import("./types.js").OptionsStylistic>;
|
|
87
|
+
typeName: string;
|
|
88
|
+
};
|
|
89
|
+
tsdoc: {
|
|
90
|
+
fn: import("./types.js").EslintConfigFn;
|
|
91
|
+
typeName: string;
|
|
92
|
+
};
|
|
93
|
+
typescript: {
|
|
94
|
+
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>;
|
|
95
|
+
typeName: string;
|
|
96
|
+
};
|
|
97
|
+
unicorn: {
|
|
98
|
+
fn: import("./types.js").EslintConfigFn;
|
|
99
|
+
typeName: string;
|
|
100
|
+
};
|
|
101
|
+
vitest: {
|
|
102
|
+
fn: import("./types.js").EslintConfigFn<import("./types.js").OptionsIsInEditor & import("./types.js").OptionsOverrides>;
|
|
103
|
+
typeName: string;
|
|
104
|
+
};
|
|
105
|
+
yml: {
|
|
106
|
+
fn: import("./types.js").EslintConfigFn<import("./types.js").OptionsOverrides & import("./types.js").OptionsStylistic & import("./types.js").OptionsFiles>;
|
|
107
|
+
typeName: string;
|
|
108
|
+
};
|
|
34
109
|
};
|
|
35
110
|
export { antfu } from "./configs/antfu.js";
|
|
36
111
|
export { command } from "./configs/command.js";
|
|
37
|
-
export {
|
|
112
|
+
export { deMorgan } from "./configs/de-morgan.js";
|
|
113
|
+
export { eslintComments } from "./configs/eslint-comments.js";
|
|
38
114
|
export { ignores } from "./configs/ignores.js";
|
|
39
115
|
export { imports } from "./configs/imports.js";
|
|
40
116
|
export { javascript } from "./configs/javascript.js";
|
|
@@ -49,7 +125,6 @@ export { react, reactHooks } from "./configs/react.js";
|
|
|
49
125
|
export { sortPackageJson } from "./configs/sort-package-json.js";
|
|
50
126
|
export { sortTsconfig } from "./configs/sort-tsconfig.js";
|
|
51
127
|
export { stylistic } from "./configs/stylistic.js";
|
|
52
|
-
export { tailwind } from "./configs/tailwind.js";
|
|
53
128
|
export { toml } from "./configs/toml.js";
|
|
54
129
|
export { typescript } from "./configs/ts/typescript.js";
|
|
55
130
|
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";
|
|
@@ -15,47 +16,123 @@ import { react, reactHooks } from "./configs/react.js";
|
|
|
15
16
|
import { sortPackageJson } from "./configs/sort-package-json.js";
|
|
16
17
|
import { sortTsconfig } from "./configs/sort-tsconfig.js";
|
|
17
18
|
import { stylistic } from "./configs/stylistic.js";
|
|
18
|
-
import { tailwind } from "./configs/tailwind.js";
|
|
19
19
|
import { toml } from "./configs/toml.js";
|
|
20
20
|
import { typescript } from "./configs/ts/typescript.js";
|
|
21
21
|
import { tsdoc } from "./configs/tsdoc.js";
|
|
22
22
|
import { unicorn } from "./configs/unicorn.js";
|
|
23
23
|
import { vitest } from "./configs/vitest.js";
|
|
24
24
|
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
|
-
|
|
25
|
+
export const CONFIGS_MAPPING = {
|
|
26
|
+
antfu: {
|
|
27
|
+
fn: antfu,
|
|
28
|
+
typeName: "AntfuRuleOptions",
|
|
29
|
+
},
|
|
30
|
+
command: {
|
|
31
|
+
fn: command,
|
|
32
|
+
typeName: "CommandRuleOptions",
|
|
33
|
+
},
|
|
34
|
+
"de-morgan": {
|
|
35
|
+
fn: deMorgan,
|
|
36
|
+
typeName: "DeMorganRuleOptions",
|
|
37
|
+
},
|
|
38
|
+
"eslint-comments": {
|
|
39
|
+
fn: eslintComments,
|
|
40
|
+
typeName: "EslintCommentsRuleOptions",
|
|
41
|
+
},
|
|
42
|
+
ignores: {
|
|
43
|
+
fn: ignores,
|
|
44
|
+
typeName: "IgnoresRuleOptions",
|
|
45
|
+
},
|
|
46
|
+
imports: {
|
|
47
|
+
fn: imports,
|
|
48
|
+
typeName: "ImportsRuleOptions",
|
|
49
|
+
},
|
|
50
|
+
javascript: {
|
|
51
|
+
fn: javascript,
|
|
52
|
+
typeName: "JavascriptRuleOptions",
|
|
53
|
+
},
|
|
54
|
+
jsdoc: {
|
|
55
|
+
fn: jsdoc,
|
|
56
|
+
typeName: "JsdocRuleOptions",
|
|
57
|
+
},
|
|
58
|
+
jsonc: {
|
|
59
|
+
fn: jsonc,
|
|
60
|
+
typeName: "JsoncRuleOptions",
|
|
61
|
+
},
|
|
62
|
+
markdown: {
|
|
63
|
+
fn: markdown,
|
|
64
|
+
typeName: "MarkdownRuleOptions",
|
|
65
|
+
},
|
|
66
|
+
n: {
|
|
67
|
+
fn: n,
|
|
68
|
+
typeName: "NRuleOptions",
|
|
69
|
+
},
|
|
70
|
+
"no-only-tests": {
|
|
71
|
+
fn: noOnlyTests,
|
|
72
|
+
typeName: "NoOnlyTestsRuleOptions",
|
|
73
|
+
},
|
|
74
|
+
perfectionist: {
|
|
75
|
+
fn: perfectionist,
|
|
76
|
+
typeName: "PerfectionistRuleOptions",
|
|
77
|
+
},
|
|
78
|
+
prettier: {
|
|
79
|
+
fn: prettier,
|
|
80
|
+
typeName: "PrettierRuleOptions",
|
|
81
|
+
},
|
|
82
|
+
react: {
|
|
83
|
+
fn: react,
|
|
84
|
+
typeName: "ReactRuleOptions",
|
|
85
|
+
},
|
|
86
|
+
"react-hooks": {
|
|
87
|
+
fn: reactHooks,
|
|
88
|
+
typeName: "ReactHooksRuleOptions",
|
|
89
|
+
},
|
|
90
|
+
"sort-package-json": {
|
|
91
|
+
fn: sortPackageJson,
|
|
92
|
+
typeName: "SortPackageJsonRuleOptions",
|
|
93
|
+
},
|
|
94
|
+
"sort-tsconfig": {
|
|
95
|
+
fn: sortTsconfig,
|
|
96
|
+
typeName: "SortTsconfigRuleOptions",
|
|
97
|
+
},
|
|
98
|
+
stylistic: {
|
|
99
|
+
fn: stylistic,
|
|
100
|
+
typeName: "StylisticRuleOptions",
|
|
101
|
+
},
|
|
102
|
+
toml: {
|
|
103
|
+
fn: toml,
|
|
104
|
+
typeName: "TomlRuleOptions",
|
|
105
|
+
},
|
|
106
|
+
tsdoc: {
|
|
107
|
+
fn: tsdoc,
|
|
108
|
+
typeName: "TsdocRuleOptions",
|
|
109
|
+
},
|
|
110
|
+
// deprecated
|
|
111
|
+
// tailwind: {
|
|
112
|
+
// typeName: "TailwindRuleOptions",
|
|
113
|
+
// fn: tailwind,
|
|
114
|
+
// },
|
|
115
|
+
typescript: {
|
|
116
|
+
fn: typescript,
|
|
117
|
+
typeName: "TypescriptRuleOptions",
|
|
118
|
+
},
|
|
119
|
+
unicorn: {
|
|
120
|
+
fn: unicorn,
|
|
121
|
+
typeName: "UnicornRuleOptions",
|
|
122
|
+
},
|
|
123
|
+
vitest: {
|
|
124
|
+
fn: vitest,
|
|
125
|
+
typeName: "VitestRuleOptions",
|
|
126
|
+
},
|
|
127
|
+
yml: {
|
|
128
|
+
fn: yml,
|
|
129
|
+
typeName: "YmlRuleOptions",
|
|
130
|
+
},
|
|
131
|
+
};
|
|
56
132
|
export { antfu } from "./configs/antfu.js";
|
|
57
133
|
export { command } from "./configs/command.js";
|
|
58
|
-
export {
|
|
134
|
+
export { deMorgan } from "./configs/de-morgan.js";
|
|
135
|
+
export { eslintComments } from "./configs/eslint-comments.js";
|
|
59
136
|
export { ignores } from "./configs/ignores.js";
|
|
60
137
|
export { imports } from "./configs/imports.js";
|
|
61
138
|
export { javascript } from "./configs/javascript.js";
|
|
@@ -70,7 +147,6 @@ export { react, reactHooks } from "./configs/react.js";
|
|
|
70
147
|
export { sortPackageJson } from "./configs/sort-package-json.js";
|
|
71
148
|
export { sortTsconfig } from "./configs/sort-tsconfig.js";
|
|
72
149
|
export { stylistic } from "./configs/stylistic.js";
|
|
73
|
-
export { tailwind } from "./configs/tailwind.js";
|
|
74
150
|
export { toml } from "./configs/toml.js";
|
|
75
151
|
export { typescript } from "./configs/ts/typescript.js";
|
|
76
152
|
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",
|
|
@@ -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 {};
|
|
@@ -29,6 +29,7 @@ export const sortPackageJson = async () => {
|
|
|
29
29
|
"packageManager",
|
|
30
30
|
"description",
|
|
31
31
|
"author",
|
|
32
|
+
"contributors",
|
|
32
33
|
"license",
|
|
33
34
|
"funding",
|
|
34
35
|
"homepage",
|
|
@@ -37,6 +38,7 @@ export const sortPackageJson = async () => {
|
|
|
37
38
|
"keywords",
|
|
38
39
|
"categories",
|
|
39
40
|
"sideEffects",
|
|
41
|
+
"imports",
|
|
40
42
|
"exports",
|
|
41
43
|
"main",
|
|
42
44
|
"module",
|
|
@@ -68,20 +70,31 @@ export const sortPackageJson = async () => {
|
|
|
68
70
|
},
|
|
69
71
|
{
|
|
70
72
|
order: { type: "asc" },
|
|
71
|
-
pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies
|
|
73
|
+
pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$",
|
|
72
74
|
},
|
|
73
75
|
{
|
|
74
76
|
order: { type: "asc" },
|
|
75
|
-
pathPattern: "^resolutions$",
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
order: { type: "asc" },
|
|
79
|
-
pathPattern: "^pnpm.overrides$",
|
|
77
|
+
pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$",
|
|
80
78
|
},
|
|
81
79
|
{
|
|
82
80
|
order: ["types", "import", "require", "default"],
|
|
83
81
|
pathPattern: "^exports.*$",
|
|
84
82
|
},
|
|
83
|
+
{
|
|
84
|
+
order: [
|
|
85
|
+
"pre-commit",
|
|
86
|
+
"prepare-commit-msg",
|
|
87
|
+
"commit-msg",
|
|
88
|
+
"post-commit",
|
|
89
|
+
"pre-rebase",
|
|
90
|
+
"post-rewrite",
|
|
91
|
+
"post-checkout",
|
|
92
|
+
"post-merge",
|
|
93
|
+
"pre-push",
|
|
94
|
+
"pre-auto-gc",
|
|
95
|
+
],
|
|
96
|
+
pathPattern: "^(?:gitHooks|husky|simple-git-hooks)$",
|
|
97
|
+
},
|
|
85
98
|
],
|
|
86
99
|
},
|
|
87
100
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { OptionsComponentExts, OptionsReact, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes
|
|
1
|
+
import type { Config, OptionsComponentExts, OptionsReact, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes } from "../../types.js";
|
|
2
2
|
export type TsParserOptions = OptionsComponentExts & OptionsTypeScriptParserOptions & OptionsTypeScriptWithTypes & OptionsReact & {
|
|
3
3
|
name?: string;
|
|
4
4
|
};
|
|
5
|
-
export declare function typescriptParser(options: TsParserOptions):
|
|
5
|
+
export declare function typescriptParser(options: TsParserOptions): Config & {
|
|
6
6
|
name: string;
|
|
7
7
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import process from "node:process";
|
|
2
|
-
import {
|
|
2
|
+
import { dbg } from "src/lager.js";
|
|
3
3
|
import { GLOB_MARKDOWN, GLOB_TS, GLOB_TSX } from "../../globs.js";
|
|
4
4
|
import { parserTs } from "../../plugins.js";
|
|
5
5
|
function autoUseParserService(options) {
|
|
@@ -17,12 +17,13 @@ export function typescriptParser(options) {
|
|
|
17
17
|
const { componentExts = [], filesTypeAware: files = [GLOB_TS, GLOB_TSX], ignoresTypeAware: ignores = [GLOB_MARKDOWN], name, parserOptions: parserOptionsOverride = {}, react, tsconfig, useProjectService = autoUseParserService(options), } = options;
|
|
18
18
|
const typeAware = !!tsconfig;
|
|
19
19
|
if (useProjectService) {
|
|
20
|
-
|
|
20
|
+
dbg("ts parser-options using `projectService`project service");
|
|
21
21
|
return {
|
|
22
22
|
files,
|
|
23
|
-
...(ignores ? { ignores } : {}),
|
|
23
|
+
...(ignores.length > 0 ? { ignores } : {}),
|
|
24
24
|
languageOptions: {
|
|
25
25
|
parser: parserTs,
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
26
27
|
parserOptions: {
|
|
27
28
|
extraFileExtensions: componentExts.map((ext) => `.${ext}`),
|
|
28
29
|
jsxPragma: react ? "React" : undefined,
|
|
@@ -44,12 +45,13 @@ export function typescriptParser(options) {
|
|
|
44
45
|
name: name ?? `jsse/typescript/${typeAware ? "type-aware-parser" : "parser"}`,
|
|
45
46
|
};
|
|
46
47
|
}
|
|
47
|
-
|
|
48
|
+
dbg("ts parser-options NOT using `projectService`project service - using `project`");
|
|
48
49
|
return {
|
|
49
50
|
files,
|
|
50
|
-
...(ignores ? { ignores } : {}),
|
|
51
|
+
...(ignores.length > 0 ? { ignores } : {}),
|
|
51
52
|
languageOptions: {
|
|
52
53
|
parser: parserTs,
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
53
55
|
parserOptions: {
|
|
54
56
|
extraFileExtensions: componentExts.map((ext) => `.${ext}`),
|
|
55
57
|
jsxPragma: react ? "React" : undefined,
|
|
@@ -23,6 +23,7 @@ export const requiresTypeChecking = [
|
|
|
23
23
|
"@typescript-eslint/no-unnecessary-template-expression",
|
|
24
24
|
"@typescript-eslint/no-unnecessary-type-arguments",
|
|
25
25
|
"@typescript-eslint/no-unnecessary-type-assertion",
|
|
26
|
+
"@typescript-eslint/no-unnecessary-type-conversion",
|
|
26
27
|
"@typescript-eslint/no-unnecessary-type-parameters",
|
|
27
28
|
"@typescript-eslint/no-unsafe-argument",
|
|
28
29
|
"@typescript-eslint/no-unsafe-assignment",
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function typescriptRulesTypeAware(
|
|
3
|
-
|
|
1
|
+
import type { Config } from "../../types.js";
|
|
2
|
+
export declare function typescriptRulesTypeAware(props?: {
|
|
3
|
+
strict?: boolean;
|
|
4
|
+
}): Config["rules"];
|
|
5
|
+
export declare function typescriptRulesTypeOblivious(props?: {
|
|
6
|
+
strict?: boolean;
|
|
7
|
+
}): Config["rules"];
|
|
4
8
|
export declare function typescriptRules(props?: {
|
|
5
9
|
typeAware: boolean;
|
|
6
|
-
|
|
10
|
+
strict: boolean;
|
|
11
|
+
}): Config["rules"];
|