-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Lexical] Add flow for eslint #6127
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, this is the fix for the script that generated this incorrectly if you want to add that as well (diff updated with correct regex)
diff --git a/scripts/update-flowconfig.js b/scripts/update-flowconfig.js
index be35f36d..81c82d4c 100644
--- a/scripts/update-flowconfig.js
+++ b/scripts/update-flowconfig.js
@@ -23,7 +23,7 @@ const BLOCK_REGEX =
function flowTemplate(wwwName) {
return (
- headerTemplate.replace(/^( \*\/)$/m, '* @flow strict\n$1') +
+ headerTemplate.replace(/^( \*\/)$/m, ' * @flow strict\n$1') +
`
/**
* ${wwwName}
@@ -59,22 +59,7 @@ function updateFlowconfig(flowconfigPath = './.flowconfig') {
const resolveRelative = (...subPaths) =>
'<PROJECT_ROOT>/' +
path.relative(configDir, pkg.resolve(...subPaths)).replace(/^(?!\.)/, '');
- if (pkg.isPrivate()) {
- if (pkg.getDirectoryName() !== 'shared') {
- continue;
- }
- if (process.env.TODO_DOES_WWW_NEED_SHARED_FILES === '1') {
- // Do these even work? These .js files aren't on disk and `npm run flow`
- // passes without them. Code is left in for demonstration purposes if
- // this is needed for www.
- for (const {name, sourceFileName} of pkg.getPrivateModuleEntries()) {
- emit(
- name,
- resolveRelative('src', sourceFileName.replace(/\.tsx?$/, '.js')),
- );
- }
- }
- } else {
+ if (!pkg.isPrivate()) {
for (const name of pkg.getExportedNpmModuleNames()) {
const wwwName = npmToWwwName(name);
const flowFile = `${wwwName}.js.flow`;
@@ -85,6 +70,7 @@ function updateFlowconfig(flowconfigPath = './.flowconfig') {
console.log(
`Creating boilerplate ${resolvedFlowFile.replace(/^[^/]+\//, '')}`,
);
+ fs.mkdirsSync(path.dirname(flowFilePath));
fs.writeFileSync(flowFilePath, flowTemplate(wwwName));
}
}
er, hold off on that diff, I just tested it again and the regex is wrong 🤦 will post the correct tested diff shortly |
Just updated the diff above with the corrected regex, sorry about that! Early here :) |
thanks Bob for the update on the script :) |
add flow for eslint