Skip to content

Commit 350f8f0

Browse files
chore: ncu -u
1 parent 5b46ccf commit 350f8f0

7 files changed

+177
-224
lines changed

eslint.config.js

+25-69
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,74 @@
1-
import eslint from "@eslint/js";
21
import comments from "@eslint-community/eslint-plugin-eslint-comments/configs";
2+
import eslint from "@eslint/js";
33
import jsdoc from "eslint-plugin-jsdoc";
44
import jsonc from "eslint-plugin-jsonc";
55
import markdown from "eslint-plugin-markdown";
66
import n from "eslint-plugin-n";
77
import packageJson from "eslint-plugin-package-json/configs/recommended";
8-
import perfectionistNatural from "eslint-plugin-perfectionist/configs/recommended-natural";
8+
import perfectionist from "eslint-plugin-perfectionist";
99
import * as regexp from "eslint-plugin-regexp";
1010
import yml from "eslint-plugin-yml";
1111
import tseslint from "typescript-eslint";
1212

1313
export default tseslint.config(
14-
{
15-
ignores: ["cases", "node_modules", "projects"],
16-
},
17-
{
18-
linterOptions: {
19-
reportUnusedDisableDirectives: "error",
20-
},
21-
},
14+
{ ignores: ["cases", "node_modules", "projects"] },
15+
{ linterOptions: { reportUnusedDisableDirectives: "error" } },
2216
eslint.configs.recommended,
23-
...jsonc.configs["flat/recommended-with-json"],
24-
...markdown.configs.recommended,
25-
...yml.configs["flat/recommended"],
26-
...yml.configs["flat/prettier"],
2717
comments.recommended,
28-
jsdoc.configs["flat/recommended-typescript-error"],
18+
jsdoc.configs["flat/contents-typescript-error"],
19+
jsdoc.configs["flat/logical-typescript-error"],
20+
jsdoc.configs["flat/stylistic-typescript-error"],
21+
jsonc.configs["flat/recommended-with-json"],
22+
markdown.configs.recommended,
2923
n.configs["flat/recommended"],
3024
packageJson,
31-
perfectionistNatural,
25+
perfectionist.configs["recommended-natural"],
3226
regexp.configs["flat/recommended"],
33-
...tseslint.config({
27+
{
3428
extends: [
35-
...tseslint.configs.strictTypeChecked,
36-
...tseslint.configs.stylisticTypeChecked,
29+
tseslint.configs.strictTypeChecked,
30+
tseslint.configs.stylisticTypeChecked,
3731
],
3832
files: ["**/*.js", "**/*.ts"],
3933
languageOptions: {
4034
parserOptions: {
4135
projectService: {
42-
allowDefaultProjectForFiles: ["./*.*s", "eslint.config.js"],
43-
defaultProject: "./tsconfig.json",
36+
allowDefaultProject: ["./*.*s", "eslint.config.js"],
4437
},
38+
tsconfigRootDir: import.meta.dirname,
4539
},
4640
},
4741
rules: {
48-
// These off-by-default rules work well for this repo and we like them on.
49-
"jsdoc/informative-docs": "error",
50-
"logical-assignment-operators": [
51-
"error",
52-
"always",
53-
{ enforceForIfStatements: true },
54-
],
55-
"operator-assignment": "error",
56-
57-
// These on-by-default rules don't work well for this repo and we like them off.
58-
"jsdoc/require-jsdoc": "off",
59-
"jsdoc/require-param": "off",
60-
"jsdoc/require-property": "off",
61-
"jsdoc/require-returns": "off",
62-
"no-constant-condition": "off",
63-
6442
// These on-by-default rules work well for this repo if configured
65-
"@typescript-eslint/no-unused-vars": ["error", { caughtErrors: "all" }],
6643
"@typescript-eslint/restrict-template-expressions": [
6744
"error",
6845
{ allowNumber: true },
6946
],
70-
"perfectionist/sort-objects": [
71-
"error",
72-
{
73-
order: "asc",
74-
"partition-by-comment": true,
75-
type: "natural",
76-
},
77-
],
7847

7948
// Stylistic concerns that don't interfere with Prettier
49+
"logical-assignment-operators": [
50+
"error",
51+
"always",
52+
{ enforceForIfStatements: true },
53+
],
8054
"no-useless-rename": "error",
8155
"object-shorthand": "error",
56+
"operator-assignment": "error",
8257
},
83-
}),
84-
{
85-
files: ["*.jsonc"],
86-
rules: {
87-
"jsonc/comma-dangle": "off",
88-
"jsonc/no-comments": "off",
89-
"jsonc/sort-keys": "error",
90-
},
91-
},
92-
{
93-
extends: [tseslint.configs.disableTypeChecked],
94-
files: ["**/*.md/*.ts"],
95-
rules: {
96-
"n/no-missing-import": ["error", { allowModules: ["performance"] }],
97-
},
58+
settings: { perfectionist: { partitionByComment: true, type: "natural" } },
9859
},
9960
{
61+
extends: [yml.configs["flat/recommended"], yml.configs["flat/prettier"]],
10062
files: ["**/*.{yml,yaml}"],
10163
rules: {
10264
"yml/file-extension": ["error", { extension: "yml" }],
10365
"yml/sort-keys": [
10466
"error",
105-
{
106-
order: { type: "asc" },
107-
pathPattern: "^.*$",
108-
},
67+
{ order: { type: "asc" }, pathPattern: "^.*$" },
10968
],
11069
"yml/sort-sequence-values": [
11170
"error",
112-
{
113-
order: { type: "asc" },
114-
pathPattern: "^.*$",
115-
},
71+
{ order: { type: "asc" }, pathPattern: "^.*$" },
11672
],
11773
},
11874
},

package.json

+30-33
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "performance",
3+
"version": "0.0.0",
34
"private": true,
45
"description": "Various performance baselines for typescript-eslint.",
56
"repository": {
@@ -36,48 +37,44 @@
3637
"*": "prettier --ignore-unknown --write"
3738
},
3839
"dependencies": {
39-
"console-table-without-index": "^0.1.0",
40-
"execa": "^9.3.0",
41-
"prettier": "^3.3.2"
40+
"console-table-without-index": "^0.1.1",
41+
"execa": "^9.5.2",
42+
"prettier": "^3.5.3"
4243
},
4344
"devDependencies": {
44-
"@eslint-community/eslint-plugin-eslint-comments": "^4.3.0",
45-
"@eslint/js": "^9.6.0",
45+
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
46+
"@eslint/js": "^9.21.0",
4647
"@types/eslint-plugin-markdown": "^2.0.2",
47-
"@types/eslint__js": "^8.42.3",
48-
"@types/node": "^20.14.10",
49-
"cspell": "^8.10.4",
50-
"eslint": "^9.6.0",
51-
"eslint-plugin-jsdoc": "^48.7.0",
52-
"eslint-plugin-jsonc": "^2.16.0",
53-
"eslint-plugin-markdown": "^5.0.0",
54-
"eslint-plugin-n": "^17.9.0",
55-
"eslint-plugin-package-json": "^0.15.2",
56-
"eslint-plugin-perfectionist": "^2.11.0",
57-
"eslint-plugin-regexp": "^2.6.0",
58-
"eslint-plugin-yml": "^1.14.0",
59-
"husky": "^9.0.11",
48+
"@types/eslint__js": "^9.14.0",
49+
"@types/node": "^22.13.9",
50+
"cspell": "^8.17.5",
51+
"eslint": "^9.21.0",
52+
"eslint-plugin-jsdoc": "^50.6.3",
53+
"eslint-plugin-jsonc": "^2.19.1",
54+
"eslint-plugin-markdown": "^5.1.0",
55+
"eslint-plugin-n": "^17.16.1",
56+
"eslint-plugin-package-json": "^0.26.1",
57+
"eslint-plugin-perfectionist": "^4.9.0",
58+
"eslint-plugin-regexp": "^2.7.0",
59+
"eslint-plugin-yml": "^1.17.0",
60+
"husky": "^9.1.7",
6061
"jsonc-eslint-parser": "^2.4.0",
61-
"knip": "^5.25.2",
62-
"lint-staged": "^15.2.7",
63-
"markdownlint": "^0.34.0",
64-
"markdownlint-cli": "^0.41.0",
65-
"prettier-plugin-curly": "^0.2.1",
66-
"prettier-plugin-packagejson": "^2.5.0",
67-
"prettier-plugin-sh": "^0.14.0",
68-
"sentences-per-line": "^0.2.1",
69-
"tsx": "^4.16.2",
70-
"typescript": "5.5.3",
71-
"typescript-eslint": "8.0.0-alpha.44"
62+
"knip": "^5.45.0",
63+
"lint-staged": "^15.4.3",
64+
"markdownlint": "^0.37.4",
65+
"markdownlint-cli": "^0.44.0",
66+
"prettier-plugin-curly": "^0.3.1",
67+
"prettier-plugin-packagejson": "^2.5.10",
68+
"prettier-plugin-sh": "^0.15.0",
69+
"sentences-per-line": "^0.3.0",
70+
"tsx": "^4.19.3",
71+
"typescript": "5.8.2",
72+
"typescript-eslint": "8.26.0"
7273
},
7374
"engines": {
7475
"node": ">=22"
7576
},
7677
"publishConfig": {
7778
"provenance": true
78-
},
79-
"overrides": {
80-
"@typescript-eslint/utils": "8.0.0-alpha.44",
81-
"typescript@*": "5.5.3"
8279
}
8380
}

src/creators/cases/createEvenCaseFiles.ts

+44-44
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,50 @@ import { createESLintConfigFile } from "../files/createESLintConfigFile.js";
44
import { createStandardTSConfigFile } from "../files/createStandardTSConfigFile.js";
55
import { range } from "../utils.js";
66

7+
export function writeEvenCaseFiles(data: CaseData): Structure {
8+
const topLevelWidth = Math.floor(Math.log(data.files) * 1.7);
9+
10+
return {
11+
"eslint.config.js": [
12+
createESLintConfigFile({
13+
singleRun: data.singleRun,
14+
types:
15+
data.types === "service"
16+
? "projectService"
17+
: data.layout === "references"
18+
? "tsconfig.eslint.json"
19+
: true,
20+
}),
21+
"typescript",
22+
],
23+
src: {
24+
"index.ts": [createIndexFile(topLevelWidth), "typescript"],
25+
...Object.fromEntries(
26+
new Array(topLevelWidth)
27+
.fill(undefined)
28+
.map((_, index) => [
29+
`example${index}`,
30+
createExampleDirectory(index),
31+
]),
32+
),
33+
},
34+
"tsconfig.json": [createStandardTSConfigFile(), "json"],
35+
};
36+
}
37+
38+
function createExampleDirectory(index: number): Structure {
39+
return {
40+
"index.ts": [createExampleFile(index), "typescript"],
41+
...(index > 2 &&
42+
Object.fromEntries(
43+
range(1, index).map((i) => [
44+
`nested${i}`,
45+
createExampleDirectory(i - 1),
46+
]),
47+
)),
48+
};
49+
}
50+
751
function createExampleFile(index: number) {
852
return [
953
index > 1 &&
@@ -21,19 +65,6 @@ function createExampleFile(index: number) {
2165
.join("\n\n");
2266
}
2367

24-
function createExampleDirectory(index: number): Structure {
25-
return {
26-
"index.ts": [createExampleFile(index), "typescript"],
27-
...(index > 2 &&
28-
Object.fromEntries(
29-
range(1, index).map((i) => [
30-
`nested${i}`,
31-
createExampleDirectory(i - 1),
32-
]),
33-
)),
34-
};
35-
}
36-
3768
function createIndexFile(count: number) {
3869
const indices = range(0, count);
3970

@@ -51,34 +82,3 @@ function createIndexFile(count: number) {
5182
${indices.map((index) => `export { example${index} } from "./example${index}/index.js";`).join("\n\t\t")}
5283
`;
5384
}
54-
55-
export function writeEvenCaseFiles(data: CaseData): Structure {
56-
const topLevelWidth = Math.floor(Math.log(data.files) * 1.7);
57-
58-
return {
59-
"eslint.config.js": [
60-
createESLintConfigFile({
61-
singleRun: data.singleRun,
62-
types:
63-
data.types === "service"
64-
? "projectService"
65-
: data.layout === "references"
66-
? "tsconfig.eslint.json"
67-
: true,
68-
}),
69-
"typescript",
70-
],
71-
src: {
72-
"index.ts": [createIndexFile(topLevelWidth), "typescript"],
73-
...Object.fromEntries(
74-
new Array(topLevelWidth)
75-
.fill(undefined)
76-
.map((_, index) => [
77-
`example${index}`,
78-
createExampleDirectory(index),
79-
]),
80-
),
81-
},
82-
"tsconfig.json": [createStandardTSConfigFile(), "json"],
83-
};
84-
}

0 commit comments

Comments
 (0)