Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
feat: bump supported TS version to 5.2#7535
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| import type { TSESTree } from '@typescript-eslint/types'; | ||
| import { AST_TOKEN_TYPES } from '@typescript-eslint/types'; | ||
| import { ESLint } from '@typescript-eslint/utils/ts-eslint'; | ||
Collaborator There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. @bradzacher this seem to be generating some issues on clean install > yarn buildNX Could not executecommand because the task graph has a circular dependencyrule-schema-to-typescript-types:build --> type-utils:build --> utils:build --> scope-manager:build --> utils:build | ||
| import * as fs from 'fs'; | ||
| import * as path from 'path'; | ||
| import { format, resolveConfig } from 'prettier'; | ||
| @@ -53,6 +54,7 @@ const TYPES_FILE = path.resolve( | ||
| 'src', | ||
| 'lib.ts', | ||
| ); | ||
| const BARREL_PATH = path.join(OUTPUT_FOLDER, 'index.ts'); | ||
| const BASE_CONFIG_MODULE_NAME = 'base-config'; | ||
| const SHARED_CONFIG_MODULE = path.resolve( | ||
| @@ -110,7 +112,7 @@ function getReferences( | ||
| return references; | ||
| } | ||
| asyncfunction main():Promise<void> { | ||
| try { | ||
| rimraf.sync(OUTPUT_FOLDER); | ||
| } catch { | ||
| @@ -122,6 +124,12 @@ function main(): void { | ||
| // ignored | ||
| } | ||
| const filesWritten: string[] = [ | ||
| SHARED_CONFIG_MODULE, | ||
| TYPES_FILE, | ||
| BARREL_PATH, | ||
| ]; | ||
| // the shared | ||
| fs.writeFileSync( | ||
| SHARED_CONFIG_MODULE, | ||
| @@ -222,7 +230,9 @@ function main(): void { | ||
| } | ||
| const formattedCode = formatCode(code); | ||
| const writePath = path.join(OUTPUT_FOLDER, `${libName}.ts`); | ||
| fs.writeFileSync(writePath, formattedCode); | ||
| filesWritten.push(writePath); | ||
| console.log( | ||
| 'Wrote', | ||
| @@ -254,7 +264,7 @@ function main(): void { | ||
| const formattedBarrelCode = formatCode(barrelCode); | ||
| fs.writeFileSync(BARREL_PATH, formattedBarrelCode); | ||
| console.log('Wrote barrel file'); | ||
| // generate a string union type for the lib names | ||
| @@ -270,6 +280,17 @@ function main(): void { | ||
| fs.writeFileSync(TYPES_FILE, formattedLibUnionCode); | ||
| console.log('Wrote Lib union type file'); | ||
| const lint = new ESLint({ | ||
| fix: true, | ||
| }); | ||
| const results = await lint.lintFiles(filesWritten); | ||
| await ESLint.outputFixes(results); | ||
| console.log('Autofixed lint errors'); | ||
| } | ||
| main().catch(e => { | ||
| console.error(e); | ||
| // eslint-disable-next-line no-process-exit | ||
| process.exit(1); | ||
| }); | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. What's going on here? Is it related to#7534? MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Nah so I ran the generator and noticed that it changed all of the lib files and caused a bunch of lint errors due to unsorted imports and such. I figured that instead of manually running the linter afterwards was dumb cos we can automate it :) | ||