Skip to content

Commit

Permalink
lint ts settings
Browse files Browse the repository at this point in the history
  • Loading branch information
sandstone991 committed Aug 31, 2023
1 parent b3e84b1 commit af57160
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
7 changes: 5 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@
"plugin:node/recommended",
"plugin:prettier/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended"
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/recommended"
],
"plugins": [
"jsx-a11y"
"jsx-a11y",
"@typescript-eslint/eslint-plugin"
],
"parserOptions": {
"project": [
"./tsconfig.json"
],
"sourceType": "module"
},
"parser": "@typescript-eslint/parser",
"rules": {
"no-console": "off",
"no-extend-native": "off",
Expand Down
11 changes: 4 additions & 7 deletions source/Constants/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
const providers = {
"cdn.jsdelivr": 'https://cdn.jsdelivr.net/npm/',
const providers = {
'cdn.jsdelivr': 'https://cdn.jsdelivr.net/npm/',
unpkg: 'https://unpkg.com/',

};
};

export {
providers
}
export { providers };
1 change: 0 additions & 1 deletion source/ContentScript/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@

export {};
17 changes: 9 additions & 8 deletions source/Options/Options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ const Options: React.FC = () => {
const errorMessageTimeout = React.useRef<number | null>(null);
React.useEffect(() => {
async function getNotWorkingProviders() {
let blockedProivders = (
const blockedProivders = (
await Promise.all(
Object.keys(providers).map(async (provider) => {
let res = await browser.storage.local.get(provider);
const res = await browser.storage.local.get(provider);
if (res[provider]) {
return {
provider,
Expand All @@ -32,7 +32,7 @@ const Options: React.FC = () => {
);
}
async function getBlockedProviders() {
let blockedProivders = await browser.storage.local.get(
const blockedProivders = await browser.storage.local.get(
'blockedProivders',
);
setBlockedProviders(blockedProivders['blockedProivders'] || []);
Expand All @@ -43,8 +43,8 @@ const Options: React.FC = () => {

const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
let formData = new FormData(e.currentTarget);
let blockedProivders = Object.keys(providers).filter(
const formData = new FormData(e.currentTarget);
const blockedProivders = Object.keys(providers).filter(
(provider) => !formData.getAll('provider').includes(provider),
);
browser.storage.local.set({ blockedProivders });
Expand Down Expand Up @@ -183,11 +183,12 @@ const Options: React.FC = () => {
</h2>
<div className="text-gray-500 text-sm">
<p>
Allowed CDNs won't be rerouted even if they're
blocked or don't work for you
Allowed CDNs won&apos;t be rerouted even if
they&apos;re blocked or don&apos;t work for you
</p>
<p>
You'll have to deselect undesired providers manually
You&apos;ll have to deselect undesired providers
manually
</p>
<div className="flex flex-col gap-4">
<FormBody />
Expand Down

0 comments on commit af57160

Please sign in to comment.