Skip to content

Commit

Permalink
Remove flow (#75)
Browse files Browse the repository at this point in the history
* Remove flow code

* Format

* Remove flowconfig

* Remove flow from *ignore files

* Remove flow from GitHub Actions

* Remove flow from package.json

* Oops

* Disable flow checks in eslint

* Format
  • Loading branch information
nbierdeman authored May 14, 2024
1 parent d60a6af commit 8a076c5
Show file tree
Hide file tree
Showing 12 changed files with 6 additions and 47 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
build
dist
coverage
flow-typed
CHANGELOG.md
node_modules
cdn
3 changes: 1 addition & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/* @flow */

module.exports = {
extends: "@krakenjs/eslint-config-grumbler/eslintrc-node",
rules: {
"const-immutable/no-mutation": "off",
"flowtype/require-valid-file-annotation": 0,
},
};
14 changes: 0 additions & 14 deletions .flowconfig

This file was deleted.

3 changes: 0 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,5 @@ jobs:
with:
useLockFile: false

- name: ▶️ Run flow-typed script
run: npm run flow-typed

- name: ▶️ Run tests
run: npm test
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ jspm_packages
# Yarn Integrity file
.yarn-integrity

# Flow Typed
flow-typed

.idea

.DS_Store
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
build
dist
coverage
flow-typed
CHANGELOG.md
node_modules
cdn
10 changes: 2 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
/* @flow */
/* eslint import/no-default-export: off */

import { setupSDK, type SetupComponent } from "@paypal/sdk-client/src";
import { setupSDK } from "@paypal/sdk-client/src";

export default (
namespace: string,
verison: string,
components: $ReadOnlyArray<SetupComponent<mixed>>
// $FlowFixMe
) => {
export default (namespace, verison, components) => {
return setupSDK(components);
};
3 changes: 1 addition & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/* @flow */
/* eslint import/no-default-export: off */

import { getKarmaConfig } from "@krakenjs/karma-config-grumbler";
import { getWebpackConfig } from "@krakenjs/webpack-config-grumbler";

export default function configKarma(karma: Object) {
export default function configKarma(karma) {
const karmaConfig = getKarmaConfig(karma, {
basePath: __dirname,
webpack: getWebpackConfig(),
Expand Down
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@
"validate-flat": "babel-node test/validate-flat",
"cdnify": "grabthar-cdnify --recursive --cdn='https://www.paypalobjects.com'",
"reinstall": "rm -f ./package-lock.json && rm -rf ./node_modules && npm install && git checkout package-lock.json && git checkout package.json",
"flow-typed": "rm -rf ./flow-typed && flow-typed install",
"lint": "npm run format:check && eslint test/ *.js",
"flow": "flow check",
"format": "prettier --write --ignore-unknown .",
"format:check": "prettier --check .",
"karma": "cross-env NODE_ENV=test babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/karma start",
"test": "npm run lint && npm run flow-typed && npm run flow && npm run validate-components && npm run validate-flat",
"test": "npm run lint && npm run validate-components && npm run validate-flat",
"add": "grabthar-add",
"upgrade": "grabthar-upgrade",
"remove": "grabthar-remove",
Expand Down Expand Up @@ -59,8 +57,6 @@
"@krakenjs/grumbler-scripts": "^8.0.4",
"cross-env": "^7.0.3",
"eslint": "^8.13.0",
"flow-bin": "0.135.0",
"flow-typed": "^3.8.0",
"flowgen": "1.11.0",
"husky": "^8.0.3",
"jest": "^29.3.1",
Expand Down
2 changes: 0 additions & 2 deletions test/validate-components-for-publish.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* @flow */

import pkg from "../package.json";
import pkgLock from "../package-lock.json";

Expand Down
5 changes: 1 addition & 4 deletions test/validate-components.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* @flow */

import { join } from "path";

import { exists } from "fs-extra";
Expand All @@ -11,7 +9,7 @@ const NODE_MODULES = "node_modules";

const BABELRC_NAMES = [".babelrc", ".babelrc.json", ".babelrc.js"];

async function validateComponents(): Promise<void> {
async function validateComponents() {
for (const dependencyName of Object.keys(pkg.dependencies)) {
const dependencyPath = join(NODE_MODULES, dependencyName);

Expand All @@ -23,7 +21,6 @@ async function validateComponents(): Promise<void> {
throw new Error(`Expected ${dependencyName} to have ${SDK_JS}`);
}

// $FlowFixMe
const componentMeta = require(join(dependencyName, SDK_JS)); // eslint-disable-line security/detect-non-literal-require

const moduleNames = Object.keys(componentMeta);
Expand Down
2 changes: 0 additions & 2 deletions test/validate-flat.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* @flow */

import pkgLock from "../package-lock.json";

for (const depName of Object.keys(pkgLock.dependencies)) {
Expand Down

0 comments on commit 8a076c5

Please sign in to comment.