Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Commit

Permalink
support/v3-cleanup (#2450)
Browse files Browse the repository at this point in the history
* support/cleanup removal of unused js files + linting

* fix flow
  • Loading branch information
LFBarreto authored Apr 26, 2022
1 parent 686fc83 commit 0f9ff98
Show file tree
Hide file tree
Showing 258 changed files with 98 additions and 30,772 deletions.
56 changes: 56 additions & 0 deletions scripts/v3clean.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
const { rm } = require("fs");

const exec = require("child_process").exec;

/* eslint-disable no-console */

async function executeAsync(command) {
return new Promise((resolve, reject) => {
exec(command, (error, stdout, stderr) => {
if (error) {
reject(error);
} else if (stderr) {
reject(stderr);
} else {
resolve(stdout);
}
});
});
}

async function listTsJsFilesPairs() {
const jsFilesPath = {};
const jsTsPairs = [];
await executeAsync('git ls-files | grep -e ".\\.js$"').then(res =>
res.split("\n").map(path => (jsFilesPath[path] = true)),
);
return executeAsync('git ls-files | grep -e ".\\.ts$" -e ".\\.tsx$"')
.then(res =>
res.split("\n").forEach(path => {
const beforeExtensionPath = path
.split(".")
.slice(0, -1)
.join(".");
const jsFilePath = `${beforeExtensionPath}.js`;
if (jsFilesPath[jsFilePath]) {
jsTsPairs.push({
tsFilePath: path,
jsFilePath,
});
}
}),
)
.then(() => jsTsPairs);
}

async function removeJS() {
const pairs = await listTsJsFilesPairs();

pairs.forEach(({ jsFilePath }) => {
rm(jsFilePath);
});

return true;
}

removeJS().then(() => console.log("JS files removed"));
26 changes: 0 additions & 26 deletions src/analytics/TrackScreen.js

This file was deleted.

1 change: 0 additions & 1 deletion src/analytics/TrackScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @flow
import { useEffect, useRef } from "react";
import { useIsFocused } from "@react-navigation/native";
import { screen } from "./segment";
Expand Down
154 changes: 0 additions & 154 deletions src/colors.js

This file was deleted.

135 changes: 0 additions & 135 deletions src/components/AccountCard.js

This file was deleted.

Loading

0 comments on commit 0f9ff98

Please sign in to comment.