Skip to content

Commit 3826794

Browse files
committed
Merge branch 'main' into react-dom/no-render
2 parents b4c3914 + 6a06d53 commit 3826794

File tree

83 files changed

+2263
-2396
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+2263
-2396
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
node_modules/
33

44
# Build
5-
dist/
5+
!dist/
66
out/
77
build
88
docs/internals/

.pkgs/configs/eslint.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import tseslint from "typescript-eslint";
2+
type ConfigArray = ReturnType<typeof tseslint.config>;
3+
export declare const typescript: ConfigArray;
4+
export {};

.pkgs/configs/eslint.js

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
import js from "@eslint/js";
2+
import stylistic from "@stylistic/eslint-plugin";
3+
import pluginDeMorgan from "eslint-plugin-de-morgan";
4+
import pluginJsdoc from "eslint-plugin-jsdoc";
5+
import pluginPerfectionist from "eslint-plugin-perfectionist";
6+
import pluginRegexp from "eslint-plugin-regexp";
7+
import pluginSimpleImportSort from "eslint-plugin-simple-import-sort";
8+
import pluginUnicorn from "eslint-plugin-unicorn";
9+
import tseslint from "typescript-eslint";
10+
const GLOB_TS = ["*.{ts,tsx,cts,mts}", "**/*.{ts,tsx,cts,mts}"];
11+
const templateIndentAnnotations = [
12+
"outdent",
13+
"dedent",
14+
"html",
15+
"tsx",
16+
"ts",
17+
];
18+
const p11tOptions = {
19+
type: "natural",
20+
ignoreCase: false,
21+
};
22+
const p11tGroups = {
23+
customGroups: {
24+
id: ["^_$", "^id$", "^key$", "^self$"],
25+
type: ["^type$", "^kind$"],
26+
meta: [
27+
"^name$",
28+
"^meta$",
29+
"^title$",
30+
"^description$",
31+
],
32+
alias: ["^alias$", "^as$"],
33+
rules: ["^node$", "^messageId$"],
34+
},
35+
groups: ["id", "type", "meta", "alias", "rules", "unknown"],
36+
};
37+
export const typescript = tseslint.config({
38+
extends: [
39+
js.configs.recommended,
40+
...tseslint.configs.strict,
41+
pluginDeMorgan.configs.recommended,
42+
pluginJsdoc.configs["flat/recommended-typescript-error"],
43+
pluginRegexp.configs["flat/recommended"],
44+
pluginPerfectionist.configs["recommended-natural"],
45+
],
46+
files: GLOB_TS,
47+
plugins: {
48+
["@stylistic"]: stylistic,
49+
["simple-import-sort"]: pluginSimpleImportSort,
50+
["unicorn"]: pluginUnicorn,
51+
},
52+
rules: {
53+
eqeqeq: ["error", "smart"],
54+
"no-console": "error",
55+
"no-else-return": "error",
56+
"no-fallthrough": ["error", { commentPattern: ".*intentional fallthrough.*" }],
57+
"no-implicit-coercion": ["error", { allow: ["!!"] }],
58+
"no-mixed-operators": "warn",
59+
"no-undef": "off",
60+
"prefer-object-has-own": "error",
61+
// Part: custom rules
62+
"no-restricted-syntax": [
63+
"error",
64+
{
65+
message: "no optional",
66+
selector: "TSPropertySignature[optional=true]",
67+
},
68+
],
69+
// Part: typescript-eslint rules
70+
"@typescript-eslint/ban-ts-comment": [
71+
"error",
72+
{
73+
minimumDescriptionLength: 5,
74+
"ts-check": false,
75+
"ts-expect-error": "allow-with-description",
76+
"ts-ignore": true,
77+
"ts-nocheck": true,
78+
},
79+
],
80+
"@typescript-eslint/ban-types": "off",
81+
"@typescript-eslint/consistent-type-exports": "error",
82+
"@typescript-eslint/consistent-type-imports": "error",
83+
"@typescript-eslint/explicit-function-return-type": "off",
84+
"@typescript-eslint/no-empty-object-type": "off",
85+
"@typescript-eslint/no-misused-promises": "off",
86+
"@typescript-eslint/no-namespace": "off",
87+
"@typescript-eslint/no-unnecessary-parameter-property-assignment": "warn",
88+
"@typescript-eslint/no-unused-vars": ["warn", { caughtErrors: "all" }],
89+
"@typescript-eslint/strict-boolean-expressions": ["error", {
90+
allowAny: false,
91+
allowNullableBoolean: false,
92+
allowNullableEnum: false,
93+
allowNullableNumber: false,
94+
allowNullableObject: false,
95+
allowNullableString: false,
96+
allowNumber: true,
97+
allowString: false,
98+
}],
99+
// Part: jsdoc rules
100+
"jsdoc/check-param-names": "warn",
101+
"jsdoc/check-tag-names": "warn",
102+
"jsdoc/informative-docs": "off",
103+
"jsdoc/lines-before-block": "off",
104+
"jsdoc/require-jsdoc": "off",
105+
"jsdoc/require-param": "warn",
106+
"jsdoc/require-param-description": "warn",
107+
"jsdoc/require-returns": "off",
108+
"jsdoc/require-yields": "warn",
109+
"jsdoc/tag-lines": "off",
110+
// Part: simple-import-sort rules
111+
"simple-import-sort/exports": "warn",
112+
"simple-import-sort/imports": "warn",
113+
// Part: stylistic rules
114+
"@stylistic/arrow-parens": ["warn", "always"],
115+
"@stylistic/no-multi-spaces": ["warn"],
116+
"@stylistic/operator-linebreak": [
117+
"warn",
118+
"before",
119+
],
120+
"@stylistic/quote-props": ["error", "as-needed"],
121+
// Part: perfectionist rules
122+
"perfectionist/sort-exports": "off",
123+
"perfectionist/sort-imports": "off",
124+
"perfectionist/sort-interfaces": [
125+
"warn",
126+
{
127+
...p11tOptions,
128+
...p11tGroups,
129+
},
130+
],
131+
"perfectionist/sort-intersection-types": "off",
132+
"perfectionist/sort-modules": "off",
133+
"perfectionist/sort-named-exports": "off",
134+
"perfectionist/sort-named-imports": "off",
135+
"perfectionist/sort-object-types": [
136+
"warn",
137+
{
138+
...p11tOptions,
139+
...p11tGroups,
140+
},
141+
],
142+
"perfectionist/sort-objects": [
143+
"warn",
144+
{
145+
...p11tOptions,
146+
...p11tGroups,
147+
partitionByComment: "^Part:.*",
148+
},
149+
],
150+
"perfectionist/sort-switch-case": "off",
151+
"perfectionist/sort-union-types": "off",
152+
// Part: unicorn rules
153+
"unicorn/template-indent": [
154+
"warn",
155+
{
156+
comments: templateIndentAnnotations,
157+
tags: templateIndentAnnotations,
158+
},
159+
],
160+
},
161+
});

