Skip to content
Open
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
10 changes: 4 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
{
"editor.formatOnSave": true,
"xo.enable": true,
"xo.format.enable": true,

"typescript.tsdk": "node_modules/typescript/lib",
"typescript.preferences.importModuleSpecifier": "non-relative",

// formatting
"[typescript]": {
"editor.defaultFormatter": "samverschueren.linter-xo"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "samverschueren.linter-xo"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "samverschueren.linter-xo"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "samverschueren.linter-xo"
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
94 changes: 45 additions & 49 deletions packages/donate-button-v4/.babelrc
Original file line number Diff line number Diff line change
@@ -1,50 +1,46 @@
{
"presets": [
[
"@babel/preset-env",
{
"loose": true,
"modules": false,
"targets": {
"browsers": [
"> 100%",
"last 200 versions",
"IE >= 19"
]
},
"exclude": [
"@babel/plugin-transform-regenerator",
"@babel/plugin-transform-typeof-symbol"
]
}
],
"@babel/preset-typescript"
],
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-transform-object-assign",
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-react-constant-elements",
"babel-plugin-transform-react-remove-prop-types",
[
"@babel/plugin-transform-react-jsx",
{
"pragma": "h"
}
],
[
"babel-plugin-jsx-pragmatic",
{
"module": "preact",
"export": "h",
"import": "h"
}
]
]
}
"presets": [
[
"@babel/preset-env",
{
"loose": true,
"modules": false,
"targets": {
"browsers": ["> 100%", "last 200 versions", "IE >= 19"]
},
"exclude": [
"@babel/plugin-transform-regenerator",
"@babel/plugin-transform-typeof-symbol"
]
}
],
"@babel/preset-typescript"
],
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-transform-object-assign",
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-react-constant-elements",
"babel-plugin-transform-react-remove-prop-types",
[
"@babel/plugin-transform-react-jsx",
{
"pragma": "h"
}
],
[
"babel-plugin-jsx-pragmatic",
{
"module": "preact",
"export": "h",
"import": "h"
}
]
]
}
26 changes: 26 additions & 0 deletions packages/donate-button-v4/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {jsx: true}
},
settings: {
react: {
pragma: 'h',
version: 'detect'
}
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'prettier'
],
rules: {
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'react/prefer-read-only-props': 'off'
}
};
3 changes: 3 additions & 0 deletions packages/donate-button-v4/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/
node_modules/
.cache/
12 changes: 6 additions & 6 deletions packages/donate-button-v4/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"tabWidth": 2,
"useTabs": true,
"trailingComma": "none",
"bracketSpacing": false,
"singleQuote": true
}
"tabWidth": 2,
"useTabs": true,
"trailingComma": "none",
"bracketSpacing": false,
"singleQuote": true
}
13 changes: 6 additions & 7 deletions packages/donate-button-v4/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"postbuild": "cp dist/donate-button/0.4/index.js dist/donate-button/0.4/button.js",
"serve": "preact serve",
"dev": "preact watch -c ./preact.config.js --no-prerender --no-sw",
"lint": "xo",
"lint:fix": "xo --fix"
"lint": "eslint src --ext .ts,.tsx && prettier --check .",
"lint:fix": "eslint src --ext .ts,.tsx --fix && prettier --write ."
},
"keywords": [],
"author": "Every.org",
Expand All @@ -33,15 +33,15 @@
"@babel/preset-typescript": "^7.13.0",
"@testing-library/react": "^11.2.5",
"@types/big.js": "^6.2.2",
"@typescript-eslint/eslint-plugin": "^5",
"@typescript-eslint/parser": "^5",
"ava": "^3.15.0",
"babel-core": "^7.0.0-bridge.0",
"babel-plugin-jsx-pragmatic": "^1.0.2",
"babel-plugin-transform-decorators-legacy": "^1.3.5",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"deepmerge": "^4.2.2",
"eslint": "^7.14.0",
"eslint-config-xo": "^0.34.0",
"eslint-config-xo-react": "^0.23.0",
"eslint-config-prettier": "^8",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4.2.0",
"identity-obj-proxy": "^3.0.0",
Expand All @@ -54,8 +54,7 @@
"ts-node": "^9.1.1",
"tsconfig-paths": "^3.9.0",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"typescript": "^4.1.3",
"xo": "^0.37.1"
"typescript": "^4.1.3"
},
"dependencies": {
"@stripe/stripe-js": "^1.53.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
import {useConfigContext} from 'src/components/widget/hooks/useConfigContext';
import {CheckMarkIcon} from 'src/components/widget/icons/CheckMarkIcon';

interface CheckboxProps extends JSXInternal.HTMLAttributes<HTMLInputElement> {}
type CheckboxProps = JSXInternal.HTMLAttributes<HTMLInputElement>;

export const Checkbox: FunctionComponent<CheckboxProps> = ({
children,
checked,
className,

Check warning on line 18 in packages/donate-button-v4/src/components/widget/components/Checkbox/index.tsx

View workflow job for this annotation

GitHub Actions / lint

'className' is defined but never used
...rest
}) => {
const {primaryColor} = useConfigContext();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ import {
import {mailToLink} from 'src/helpers/mailToLink';

const FEEDBACK_URL = mailToLink({address: SUPPORT_EMAIL});
interface FooterLinkProps
extends JSXInternal.HTMLAttributes<HTMLAnchorElement> {}
type FooterLinkProps = JSXInternal.HTMLAttributes<HTMLAnchorElement>;
const FooterLink: FunctionComponent<FooterLinkProps> = ({
children,
...rest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable unicorn/prevent-abbreviations */
import {DonationFrequency} from 'src/components/widget/types/DonationFrequency';
import {
AvailablePaymentMethods,
Expand Down
1 change: 0 additions & 1 deletion packages/donate-button-v4/src/helpers/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/

/* eslint-disable @typescript-eslint/restrict-plus-operands */
/* eslint-disable unicorn/prefer-dom-node-append */
/* eslint-disable @typescript-eslint/consistent-indexed-object-style */
import * as CSS from 'csstype';
import resetcss from 'src/resetCss';
Expand Down
2 changes: 0 additions & 2 deletions packages/donate-button-v4/src/helpers/mailToLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ function addParameters(
const queryString = Object.entries(parameters)
.map(([key, value]) => {
try {
// eslint-disable-next-line unicorn/no-array-callback-reference
return [key, value].map(encodeURIComponent).join('=');
} catch {
return null;
}
})
// eslint-disable-next-line unicorn/no-array-callback-reference
.filter(isPresent)
.join('&');
return queryString ? [link, queryString].join('?') : link;
Expand Down
13 changes: 5 additions & 8 deletions packages/donate-button-v4/src/helpers/parseDonateUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,11 @@ function frequencyFromString(string?: string | null) {

function addAmountsFromString(string?: string | null) {
if (!string) return;
return (
string
.split(',')
// eslint-disable-next-line unicorn/no-array-callback-reference
.map(Number.parseFloat)
.filter(Boolean)
.slice(0, MAX_AMOUNT_SUGGESTIONS)
);
return string
.split(',')
.map(Number.parseFloat)
.filter(Boolean)
.slice(0, MAX_AMOUNT_SUGGESTIONS);
}

function intFromString(string?: string | null) {
Expand Down
1 change: 1 addition & 0 deletions packages/donate-button-v4/src/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
href="https://www.every.org/wphfund?frequency=once#/donate"
>Donate Once</a
>
</div>
<div>
<a
style="font-size: 30px; margin-top: 10px"
Expand Down
14 changes: 0 additions & 14 deletions packages/donate-button-v4/xo.config.js

This file was deleted.

Loading
Loading