@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.
Files changed (47) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +17 -12
  3. package/dist/cli.js +3 -3
  4. package/dist/esm/config-fns.d.ts +109 -34
  5. package/dist/esm/config-fns.js +111 -35
  6. package/dist/esm/configs/{comments.d.ts → de-morgan.d.ts} +1 -1
  7. package/dist/esm/configs/de-morgan.js +9 -0
  8. package/dist/esm/configs/eslint-comments.d.ts +2 -0
  9. package/dist/esm/configs/{comments.js → eslint-comments.js} +1 -1
  10. package/dist/esm/configs/gql.d.ts +2 -2
  11. package/dist/esm/configs/markdown.js +1 -1
  12. package/dist/esm/configs/prettier.d.ts +2 -2
  13. package/dist/esm/configs/react.d.ts +3 -3
  14. package/dist/esm/configs/sort-package-json.js +19 -6
  15. package/dist/esm/configs/stylistic.js +1 -1
  16. package/dist/esm/configs/ts/parser.d.ts +2 -2
  17. package/dist/esm/configs/ts/parser.js +7 -5
  18. package/dist/esm/configs/ts/requires-type-checking.js +1 -0
  19. package/dist/esm/configs/ts/typescript-rules.d.ts +9 -4
  20. package/dist/esm/configs/ts/typescript-rules.js +26 -62
  21. package/dist/esm/configs/ts/typescript.js +56 -43
  22. package/dist/esm/define-config.d.ts +3 -3
  23. package/dist/esm/define-config.js +38 -28
  24. package/dist/esm/fixable.d.ts +2 -1
  25. package/dist/esm/fixable.js +3 -391
  26. package/dist/esm/generated/fixable-rules-map.d.ts +2 -0
  27. package/dist/esm/generated/fixable-rules-map.js +436 -0
  28. package/dist/esm/generated/version.d.ts +1 -1
  29. package/dist/esm/generated/version.js +1 -1
  30. package/dist/esm/index.d.ts +1 -1
  31. package/dist/esm/index.js +0 -1
  32. package/dist/esm/lager.d.ts +1 -1
  33. package/dist/esm/lager.js +1 -1
  34. package/dist/esm/plugins-all.d.ts +11 -8
  35. package/dist/esm/plugins-all.js +99 -10
  36. package/dist/esm/plugins.d.ts +1 -0
  37. package/dist/esm/plugins.js +4 -1
  38. package/dist/esm/presets.d.ts +16 -0
  39. package/dist/esm/presets.js +96 -1
  40. package/dist/esm/types.d.ts +34 -22
  41. package/dist/esm/utils.d.ts +5 -5
  42. package/dist/esm/utils.js +1 -1
  43. package/dist/index.d.ts +7445 -6300
  44. package/dist/index.js +373 -238
  45. package/package.json +23 -30
  46. package/dist/esm/plugindex.d.ts +0 -7
  47. 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 plugins/parsers/etc)
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 `package.json` (recommended):
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 [customization](#customization) for more details.
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 [type aware rules](https://typescript-eslint.io/linting/typed-linting/) by passing the
73
- options object to the `typescript` config:
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 their eslint-configs which
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 stable, and use it, preferably with the
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 formatter/linter/code style to my liking, but I really
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 [jesse rubin](https://github.com/jessekrubin)
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 "node:fs";
3
- import process2 from "node:process";
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.3.6";
591
+ var VERSION = "0.4.0";
592
592
 
593
593
  // src/cli.ts
594
594
  var cli = cac("jsselint");
@@ -1,40 +1,116 @@
1
1
  import { reactHooks } from "./configs/react.js";
2
- export declare function configFunctions(): {
3
- antfu: import("./types.js").EslintConfigFn<{
4
- topLevelFunction: "error" | "off";
5
- }>;
6
- command: import("./types.js").EslintConfigFn;
7
- comments: import("./types.js").EslintConfigFn;
8
- ignores: import("./types.js").EslintConfigFn;
9
- imports: import("./types.js").EslintConfigFn<import("./types.js").OptionsStylistic>;
10
- javascript: import("./types.js").EslintConfigFn<import("./types.js").OptionsIsInEditor & import("./types.js").OptionsOverrides & {
11
- reportUnusedDisableDirectives?: boolean;
12
- }>;
13
- jsdoc: import("./types.js").EslintConfigFn;
14
- jsonc: import("./types.js").EslintConfigFn<import("./types.js").OptionsStylistic & import("./types.js").OptionsOverrides>;
15
- markdown: import("./types.js").EslintConfigFn<import("./types.js").OptionsComponentExts & import("./types.js").OptionsOverrides>;
16
- n: import("./types.js").EslintConfigFn;
17
- noOnlyTests: import("./types.js").EslintConfigFn<import("./types.js").OptionsIsInEditor & import("./types.js").OptionsOverrides>;
18
- perfectionist: import("./types.js").EslintConfigFn;
19
- prettier: import("./types.js").EslintConfigFn;
20
- react: import("./types.js").EslintConfigFn<import("./types.js").OptionsComponentExts & import("./types.js").OptionsOverrides & import("./types.js").OptionsTypeScriptWithTypes & import("./types.js").OptionsTypeScriptParserOptions & import("./types.js").OptionsReact>;
21
- reactHooks: typeof reactHooks;
22
- sortPackageJson: import("./types.js").EslintConfigFn;
23
- sortTsconfig: import("./types.js").EslintConfigFn<{
24
- extendTsconfigGlobs?: string[];
25
- }>;
26
- stylistic: import("./types.js").EslintConfigFn<import("./types.js").StylisticConfig>;
27
- tailwind: import("./types.js").EslintConfigFn<Partial<import("./types.js").TailwindEslintSettings>>;
28
- toml: import("./types.js").EslintConfigFn<import("./types.js").OptionsOverrides & import("./types.js").OptionsFiles & import("./types.js").OptionsStylistic>;
29
- tsdoc: import("./types.js").EslintConfigFn;
30
- typescript: 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>;
31
- unicorn: import("./types.js").EslintConfigFn;
32
- vitest: import("./types.js").EslintConfigFn<import("./types.js").OptionsIsInEditor & import("./types.js").OptionsOverrides>;
33
- yml: import("./types.js").EslintConfigFn<import("./types.js").OptionsOverrides & import("./types.js").OptionsStylistic & import("./types.js").OptionsFiles>;
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 { comments } from "./configs/comments.js";
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";
@@ -1,6 +1,7 @@
1
1
  import { antfu } from "./configs/antfu.js";
2
2
  import { command } from "./configs/command.js";
3
- import { comments } from "./configs/comments.js";
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
- // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
26
- export function configFunctions() {
27
- // @keep-sorted
28
- return {
29
- antfu,
30
- command,
31
- comments,
32
- ignores,
33
- imports,
34
- javascript,
35
- jsdoc,
36
- jsonc,
37
- markdown,
38
- n,
39
- noOnlyTests,
40
- perfectionist,
41
- prettier,
42
- react,
43
- reactHooks,
44
- sortPackageJson,
45
- sortTsconfig,
46
- stylistic,
47
- tailwind,
48
- toml,
49
- tsdoc,
50
- typescript,
51
- unicorn,
52
- vitest,
53
- yml,
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 { comments } from "./configs/comments.js";
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 comments: EslintConfigFn;
2
+ export declare const deMorgan: EslintConfigFn;
@@ -0,0 +1,9 @@
1
+ import { pluginDeMorgan } from "../plugins.js";
2
+ export const deMorgan = async () => {
3
+ return [
4
+ {
5
+ ...pluginDeMorgan.configs.recommended,
6
+ name: "jsse/de-morgan",
7
+ },
8
+ ];
9
+ };
@@ -0,0 +1,2 @@
1
+ import type { EslintConfigFn } from "../types.js";
2
+ export declare const eslintComments: EslintConfigFn;
@@ -1,5 +1,5 @@
1
1
  import { pluginEslintComments } from "../plugins.js";
2
- export const comments = async () => [
2
+ export const eslintComments = async () => [
3
3
  {
4
4
  name: "jsse/eslint-comments",
5
5
  plugins: {
@@ -1,2 +1,2 @@
1
- import type { TypedFlatConfigItem } from "src/types.js";
2
- export declare function gql(): TypedFlatConfigItem[];
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
- ].filter((processor) => processor !== undefined));
21
+ ]);
22
22
  return [
23
23
  {
24
24
  name: "jsse/markdown/setup",
@@ -1,7 +1,7 @@
1
- import type { EslintConfigFn, TypedFlatConfigItem } from "../types.js";
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(): TypedFlatConfigItem["rules"];
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, TypedFlatConfigItem } from "../types.js";
2
- export declare function reactRules(): TypedFlatConfigItem["rules"];
3
- export declare function reactHooks(): Promise<TypedFlatConfigItem[]>;
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,5 +1,5 @@
1
1
  import { importPluginStylistic } from "../plugins.js";
2
- function jsxStylistic({ indent, }) {
2
+ function jsxStylistic({ indent }) {
3
3
  return {
4
4
  "@stylistic/jsx-curly-brace-presence": [
5
5
  "error",
@@ -1,7 +1,7 @@
1
- import type { OptionsComponentExts, OptionsReact, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, TypedFlatConfigItem } from "../../types.js";
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): TypedFlatConfigItem & {
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 { debug } from "src/lager.js";
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
- debug("ts parser-options using `projectService`project service");
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
- debug("ts parser-options NOT using `projectService`project service - using `project`");
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 { TypedFlatConfigItem } from "../../types.js";
2
- export declare function typescriptRulesTypeAware(): TypedFlatConfigItem["rules"];
3
- export declare function typescriptRulesTypeOblivious(): TypedFlatConfigItem["rules"];
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
- }): TypedFlatConfigItem["rules"];
10
+ strict: boolean;
11
+ }): Config["rules"];