.pkgs/configs/eslint.ts

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
import js from "@eslint/js";
2+
import stylistic from "@stylistic/eslint-plugin";
3+
import pluginDeMorgan from "eslint-plugin-de-morgan";
4+
import pluginJsdoc from "eslint-plugin-jsdoc";
5+
import pluginPerfectionist from "eslint-plugin-perfectionist";
6+
import pluginRegexp from "eslint-plugin-regexp";
7+
import pluginSimpleImportSort from "eslint-plugin-simple-import-sort";
8+
import pluginUnicorn from "eslint-plugin-unicorn";
9+
import tseslint from "typescript-eslint";
10+
11+
type ConfigArray = ReturnType<typeof tseslint.config>;
12+
13+
const GLOB_TS = ["*.{ts,tsx,cts,mts}", "**/*.{ts,tsx,cts,mts}"];
14+
15+
const templateIndentAnnotations = [
16+
"outdent",
17+
"dedent",
18+
"html",
19+
"tsx",
20+
"ts",
21+
];
22+
23+
const p11tOptions = {
24+
type: "natural",
25+
ignoreCase: false,
26+
};
27+
28+
const p11tGroups = {
29+
customGroups: {
30+
id: ["^_$", "^id$", "^key$", "^self$"],
31+
type: ["^type$", "^kind$"],
32+
meta: [
33+
"^name$",
34+
"^meta$",
35+
"^title$",
36+
"^description$",
37+
],
38+
alias: ["^alias$", "^as$"],
39+
rules: ["^node$", "^messageId$"],
40+
},
41+
groups: ["id", "type", "meta", "alias", "rules", "unknown"],
42+
};
43+
44+
export const typescript: ConfigArray = tseslint.config({
45+
extends: [
46+
js.configs.recommended,
47+
...tseslint.configs.strict,
48+
pluginDeMorgan.configs.recommended,
49+
pluginJsdoc.configs["flat/recommended-typescript-error"],
50+
pluginRegexp.configs["flat/recommended"],
51+
pluginPerfectionist.configs["recommended-natural"],
52+
],
53+
files: GLOB_TS,
54+
plugins: {
55+
["@stylistic"]: stylistic,
56+
["simple-import-sort"]: pluginSimpleImportSort,
57+
["unicorn"]: pluginUnicorn,
58+
},
59+
rules: {
60+
eqeqeq: ["error", "smart"],
61+
"no-console": "error",
62+
"no-else-return": "error",
63+
"no-fallthrough": ["error", { commentPattern: ".*intentional fallthrough.*" }],
64+
"no-implicit-coercion": ["error", { allow: ["!!"] }],
65+
"no-mixed-operators": "warn",
66+
"no-undef": "off",
67+
"prefer-object-has-own": "error",
68+
// Part: custom rules
69+
"no-restricted-syntax": [
70+
"error",
71+
{
72+
message: "no optional",
73+
selector: "TSPropertySignature[optional=true]",
74+
},
75+
],
76+
// Part: typescript-eslint rules
77+
"@typescript-eslint/ban-ts-comment": [
78+
"error",
79+
{
80+
minimumDescriptionLength: 5,
81+
"ts-check": false,
82+
"ts-expect-error": "allow-with-description",
83+
"ts-ignore": true,
84+
"ts-nocheck": true,
85+
},
86+
],
87+
"@typescript-eslint/ban-types": "off",
88+
"@typescript-eslint/consistent-type-exports": "error",
89+
"@typescript-eslint/consistent-type-imports": "error",
90+
"@typescript-eslint/explicit-function-return-type": "off",
91+
"@typescript-eslint/no-empty-object-type": "off",
92+
"@typescript-eslint/no-misused-promises": "off",
93+
"@typescript-eslint/no-namespace": "off",
94+
"@typescript-eslint/no-unnecessary-parameter-property-assignment": "warn",
95+
"@typescript-eslint/no-unused-vars": ["warn", { caughtErrors: "all" }],
96+
"@typescript-eslint/strict-boolean-expressions": ["error", {
97+
allowAny: false,
98+
allowNullableBoolean: false,
99+
allowNullableEnum: false,
100+
allowNullableNumber: false,
101+
allowNullableObject: false,
102+
allowNullableString: false,
103+
allowNumber: true,
104+
allowString: false,
105+
}],
106+
// Part: jsdoc rules
107+
"jsdoc/check-param-names": "warn",
108+
"jsdoc/check-tag-names": "warn",
109+
"jsdoc/informative-docs": "off",
110+
"jsdoc/lines-before-block": "off",
111+
"jsdoc/require-jsdoc": "off",
112+
"jsdoc/require-param": "warn",
113+
"jsdoc/require-param-description": "warn",
114+
"jsdoc/require-returns": "off",
115+
"jsdoc/require-yields": "warn",
116+
"jsdoc/tag-lines": "off",
117+
// Part: simple-import-sort rules
118+
"simple-import-sort/exports": "warn",
119+
"simple-import-sort/imports": "warn",
120+
// Part: stylistic rules
121+
"@stylistic/arrow-parens": ["warn", "always"],
122+
"@stylistic/no-multi-spaces": ["warn"],
123+
"@stylistic/operator-linebreak": [
124+
"warn",
125+
"before",
126+
],
127+
"@stylistic/quote-props": ["error", "as-needed"],
128+
// Part: perfectionist rules
129+
"perfectionist/sort-exports": "off",
130+
"perfectionist/sort-imports": "off",
131+
"perfectionist/sort-interfaces": [
132+
"warn",
133+
{
134+
...p11tOptions,
135+
...p11tGroups,
136+
},
137+
],
138+
"perfectionist/sort-intersection-types": "off",
139+
"perfectionist/sort-modules": "off",
140+
"perfectionist/sort-named-exports": "off",
141+
"perfectionist/sort-named-imports": "off",
142+
"perfectionist/sort-object-types": [
143+
"warn",
144+
{
145+
...p11tOptions,
146+
...p11tGroups,
147+
},
148+
],
149+
"perfectionist/sort-objects": [
150+
"warn",
151+
{
152+
...p11tOptions,
153+
...p11tGroups,
154+
partitionByComment: "^Part:.*",
155+
},
156+
],
157+
"perfectionist/sort-switch-case": "off",
158+
"perfectionist/sort-union-types": "off",
159+
// Part: unicorn rules
160+
"unicorn/template-indent": [
161+
"warn",
162+
{
163+
comments: templateIndentAnnotations,
164+
tags: templateIndentAnnotations,
165+
},
166+
],
167+
},
168+
});

