Skip to content

Commit 8f2dbee

Browse files
authored
chore: use eslint v9 and flat config (#749)
* chore: use eslint v9 and flat config * revert ci workflow
1 parent 4547f6e commit 8f2dbee

26 files changed

+3317
-1797
lines changed

.changeset/config.json

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
2-
"$schema": "https://unpkg.com/@changesets/config/schema.json",
3-
"changelog": [
4-
"@svitejs/changesets-changelog-github-compact",
5-
{
6-
"repo": "ota-meshi/eslint-plugin-regexp"
7-
}
8-
],
9-
"commit": false,
10-
"linked": [],
11-
"access": "restricted",
12-
"baseBranch": "master",
13-
"updateInternalDependencies": "patch",
14-
"bumpVersionsWithWorkspaceProtocolOnly": true,
15-
"ignore": []
2+
"$schema": "https://unpkg.com/@changesets/config/schema.json",
3+
"changelog": [
4+
"@svitejs/changesets-changelog-github-compact",
5+
{
6+
"repo": "ota-meshi/eslint-plugin-regexp"
7+
}
8+
],
9+
"commit": false,
10+
"linked": [],
11+
"access": "restricted",
12+
"baseBranch": "master",
13+
"updateInternalDependencies": "patch",
14+
"bumpVersionsWithWorkspaceProtocolOnly": true,
15+
"ignore": []
1616
}

.devcontainer/devcontainer.json

+17-19
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
11
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
22
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
33
{
4-
"name": "Node.js & TypeScript",
5-
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-18",
4+
"name": "Node.js & TypeScript",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-18",
77

8-
// Features to add to the dev container. More info: https://containers.dev/features.
9-
// "features": {},
8+
// Features to add to the dev container. More info: https://containers.dev/features.
9+
// "features": {},
1010

11-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
12-
// "forwardPorts": [],
11+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
12+
// "forwardPorts": [],
1313

14-
// Use 'postCreateCommand' to run commands after the container is created.
15-
"postCreateCommand": "npm install",
14+
// Use 'postCreateCommand' to run commands after the container is created.
15+
"postCreateCommand": "npm install",
1616

17-
// Configure tool-specific properties.
18-
"customizations": {
19-
"vscode": {
20-
"extensions": [
21-
"dbaeumer.vscode-eslint"
22-
]
23-
}
24-
}
17+
// Configure tool-specific properties.
18+
"customizations": {
19+
"vscode": {
20+
"extensions": ["dbaeumer.vscode-eslint"]
21+
}
22+
}
2523

26-
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
27-
// "remoteUser": "root"
24+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
25+
// "remoteUser": "root"
2826
}

.eslint-doc-generatorrc.js

+69-58
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,72 @@
1+
"use strict"
2+
13
/** @type {import('eslint-doc-generator').GenerateOptions} */
2-
const config = {
3-
ignoreConfig: ['all', 'flat/all'],
4-
configEmoji: [
5-
["recommended", "🔵"],
6-
["flat/recommended", "🟢"],
7-
],
8-
pathRuleList: ['README.md', 'docs/rules/index.md'],
9-
ruleDocSectionInclude: ['Rule Details', 'Version', 'Implementation'],
10-
ruleDocSectionOptions: false,
11-
ruleDocTitleFormat: 'prefix-name',
12-
ruleListColumns: [
13-
// All standard columns except `deprecated` since we split the list such that there's a dedicated "Deprecated" section.
14-
'name',
15-
'description',
16-
'configsError',
17-
'configsWarn',
18-
'configsOff',
19-
'fixable',
20-
'hasSuggestions',
21-
'requiresTypeChecking',
22-
],
23-
ruleListSplit(rules) {
24-
return [
25-
{
26-
title: 'Possible Errors',
27-
rules: rules.filter(
28-
([, rule]) => rule.meta.docs.category === 'Possible Errors' && !rule.meta.deprecated
29-
),
30-
},
31-
{
32-
title: 'Best Practices',
33-
rules: rules.filter(
34-
([, rule]) => rule.meta.docs.category === 'Best Practices' && !rule.meta.deprecated
35-
),
36-
},
37-
{
38-
title: 'Stylistic Issues',
39-
rules: rules.filter(
40-
([, rule]) => rule.meta.docs.category === 'Stylistic Issues' && !rule.meta.deprecated
41-
),
42-
},
43-
...rules.some(([, rule]) => rule.meta.deprecated)
44-
? [
45-
{
46-
title: 'Deprecated',
47-
rules: rules.filter(([, rule]) => rule.meta.deprecated),
48-
}
4+
const config = {
5+
ignoreConfig: ["all", "flat/all"],
6+
configEmoji: [
7+
["recommended", "🔵"],
8+
["flat/recommended", "🟢"],
9+
],
10+
pathRuleList: ["README.md", "docs/rules/index.md"],
11+
ruleDocSectionInclude: ["Rule Details", "Version", "Implementation"],
12+
ruleDocSectionOptions: false,
13+
ruleDocTitleFormat: "prefix-name",
14+
ruleListColumns: [
15+
// All standard columns except `deprecated` since we split the list such that there's a dedicated "Deprecated" section.
16+
"name",
17+
"description",
18+
"configsError",
19+
"configsWarn",
20+
"configsOff",
21+
"fixable",
22+
"hasSuggestions",
23+
"requiresTypeChecking",
24+
],
25+
ruleListSplit(rules) {
26+
return [
27+
{
28+
title: "Possible Errors",
29+
rules: rules.filter(
30+
([, rule]) =>
31+
rule.meta.docs.category === "Possible Errors" &&
32+
!rule.meta.deprecated,
33+
),
34+
},
35+
{
36+
title: "Best Practices",
37+
rules: rules.filter(
38+
([, rule]) =>
39+
rule.meta.docs.category === "Best Practices" &&
40+
!rule.meta.deprecated,
41+
),
42+
},
43+
{
44+
title: "Stylistic Issues",
45+
rules: rules.filter(
46+
([, rule]) =>
47+
rule.meta.docs.category === "Stylistic Issues" &&
48+
!rule.meta.deprecated,
49+
),
50+
},
51+
...(rules.some(([, rule]) => rule.meta.deprecated)
52+
? [
53+
{
54+
title: "Deprecated",
55+
rules: rules.filter(
56+
([, rule]) => rule.meta.deprecated,
57+
),
58+
},
59+
]
60+
: []),
4961
]
50-
: [],
51-
];
52-
},
53-
urlRuleDoc(name, page) {
54-
if (page === 'README.md') {
55-
// Use URLs only in the README to link to the vitepress SPA. Otherwise, fallback to relative URLs.
56-
return `https://ota-meshi.github.io/eslint-plugin-regexp/rules/${name}.html`;
57-
}
58-
},
59-
};
62+
},
63+
urlRuleDoc(name, page) {
64+
if (page === "README.md") {
65+
// Use URLs only in the README to link to the vitepress SPA. Otherwise, fallback to relative URLs.
66+
return `https://ota-meshi.github.io/eslint-plugin-regexp/rules/${name}.html`
67+
}
68+
return undefined
69+
},
70+
}
6071

61-
module.exports = config;
72+
module.exports = config

.eslintignore

-13
This file was deleted.

0 commit comments

Comments
 (0)