Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: typescript-eslint@8 #1595

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ export default tseslint.config(
files: ["**/*.js", "**/*.ts"],
languageOptions: {
parserOptions: {
EXPERIMENTAL_useProjectService: {
allowDefaultProjectForFiles: ["./*.*s", "eslint.config.js"],
projectService: {
allowDefaultProject: ["*.config.*s", "bin/*.js", "script/*.ts"],
defaultProject: "./tsconfig.json",
},
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"tsup": "^8.1.0",
"tsx": "^4.9.0",
"typescript": "^5.5.2",
"typescript-eslint": "^7.7.0",
"typescript-eslint": "^8.0.0",
"vitest": "^2.0.2"
},
"engines": {
Expand Down
143 changes: 102 additions & 41 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions script/__snapshots__/migrate-test-e2e.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@ exports[`expected file changes > eslint.config.js 1`] = `
import eslint from "@eslint/js";
import comments from "@eslint-community/eslint-plugin-eslint-comments/configs";
import jsdoc from "eslint-plugin-jsdoc";
@@ ... @@ export default tseslint.config(
languageOptions: {
parserOptions: {
projectService: {
- allowDefaultProject: ["*.config.*s", "bin/*.js", "script/*.ts"],
+ allowDefaultProject: ["*.*s", "eslint.config.js"],
defaultProject: "./tsconfig.json",
},
tsconfigRootDir: import.meta.dirname,
@@ ... @@ export default tseslint.config(
"no-constant-condition": "off",

Expand Down
8 changes: 4 additions & 4 deletions script/migrate-test-e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ await fs.writeFile(
.replace(
/All Contributors: \d+/g,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
originalReadme.match(/All Contributors: \d+/)![0],
/All Contributors: \d+/.exec(originalReadme)![0],
)
.replace(
/all_contributors-\d+/g,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
originalReadme.match(/all_contributors-\d+/)![0],
/all_contributors-\d+/.exec(originalReadme)![0],
),
);

Expand All @@ -90,12 +90,12 @@ await fs.writeFile(
.replace(
/All Contributors: \d+/g,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
originalReadme.match(/All Contributors: \d+/)![0],
/All Contributors: \d+/.exec(originalReadme)![0],
)
.replace(
/all_contributors-\d+/g,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
originalReadme.match(/all_contributors-\d+/)![0],
/all_contributors-\d+/.exec(originalReadme)![0],
),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export function readDefaultsFromDevelopment() {
);

const guideTag = lazyValue(async () =>
(await development()).match(
/> .*guided walkthrough, see \[((?!\[).+)\]\((.+)\)/i,
/> .*guided walkthrough, see \[((?!\[).+)\]\((.+)\)/i.exec(
await development(),
),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export function readDefaultsFromReadme() {
const readme = lazyValue(async () => await readFileSafe("README.md", ""));

const imageTag = lazyValue(
async () => (await readme()).match(/<img.+src.+\/>/)?.[0],
async () => /<img.+src.+\/>/.exec(await readme())?.[0],
);

return {
Expand All @@ -15,8 +15,8 @@ export function readDefaultsFromReadme() {
?.match(/src\s*=(.+)?\/>/)?.[1]
?.replaceAll(/^['"]|['"]$/g, ""),
title: async () =>
(await readme())
.match(/^(?:# |<h1\s+align="center">)(.*?)(?:<\/h1>)?$/i)?.[1]
/^(?:# |<h1\s+align="center">)(.*?)(?:<\/h1>)?$/i
.exec(await readme())?.[1]
?.trim()
.replace(/<[^>]+(?:>|$)/g, ""),
};
Expand Down
Loading
Loading