.pkgs/configs/package.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,29 @@
44
"private": true,
55
"description": "Local config bases for use in the workspace",
66
"sideEffects": false,
7+
"type": "module",
78
"exports": {
9+
"./eslint": {
10+
"types": "./eslint.d.ts",
11+
"import": "./eslint.js"
12+
},
813
"./tsconfig.base.json": "./tsconfig.base.json",
914
"./typedoc.base.json": "./typedoc.base.json"
15+
},
16+
"scripts": {
17+
"build": "tsc -p tsconfig.json",
18+
"lint:publish": "publint",
19+
"lint:ts": "tsc --noEmit"
20+
},
21+
"dependencies": {
22+
"@eslint/js": "^9.22.0",
23+
"@stylistic/eslint-plugin": "^4.2.0",
24+
"eslint-plugin-de-morgan": "^1.2.0",
25+
"eslint-plugin-jsdoc": "^50.6.6",
26+
"eslint-plugin-perfectionist": "^4.10.1",
27+
"eslint-plugin-regexp": "^2.7.0",
28+
"eslint-plugin-simple-import-sort": "^12.1.1",
29+
"eslint-plugin-unicorn": "^57.0.0",
30+
"typescript-eslint": "^8.26.1"
1031
}
1132
}

0 commit comments

Comments
 (0)