@peerigon/configs 4.1.0 → 4.3.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.
Files changed (148) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/{types → dist}/eslint/lib/glob-patterns.d.ts +0 -1
  3. package/dist/eslint/lib/glob-patterns.js +11 -0
  4. package/{types → dist}/eslint/lib/rule-options.d.ts +0 -1
  5. package/dist/eslint/lib/rule-options.js +127 -0
  6. package/{types → dist}/eslint/presets/javascript-browser.d.ts +0 -1
  7. package/{eslint → dist/eslint}/presets/javascript-browser.js +4 -6
  8. package/{types → dist}/eslint/presets/javascript-node.d.ts +0 -1
  9. package/{eslint → dist/eslint}/presets/javascript-node.js +4 -6
  10. package/{types → dist}/eslint/presets/javascript.d.ts +0 -1
  11. package/{eslint → dist/eslint}/presets/javascript.js +0 -2
  12. package/{types → dist}/eslint/presets/typescript-node.d.ts +0 -1
  13. package/{eslint → dist/eslint}/presets/typescript-node.js +5 -7
  14. package/{types → dist}/eslint/presets/typescript-react.d.ts +0 -1
  15. package/{eslint → dist/eslint}/presets/typescript-react.js +6 -8
  16. package/{types → dist}/eslint/presets/typescript.d.ts +0 -1
  17. package/{eslint → dist/eslint}/presets/typescript.js +4 -6
  18. package/{types → dist}/eslint/rules/base.d.ts +0 -1
  19. package/{eslint → dist/eslint}/rules/base.js +5 -8
  20. package/{types → dist}/eslint/rules/browser.d.ts +0 -1
  21. package/{eslint → dist/eslint}/rules/browser.js +4 -6
  22. package/{types → dist}/eslint/rules/javascript.d.ts +0 -1
  23. package/dist/eslint/rules/javascript.js +153 -0
  24. package/{types → dist}/eslint/rules/node.d.ts +0 -1
  25. package/{eslint → dist/eslint}/rules/node.js +4 -6
  26. package/{types → dist}/eslint/rules/react.d.ts +0 -1
  27. package/dist/eslint/rules/react.js +166 -0
  28. package/{types → dist}/eslint/rules/typescript.d.ts +0 -1
  29. package/dist/eslint/rules/typescript.js +195 -0
  30. package/{types → dist}/eslint/styles/jsx-no-literals.d.ts +0 -1
  31. package/dist/eslint/styles/jsx-no-literals.js +29 -0
  32. package/{types → dist}/eslint/styles/no-default-export.d.ts +0 -1
  33. package/dist/eslint/styles/no-default-export.js +18 -0
  34. package/{types → dist}/eslint/styles/no-null.d.ts +0 -1
  35. package/{eslint → dist/eslint}/styles/no-null.js +4 -5
  36. package/{types → dist}/eslint/styles/prefer-array-shorthand.d.ts +0 -1
  37. package/dist/eslint/styles/prefer-array-shorthand.js +14 -0
  38. package/{types → dist}/eslint/styles/prefer-interface.d.ts +0 -1
  39. package/dist/eslint/styles/prefer-interface.js +9 -0
  40. package/dist/prettier/base.d.ts +7 -0
  41. package/dist/prettier/base.js +75 -0
  42. package/{types → dist}/semantic-release/base.d.ts +0 -1
  43. package/dist/semantic-release/base.js +40 -0
  44. package/{types → dist}/semantic-release/cross-publish.d.ts +0 -1
  45. package/dist/semantic-release/cross-publish.js +31 -0
  46. package/dist/typescript/base.json +41 -0
  47. package/dist/typescript/configs.d.ts +1 -0
  48. package/dist/typescript/configs.js +4 -0
  49. package/dist/typescript/js-lib.json +9 -0
  50. package/dist/typescript/lib.json +11 -0
  51. package/package.json +22 -73
  52. package/eslint/README.md +0 -119
  53. package/eslint/lib/glob-patterns.js +0 -11
  54. package/eslint/lib/rule-options.js +0 -130
  55. package/eslint/presets/javascript.test/eslint.config.js +0 -1
  56. package/eslint/presets/javascript.test/main.js +0 -62
  57. package/eslint/presets/javascript.test/other.js +0 -2
  58. package/eslint/presets/typescript-react.test/App.tsx +0 -47
  59. package/eslint/presets/typescript-react.test/Other.tsx +0 -5
  60. package/eslint/presets/typescript-react.test/eslint.config.js +0 -1
  61. package/eslint/presets/typescript-react.test/tsconfig.json +0 -7
  62. package/eslint/presets/typescript.test/eslint.config.js +0 -1
  63. package/eslint/presets/typescript.test/main.ts +0 -42
  64. package/eslint/presets/typescript.test/message.ts +0 -3
  65. package/eslint/presets/typescript.test/test.json +0 -1
  66. package/eslint/presets/typescript.test/tsconfig.json +0 -4
  67. package/eslint/presets/typescript.test/types.d.ts +0 -11
  68. package/eslint/rules/javascript.js +0 -157
  69. package/eslint/rules/react.js +0 -169
  70. package/eslint/rules/typescript.js +0 -206
  71. package/eslint/styles/jsx-no-literals.js +0 -31
  72. package/eslint/styles/jsx-no-literals.test/eslint.config.js +0 -4
  73. package/eslint/styles/jsx-no-literals.test/main.tsx +0 -4
  74. package/eslint/styles/jsx-no-literals.test/tsconfig.json +0 -7
  75. package/eslint/styles/no-default-export.js +0 -20
  76. package/eslint/styles/no-default-export.test/eslint.config.js +0 -4
  77. package/eslint/styles/no-default-export.test/main.ts +0 -2
  78. package/eslint/styles/no-default-export.test/tsconfig.json +0 -4
  79. package/eslint/styles/no-default-export.test/vitest.config.ts +0 -1
  80. package/eslint/styles/no-null.test/eslint.config.js +0 -4
  81. package/eslint/styles/no-null.test/main.ts +0 -2
  82. package/eslint/styles/no-null.test/tsconfig.json +0 -4
  83. package/eslint/styles/prefer-array-shorthand.js +0 -15
  84. package/eslint/styles/prefer-array-shorthand.test/eslint.config.js +0 -4
  85. package/eslint/styles/prefer-array-shorthand.test/main.ts +0 -4
  86. package/eslint/styles/prefer-array-shorthand.test/tsconfig.json +0 -4
  87. package/eslint/styles/prefer-interface.js +0 -10
  88. package/eslint/styles/prefer-interface.test/eslint.config.js +0 -4
  89. package/eslint/styles/prefer-interface.test/main.ts +0 -8
  90. package/eslint/styles/prefer-interface.test/tsconfig.json +0 -4
  91. package/eslint/types.d.ts +0 -50
  92. package/prettier/README.md +0 -35
  93. package/prettier/base.js +0 -35
  94. package/prettier/css.test/styles.css +0 -9
  95. package/semantic-release/README.md +0 -81
  96. package/semantic-release/base.js +0 -41
  97. package/semantic-release/cross-publish.js +0 -41
  98. package/types/eslint/lib/glob-patterns.d.ts.map +0 -1
  99. package/types/eslint/lib/rule-options.d.ts.map +0 -1
  100. package/types/eslint/presets/javascript-browser.d.ts.map +0 -1
  101. package/types/eslint/presets/javascript-node.d.ts.map +0 -1
  102. package/types/eslint/presets/javascript.d.ts.map +0 -1
  103. package/types/eslint/presets/javascript.test/eslint.config.d.ts +0 -2
  104. package/types/eslint/presets/javascript.test/eslint.config.d.ts.map +0 -1
  105. package/types/eslint/presets/javascript.test/main.d.ts +0 -2
  106. package/types/eslint/presets/javascript.test/main.d.ts.map +0 -1
  107. package/types/eslint/presets/javascript.test/other.d.ts +0 -3
  108. package/types/eslint/presets/javascript.test/other.d.ts.map +0 -1
  109. package/types/eslint/presets/typescript-node.d.ts.map +0 -1
  110. package/types/eslint/presets/typescript-react.d.ts.map +0 -1
  111. package/types/eslint/presets/typescript.d.ts.map +0 -1
  112. package/types/eslint/rules/base.d.ts.map +0 -1
  113. package/types/eslint/rules/browser.d.ts.map +0 -1
  114. package/types/eslint/rules/javascript.d.ts.map +0 -1
  115. package/types/eslint/rules/node.d.ts.map +0 -1
  116. package/types/eslint/rules/react.d.ts.map +0 -1
  117. package/types/eslint/rules/typescript.d.ts.map +0 -1
  118. package/types/eslint/styles/jsx-no-literals.d.ts.map +0 -1
  119. package/types/eslint/styles/no-default-export.d.ts.map +0 -1
  120. package/types/eslint/styles/no-default-export.test/eslint.config.d.ts +0 -3
  121. package/types/eslint/styles/no-default-export.test/eslint.config.d.ts.map +0 -1
  122. package/types/eslint/styles/no-default-export.test/main.d.ts +0 -3
  123. package/types/eslint/styles/no-default-export.test/main.d.ts.map +0 -1
  124. package/types/eslint/styles/no-default-export.test/vitest.config.d.ts +0 -3
  125. package/types/eslint/styles/no-default-export.test/vitest.config.d.ts.map +0 -1
  126. package/types/eslint/styles/no-null.d.ts.map +0 -1
  127. package/types/eslint/styles/no-null.test/eslint.config.d.ts +0 -3
  128. package/types/eslint/styles/no-null.test/eslint.config.d.ts.map +0 -1
  129. package/types/eslint/styles/no-null.test/main.d.ts +0 -2
  130. package/types/eslint/styles/no-null.test/main.d.ts.map +0 -1
  131. package/types/eslint/styles/prefer-array-shorthand.d.ts.map +0 -1
  132. package/types/eslint/styles/prefer-array-shorthand.test/eslint.config.d.ts +0 -3
  133. package/types/eslint/styles/prefer-array-shorthand.test/eslint.config.d.ts.map +0 -1
  134. package/types/eslint/styles/prefer-array-shorthand.test/main.d.ts +0 -3
  135. package/types/eslint/styles/prefer-array-shorthand.test/main.d.ts.map +0 -1
  136. package/types/eslint/styles/prefer-interface.d.ts.map +0 -1
  137. package/types/eslint/styles/prefer-interface.test/eslint.config.d.ts +0 -3
  138. package/types/eslint/styles/prefer-interface.test/eslint.config.d.ts.map +0 -1
  139. package/types/eslint/styles/prefer-interface.test/main.d.ts +0 -7
  140. package/types/eslint/styles/prefer-interface.test/main.d.ts.map +0 -1
  141. package/types/prettier/base.d.ts +0 -4
  142. package/types/prettier/base.d.ts.map +0 -1
  143. package/types/semantic-release/base.d.ts.map +0 -1
  144. package/types/semantic-release/cross-publish.d.ts.map +0 -1
  145. package/typescript/README.md +0 -63
  146. package/typescript/base.json +0 -44
  147. package/typescript/js-lib.json +0 -8
  148. package/typescript/lib.json +0 -11
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [4.3.0-beta.1](https://github.com/peerigon/configs/compare/v4.2.0...v4.3.0-beta.1) (2025-03-12)
2
+
3
+ ### Features
4
+
5
+ - Compile JS code instead of just emitDeclarationOnly ([c7d29f7](https://github.com/peerigon/configs/commit/c7d29f700ee53aa6be5b16175b355f000fba778c))
6
+
7
+ # [4.2.0](https://github.com/peerigon/configs/compare/v4.1.0...v4.2.0) (2025-03-10)
8
+
9
+ ### Features
10
+
11
+ - **eslint:** bump @eslint-react/eslint-plugin from 1.30.2 to 1.31.0 ([#30](https://github.com/peerigon/configs/issues/30)) ([1008a87](https://github.com/peerigon/configs/commit/1008a87a8c3e343c07f742aeb357dabcdaf38709))
12
+ - **prettier:** bump eslint-config-prettier from 10.0.2 to 10.1.1 ([#27](https://github.com/peerigon/configs/issues/27)) ([c27fc02](https://github.com/peerigon/configs/commit/c27fc027df9dcfd7cdbf580878a5f42ce9bda93a))
13
+ - **react:** bump eslint-plugin-react-compiler from 19.0.0-beta-e552027-20250112 to 19.0.0-beta-714736e-20250131 ([#29](https://github.com/peerigon/configs/issues/29)) ([042a398](https://github.com/peerigon/configs/commit/042a398e77de01d6506247454699c12508b78882))
14
+
1
15
  # [4.1.0](https://github.com/peerigon/configs/compare/v4.0.1...v4.1.0) (2025-03-10)
2
16
 
3
17
  ### Features
@@ -6,4 +6,3 @@ export namespace globPatterns {
6
6
  let typescriptJsx: string[];
7
7
  let tests: string[];
8
8
  }
9
- //# sourceMappingURL=glob-patterns.d.ts.map
@@ -0,0 +1,11 @@
1
+ export const globPatterns = {
2
+ javascript: ["**/*.{js,mjs,cjs}"],
3
+ typescript: ["**/*.{ts,cts,mts}"],
4
+ typescriptAmbient: ["**/*.d.ts"],
5
+ jsx: ["**/*.jsx"],
6
+ typescriptJsx: ["**/*.tsx"],
7
+ tests: [
8
+ "**/*.{test,spec,stories}.{js,mjs,cjs,ts,cts,mts,jsx,tsx}",
9
+ "**/test{s,}/**/*.{js,mjs,cjs,ts,cts,mts,jsx,tsx}",
10
+ ],
11
+ };
@@ -92,4 +92,3 @@ export const ruleOptions: {
92
92
  };
93
93
  };
94
94
  };
95
- //# sourceMappingURL=rule-options.d.ts.map
@@ -0,0 +1,127 @@
1
+ const camelcase = {
2
+ allow: ["^UNSAFE_"], // Allows React UNSAFE_ methods
3
+ ignoreDestructuring: false,
4
+ properties: "always",
5
+ };
6
+ export const ruleOptions = {
7
+ ["camelcase"]: camelcase,
8
+ ["max-lines"]: {
9
+ max: 700,
10
+ skipBlankLines: true,
11
+ skipComments: true,
12
+ },
13
+ ["no-unused-expressions"]: {
14
+ allowShortCircuit: true,
15
+ allowTernary: true,
16
+ },
17
+ ["no-unused-vars"]: {
18
+ vars: "all",
19
+ varsIgnorePattern: "^_",
20
+ args: "after-used",
21
+ argsIgnorePattern: "^_",
22
+ caughtErrors: "all",
23
+ reportUsedIgnorePattern: false,
24
+ // This pattern is pretty common
25
+ ignoreRestSiblings: true,
26
+ },
27
+ ["@typescript-eslint/naming-convention"]: (() => {
28
+ const options = {
29
+ default: {
30
+ selector: "default",
31
+ format: ["camelCase", "PascalCase", "UPPER_CASE"],
32
+ leadingUnderscore: "allow",
33
+ trailingUnderscore: "allow",
34
+ },
35
+ function: {
36
+ selector: "function",
37
+ format: ["camelCase"],
38
+ leadingUnderscore: "allow",
39
+ trailingUnderscore: "allow",
40
+ },
41
+ parameter: {
42
+ selector: "parameter",
43
+ format: ["camelCase", "PascalCase"],
44
+ leadingUnderscore: "allow",
45
+ trailingUnderscore: "allow",
46
+ },
47
+ method: {
48
+ selector: "method",
49
+ format: ["camelCase"],
50
+ leadingUnderscore: "allow",
51
+ trailingUnderscore: "allow",
52
+ },
53
+ typeLike: {
54
+ selector: "typeLike",
55
+ format: ["PascalCase"],
56
+ leadingUnderscore: "allow",
57
+ trailingUnderscore: "allow",
58
+ },
59
+ enumMember: {
60
+ selector: "enumMember",
61
+ format: ["PascalCase"],
62
+ leadingUnderscore: "allow",
63
+ trailingUnderscore: "allow",
64
+ },
65
+ // In case it's destructured, we don't want to force the developer to change the casing
66
+ destructuring: {
67
+ selector: "variable",
68
+ modifiers: ["destructured"],
69
+ format: null,
70
+ },
71
+ // In case the property name requires quotes, we don't enforce any convention
72
+ requiresQuites: {
73
+ selector: [
74
+ "classProperty",
75
+ "objectLiteralProperty",
76
+ "typeProperty",
77
+ "classMethod",
78
+ "objectLiteralMethod",
79
+ "typeMethod",
80
+ "accessor",
81
+ "enumMember",
82
+ ],
83
+ modifiers: ["requiresQuotes"],
84
+ format: null,
85
+ },
86
+ // We don't enforce any convention on object literals since these are often used
87
+ // for data object where we're not in control of the type (e.g. an api that takes camel_case properties)
88
+ objectLiteralProperty: {
89
+ selector: "objectLiteralProperty",
90
+ format: null,
91
+ },
92
+ };
93
+ // By enumerating all selectors explicitly we increase the
94
+ // specificity of these rules.
95
+ const escapeHatches = [
96
+ "variable",
97
+ "function",
98
+ "parameter",
99
+ "property",
100
+ "parameterProperty",
101
+ "method",
102
+ "accessor",
103
+ "enumMember",
104
+ "class",
105
+ "interface",
106
+ "typeAlias",
107
+ "enum",
108
+ "typeParameter",
109
+ ].map((selector) => ({
110
+ filter: {
111
+ match: true,
112
+ // UNSAFE_ is a prefix used by React for all lifecycle hooks that are about to be deprecated
113
+ regex: "^(__|UNSAFE_).+$",
114
+ },
115
+ format: null,
116
+ selector,
117
+ }));
118
+ return {
119
+ ...options,
120
+ defaultRules: [...Object.values(options), ...escapeHatches],
121
+ ignoreProperties: {
122
+ selector: "property",
123
+ format: null,
124
+ },
125
+ };
126
+ })(),
127
+ };
@@ -1,4 +1,3 @@
1
1
  /** @type {import("eslint").Linter.Config[]} */
2
2
  export const javascriptBrowserPreset: import("eslint").Linter.Config[];
3
3
  export default javascriptBrowserPreset;
4
- //# sourceMappingURL=javascript-browser.d.ts.map
@@ -2,13 +2,11 @@ import eslintConfigPrettier from "eslint-config-prettier";
2
2
  import { base } from "../rules/base.js";
3
3
  import { browser } from "../rules/browser.js";
4
4
  import { javascript } from "../rules/javascript.js";
5
-
6
5
  /** @type {import("eslint").Linter.Config[]} */
7
6
  export const javascriptBrowserPreset = [
8
- ...base,
9
- ...javascript,
10
- ...browser,
11
- eslintConfigPrettier,
7
+ ...base,
8
+ ...javascript,
9
+ ...browser,
10
+ eslintConfigPrettier,
12
11
  ];
13
-
14
12
  export default javascriptBrowserPreset;
@@ -1,4 +1,3 @@
1
1
  /** @type {import("eslint").Linter.Config[]} */
2
2
  export const javascriptNodePreset: import("eslint").Linter.Config[];
3
3
  export default javascriptNodePreset;
4
- //# sourceMappingURL=javascript-node.d.ts.map
@@ -2,13 +2,11 @@ import eslintConfigPrettier from "eslint-config-prettier";
2
2
  import { base } from "../rules/base.js";
3
3
  import { javascript } from "../rules/javascript.js";
4
4
  import { node } from "../rules/node.js";
5
-
6
5
  /** @type {import("eslint").Linter.Config[]} */
7
6
  export const javascriptNodePreset = [
8
- ...base,
9
- ...javascript,
10
- ...node,
11
- eslintConfigPrettier,
7
+ ...base,
8
+ ...javascript,
9
+ ...node,
10
+ eslintConfigPrettier,
12
11
  ];
13
-
14
12
  export default javascriptNodePreset;
@@ -1,4 +1,3 @@
1
1
  /** @type {import("eslint").Linter.Config[]} */
2
2
  export const javascriptPreset: import("eslint").Linter.Config[];
3
3
  export default javascriptPreset;
4
- //# sourceMappingURL=javascript.d.ts.map
@@ -1,8 +1,6 @@
1
1
  import eslintConfigPrettier from "eslint-config-prettier";
2
2
  import { base } from "../rules/base.js";
3
3
  import { javascript } from "../rules/javascript.js";
4
-
5
4
  /** @type {import("eslint").Linter.Config[]} */
6
5
  export const javascriptPreset = [...base, ...javascript, eslintConfigPrettier];
7
-
8
6
  export default javascriptPreset;
@@ -1,4 +1,3 @@
1
1
  /** @type {import("eslint").Linter.Config[]} */
2
2
  export const typescriptNodePreset: import("eslint").Linter.Config[];
3
3
  export default typescriptNodePreset;
4
- //# sourceMappingURL=typescript-node.d.ts.map
@@ -3,14 +3,12 @@ import { base } from "../rules/base.js";
3
3
  import { javascript } from "../rules/javascript.js";
4
4
  import { node } from "../rules/node.js";
5
5
  import { typescript } from "../rules/typescript.js";
6
-
7
6
  /** @type {import("eslint").Linter.Config[]} */
8
7
  export const typescriptNodePreset = [
9
- ...base,
10
- ...javascript,
11
- ...typescript,
12
- ...node,
13
- eslintConfigPrettier,
8
+ ...base,
9
+ ...javascript,
10
+ ...typescript,
11
+ ...node,
12
+ eslintConfigPrettier,
14
13
  ];
15
-
16
14
  export default typescriptNodePreset;
@@ -1,4 +1,3 @@
1
1
  /** @type {import("eslint").Linter.Config[]} */
2
2
  export const typescriptReactPreset: import("eslint").Linter.Config[];
3
3
  export default typescriptReactPreset;
4
- //# sourceMappingURL=typescript-react.d.ts.map
@@ -4,15 +4,13 @@ import { browser } from "../rules/browser.js";
4
4
  import { javascript } from "../rules/javascript.js";
5
5
  import { react } from "../rules/react.js";
6
6
  import { typescript } from "../rules/typescript.js";
7
-
8
7
  /** @type {import("eslint").Linter.Config[]} */
9
8
  export const typescriptReactPreset = [
10
- ...base,
11
- ...javascript,
12
- ...typescript,
13
- ...react,
14
- ...browser,
15
- eslintConfigPrettier,
9
+ ...base,
10
+ ...javascript,
11
+ ...typescript,
12
+ ...react,
13
+ ...browser,
14
+ eslintConfigPrettier,
16
15
  ];
17
-
18
16
  export default typescriptReactPreset;
@@ -1,4 +1,3 @@
1
1
  /** @type {import("eslint").Linter.Config[]} */
2
2
  export const typescriptPreset: import("eslint").Linter.Config[];
3
3
  export default typescriptPreset;
4
- //# sourceMappingURL=typescript.d.ts.map
@@ -2,13 +2,11 @@ import eslintConfigPrettier from "eslint-config-prettier";
2
2
  import { base } from "../rules/base.js";
3
3
  import { javascript } from "../rules/javascript.js";
4
4
  import { typescript } from "../rules/typescript.js";
5
-
6
5
  /** @type {import("eslint").Linter.Config[]} */
7
6
  export const typescriptPreset = [
8
- ...base,
9
- ...javascript,
10
- ...typescript,
11
- eslintConfigPrettier,
7
+ ...base,
8
+ ...javascript,
9
+ ...typescript,
10
+ eslintConfigPrettier,
12
11
  ];
13
-
14
12
  export default typescriptPreset;
@@ -1,4 +1,3 @@
1
1
  /** @type {import("eslint").Linter.Config[]} */
2
2
  export const base: import("eslint").Linter.Config[];
3
3
  export default base;
4
- //# sourceMappingURL=base.d.ts.map
@@ -1,18 +1,15 @@
1
1
  import fs from "node:fs";
2
2
  import path from "node:path";
3
3
  import { includeIgnoreFile } from "@eslint/compat";
4
-
5
4
  const gitignorePath = path.resolve(process.cwd(), ".gitignore");
6
5
  const gitignoreExists = fs.existsSync(gitignorePath);
7
-
8
6
  /** @type {import("eslint").Linter.Config[]} */
9
7
  export const base = [
10
- gitignoreExists ? includeIgnoreFile(gitignorePath) : {},
11
- {
12
- linterOptions: {
13
- reportUnusedDisableDirectives: "warn",
8
+ gitignoreExists ? includeIgnoreFile(gitignorePath) : {},
9
+ {
10
+ linterOptions: {
11
+ reportUnusedDisableDirectives: "warn",
12
+ },
14
13
  },
15
- },
16
14
  ];
17
-
18
15
  export default base;
@@ -1,4 +1,3 @@
1
1
  /** @type {import("eslint").Linter.Config[]} */
2
2
  export const browser: import("eslint").Linter.Config[];
3
3
  export default browser;
4
- //# sourceMappingURL=browser.d.ts.map
@@ -1,12 +1,10 @@
1
1
  import globals from "globals";
2
-
3
2
  /** @type {import("eslint").Linter.Config[]} */
4
3
  export const browser = [
5
- {
6
- languageOptions: {
7
- globals: { ...globals.browser },
4
+ {
5
+ languageOptions: {
6
+ globals: { ...globals.browser },
7
+ },
8
8
  },
9
- },
10
9
  ];
11
-
12
10
  export default browser;
@@ -1,4 +1,3 @@
1
1
  /** @type {import("eslint").Linter.Config[]} */
2
2
  export const javascript: import("eslint").Linter.Config[];
3
3
  export default javascript;
4
- //# sourceMappingURL=javascript.d.ts.map
@@ -0,0 +1,153 @@
1
+ import js from "@eslint/js";
2
+ import unicornPlugin from "eslint-plugin-unicorn";
3
+ import { globPatterns } from "../lib/glob-patterns.js";
4
+ import { ruleOptions } from "../lib/rule-options.js";
5
+ /** @type {import("eslint").Linter.Config[]} */
6
+ export const javascript = [
7
+ js.configs.recommended,
8
+ unicornPlugin.configs["flat/recommended"],
9
+ {
10
+ rules: {
11
+ // Turn of too opinionated rules
12
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/issues/896
13
+ "unicorn/prevent-abbreviations": "off",
14
+ "unicorn/filename-case": "off",
15
+ // The default of import-style is highly subjective and not always the best choice.
16
+ // E.g. bundlers are able to tree-shake named imports easier than default imports.
17
+ "unicorn/import-style": "off",
18
+ "unicorn/no-nested-ternary": "off",
19
+ "unicorn/no-null": "off",
20
+ "unicorn/no-useless-undefined": "off",
21
+ "unicorn/prefer-query-selector": "off",
22
+ // Also turn off the following rules because they're too opinionated
23
+ "unicorn/require-array-join-separator": "off",
24
+ "unicorn/no-array-for-each": "off",
25
+ "unicorn/no-array-reduce": "off",
26
+ "unicorn/prefer-global-this": "off", // Too many false positives
27
+ "unicorn/prefer-ternary": "off",
28
+ // It makes sense to use Promise.all() with a single promise when we expect more to be added later.
29
+ // In that case we don't want to refactor the code, but just add the new promise.
30
+ "unicorn/no-single-promise-in-promise-methods": "off",
31
+ },
32
+ },
33
+ {
34
+ linterOptions: {
35
+ reportUnusedDisableDirectives: "warn",
36
+ },
37
+ },
38
+ {
39
+ files: globPatterns.javascript,
40
+ languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } },
41
+ },
42
+ {
43
+ rules: {
44
+ // Possible Problems
45
+ // ----------------------------------------------
46
+ "array-callback-return": "warn", // https://eslint.org/docs/latest/rules/array-callback-return
47
+ "no-await-in-loop": "warn", // https://eslint.org/docs/latest/rules/no-await-in-loop
48
+ "no-constructor-return": "warn", // https://eslint.org/docs/latest/rules/no-constructor-return
49
+ "no-duplicate-imports": "warn", // https://eslint.org/docs/latest/rules/no-duplicate-imports
50
+ "no-promise-executor-return": "warn", // https://eslint.org/docs/latest/rules/no-promise-executor-return
51
+ "no-self-compare": "warn", // https://eslint.org/docs/latest/rules/no-self-compare
52
+ "no-template-curly-in-string": "warn", // https://eslint.org/docs/latest/rules/no-template-curly-in-string
53
+ "no-unmodified-loop-condition": "warn", // https://eslint.org/docs/latest/rules/no-unmodified-loop-condition
54
+ "no-unreachable-loop": "warn", // https://eslint.org/docs/latest/rules/no-unreachable-loop
55
+ "no-useless-assignment": "warn", // https://eslint.org/docs/latest/rules/no-useless-assignment
56
+ "require-atomic-updates": "warn", // https://eslint.org/docs/latest/rules/require-atomic-updates
57
+ // Suggestions
58
+ // ----------------------------------------------
59
+ "accessor-pairs": "warn", // https://eslint.org/docs/latest/rules/accessor-pairs
60
+ "block-scoped-var": "warn", // https://eslint.org/docs/latest/rules/block-scoped-var
61
+ camelcase: ["warn", ruleOptions.camelcase], // https://eslint.org/docs/latest/rules/camelcase
62
+ "consistent-return": "warn", // https://eslint.org/docs/latest/rules/consistent-return
63
+ "dot-notation": "warn", // https://eslint.org/docs/latest/rules/dot-notation
64
+ eqeqeq: ["warn", "always", { null: "ignore" }], // https://eslint.org/docs/latest/rules/eqeqeq
65
+ "func-style": ["warn", "declaration"], // https://eslint.org/docs/latest/rules/func-style
66
+ "grouped-accessor-pairs": ["warn", "setBeforeGet"], // https://eslint.org/docs/latest/rules/grouped-accessor-pairs
67
+ "max-depth": ["warn", 5], // https://eslint.org/docs/latest/rules/max-depth
68
+ "max-nested-callbacks": ["warn", 3], // https://eslint.org/docs/latest/rules/max-nested-callbacks
69
+ "max-params": ["warn", { max: 4 }], // https://eslint.org/docs/latest/rules/max-params
70
+ "new-cap": "warn", // https://eslint.org/docs/latest/rules/new-cap
71
+ "no-alert": "warn", // https://eslint.org/docs/latest/rules/no-alert
72
+ "no-array-constructor": "warn", // https://eslint.org/docs/latest/rules/no-array-constructor
73
+ "no-bitwise": "warn", // https://eslint.org/docs/latest/rules/no-bitwise
74
+ "no-caller": "warn", // https://eslint.org/docs/latest/rules/no-caller
75
+ "no-else-return": "warn", // https://eslint.org/docs/latest/rules/no-else-return
76
+ "no-eval": "warn", // https://eslint.org/docs/latest/rules/no-eval
77
+ "no-extend-native": "warn", // https://eslint.org/docs/latest/rules/no-extend-native
78
+ "no-extra-bind": "warn", // https://eslint.org/docs/latest/rules/no-extra-bind
79
+ "no-extra-label": "warn", // https://eslint.org/docs/latest/rules/no-extra-label
80
+ "no-implicit-globals": "warn", // https://eslint.org/docs/latest/rules/no-implicit-globals
81
+ "no-implied-eval": "warn", // https://eslint.org/docs/latest/rules/no-implied-eval
82
+ "no-iterator": "warn", // https://eslint.org/docs/latest/rules/no-iterator
83
+ "no-label-var": "warn", // https://eslint.org/docs/latest/rules/no-label-var
84
+ "no-labels": "warn", // https://eslint.org/docs/latest/rules/no-labels
85
+ "no-lone-blocks": "warn", // https://eslint.org/docs/latest/rules/no-lone-blocks
86
+ "no-multi-str": "warn", // https://eslint.org/docs/latest/rules/no-multi-str
87
+ "no-negated-condition": "warn", // https://eslint.org/docs/latest/rules/no-negated-condition
88
+ "no-new": "warn", // https://eslint.org/docs/latest/rules/no-new
89
+ "no-new-func": "warn", // https://eslint.org/docs/latest/rules/no-new-func
90
+ "no-new-wrappers": "warn", // https://eslint.org/docs/latest/rules/no-new-wrappers
91
+ "no-object-constructor": "warn", // https://eslint.org/docs/latest/rules/no-object-constructor
92
+ "no-octal-escape": "warn", // https://eslint.org/docs/latest/rules/no-octal-escape
93
+ "no-proto": "warn", // https://eslint.org/docs/latest/rules/no-proto
94
+ "no-restricted-exports": [
95
+ "warn",
96
+ {
97
+ restrictedNamedExports: [
98
+ // If "then" is a function, the module will not be loadedable by an async import()
99
+ // because it looks like a promise. The JS engine will call the .then() function in that case
100
+ // Since this is super confusing, let's warn the user about it
101
+ "then",
102
+ ],
103
+ },
104
+ ], // https://eslint.org/docs/latest/rules/no-restricted-exports
105
+ "no-restricted-globals": ["warn", "event"], // https://eslint.org/docs/latest/rules/no-restricted-globals
106
+ "no-restricted-syntax": ["warn", "WithStatement"], // https://eslint.org/docs/latest/rules/no-restricted-syntax
107
+ "no-script-url": "warn", // https://eslint.org/docs/latest/rules/no-script-url
108
+ "no-sequences": "warn", // https://eslint.org/docs/latest/rules/no-sequences
109
+ "no-throw-literal": "warn", // https://eslint.org/docs/latest/rules/no-throw-literal
110
+ "no-undef-init": "warn", // https://eslint.org/docs/latest/rules/no-undef-init
111
+ "no-unneeded-ternary": "warn", // https://eslint.org/docs/latest/rules/no-unneeded-ternary
112
+ "no-unused-expressions": ["warn", ruleOptions["no-unused-expressions"]], // https://eslint.org/docs/latest/rules/no-unused-expressions
113
+ "no-unused-vars": ["error", ruleOptions["no-unused-vars"]],
114
+ "no-useless-call": "warn", // https://eslint.org/docs/latest/rules/no-useless-call
115
+ "no-useless-computed-key": "warn", // https://eslint.org/docs/latest/rules/no-useless-computed-key
116
+ "no-useless-concat": "warn", // https://eslint.org/docs/latest/rules/no-useless-concat
117
+ "no-useless-constructor": "warn", // https://eslint.org/docs/latest/rules/no-useless-constructor
118
+ "no-useless-escape": "warn", // https://eslint.org/docs/latest/rules/no-useless-escape
119
+ "no-useless-rename": "warn", // https://eslint.org/docs/latest/rules/no-useless-rename
120
+ "no-useless-return": "warn", // https://eslint.org/docs/latest/rules/no-useless-return
121
+ "no-var": "warn", // https://eslint.org/docs/latest/rules/no-var
122
+ "object-shorthand": ["warn", "always"], // https://eslint.org/docs/latest/rules/object-shorthand
123
+ "one-var": ["warn", "never"], // https://eslint.org/docs/latest/rules/one-var
124
+ "prefer-arrow-callback": "warn", // https://eslint.org/docs/latest/rules/prefer-arrow-callback
125
+ "prefer-const": "warn", // https://eslint.org/docs/latest/rules/prefer-const
126
+ "prefer-exponentiation-operator": "warn", // https://eslint.org/docs/latest/rules/prefer-exponentiation-operator
127
+ "prefer-numeric-literals": "warn", // https://eslint.org/docs/latest/rules/prefer-numeric-literals
128
+ "prefer-object-has-own": "warn", // https://eslint.org/docs/latest/rules/prefer-object-has-own
129
+ "prefer-promise-reject-errors": "warn", // https://eslint.org/docs/latest/rules/prefer-promise-reject-errors
130
+ "prefer-regex-literals": "warn", // https://eslint.org/docs/latest/rules/prefer-regex-literals
131
+ "prefer-rest-params": "warn", // https://eslint.org/docs/latest/rules/prefer-rest-params
132
+ "prefer-spread": "warn", // https://eslint.org/docs/latest/rules/prefer-spread
133
+ strict: "warn", // https://eslint.org/docs/latest/rules/strict
134
+ "symbol-description": "warn", // https://eslint.org/docs/latest/rules/symbol-description
135
+ yoda: ["warn", "never"], // https://eslint.org/docs/latest/rules/yoda
136
+ // Layout & Formatting
137
+ // ----------------------------------------------
138
+ "unicode-bom": "warn", // https://eslint.org/docs/latest/rules/unicode-bom
139
+ },
140
+ },
141
+ {
142
+ files: globPatterns.tests,
143
+ rules: {
144
+ // Top-level await might slow down the test suite start up
145
+ "unicorn/prefer-top-level-await": "off",
146
+ // Nesting is pretty common in tests when you group tests
147
+ "max-nested-callbacks": "off",
148
+ // In case you want to test errors thrown by a constructor
149
+ "no-new": "off",
150
+ },
151
+ },
152
+ ];
153
+ export default javascript;
@@ -1,4 +1,3 @@
1
1
  /** @type {import("eslint").Linter.Config[]} */
2
2
  export const node: import("eslint").Linter.Config[];
3
3
  export default node;
4
- //# sourceMappingURL=node.d.ts.map
@@ -1,12 +1,10 @@
1
1
  import globals from "globals";
2
-
3
2
  /** @type {import("eslint").Linter.Config[]} */
4
3
  export const node = [
5
- {
6
- languageOptions: {
7
- globals: { ...globals.node },
4
+ {
5
+ languageOptions: {
6
+ globals: { ...globals.node },
7
+ },
8
8
  },
9
- },
10
9
  ];
11
-
12
10
  export default node;
@@ -1,4 +1,3 @@
1
1
  /** @type {import("eslint").Linter.Config[]} */
2
2
  export const react: import("eslint").Linter.Config[];
3
3
  export default react;
4
- //# sourceMappingURL=react.d.ts.map