fix: apply new prettier rules

This commit is contained in:
abhijithvijayan 2020-04-17 12:59:08 +05:30
parent b258224b46
commit 2d510b8f30
5 changed files with 72 additions and 60 deletions

View File

@ -30,7 +30,7 @@
"webextension-polyfill-ts": "^0.14.0"
},
"devDependencies": {
"@abhijithvijayan/eslint-config": "0.14.1",
"@abhijithvijayan/eslint-config": "^1.3.0",
"@abhijithvijayan/tsconfig": "^1.1.2",
"@babel/core": "^7.9.0",
"@babel/plugin-proposal-class-properties": "^7.8.3",

View File

@ -1,5 +1,5 @@
import { browser } from 'webextension-polyfill-ts';
import {browser} from 'webextension-polyfill-ts';
browser.runtime.onInstalled.addListener((): void => {
console.log('extension installed');
console.log('extension installed');
});

View File

@ -3,22 +3,30 @@ import React from 'react';
import './styles.scss';
const Options: React.FC = () => {
return (
<div>
<form>
<p>
<label htmlFor="name">Name</label>
<br />
<input type="text" id="name" name="name" spellCheck="false" autoComplete="off" required />
</p>
<p>
<label htmlFor="logging">
<input type="checkbox" name="logging" /> Show the features enabled on each page in the console
</label>
</p>
</form>
</div>
);
return (
<div>
<form>
<p>
<label htmlFor="name">Name</label>
<br />
<input
type="text"
id="name"
name="name"
spellCheck="false"
autoComplete="off"
required
/>
</p>
<p>
<label htmlFor="logging">
<input type="checkbox" name="logging" /> Show the features enabled
on each page in the console
</label>
</p>
</form>
</div>
);
};
export default Options;

View File

@ -1,51 +1,55 @@
import React from 'react';
import { browser, Tabs } from 'webextension-polyfill-ts';
import {browser, Tabs} from 'webextension-polyfill-ts';
import './styles.scss';
function openWebPage(url: string): Promise<Tabs.Tab> {
return browser.tabs.create({ url });
return browser.tabs.create({url});
}
const Popup: React.FC = () => {
return (
<section id="popup">
<h2>WEB-EXTENSION-STARTER</h2>
return (
<section id="popup">
<h2>WEB-EXTENSION-STARTER</h2>
<button
id="options__button"
type="button"
onClick={(): Promise<Tabs.Tab> => {
return openWebPage('options.html');
}}
>
Options Page
</button>
<div className="links__holder">
<ul>
<li>
<button
id="options__button"
type="button"
onClick={(): Promise<Tabs.Tab> => {
return openWebPage('options.html');
}}
type="button"
onClick={(): Promise<Tabs.Tab> => {
return openWebPage(
'https://github.com/abhijithvijayan/web-extension-starter'
);
}}
>
Options Page
GitHub
</button>
<div className="links__holder">
<ul>
<li>
<button
type="button"
onClick={(): Promise<Tabs.Tab> => {
return openWebPage('https://github.com/abhijithvijayan/web-extension-starter');
}}
>
GitHub
</button>
</li>
<li>
<button
type="button"
onClick={(): Promise<Tabs.Tab> => {
return openWebPage('https://www.buymeacoffee.com/abhijithvijayan');
}}
>
Buy Me A Coffee
</button>
</li>
</ul>
</div>
</section>
);
</li>
<li>
<button
type="button"
onClick={(): Promise<Tabs.Tab> => {
return openWebPage(
'https://www.buymeacoffee.com/abhijithvijayan'
);
}}
>
Buy Me A Coffee
</button>
</li>
</ul>
</div>
</section>
);
};
export default Popup;

View File

@ -2,10 +2,10 @@
# yarn lockfile v1
"@abhijithvijayan/eslint-config@0.14.1":
version "0.14.1"
resolved "https://registry.npmjs.org/@abhijithvijayan/eslint-config/-/eslint-config-0.14.1.tgz#ca6a0e0da188cb9d6be1be44a1e054f76be74c69"
integrity sha512-fx/n434sXdKAyKNxtdy91Wn8uqeyfd4fcIC8I1/xb7JTVlqB4uAdp2xVu5KG5hEFL+liauieT97wXNTTJBLTJg==
"@abhijithvijayan/eslint-config@^1.3.0":
version "1.3.0"
resolved "https://registry.yarnpkg.com/@abhijithvijayan/eslint-config/-/eslint-config-1.3.0.tgz#cfe741a97f04725fa931e918014dfabc33aefdb1"
integrity sha512-b823i+e8Tw9auspey0U+3fVziydJ3d0bxUfd+HJdSuuHV/48EO6erPEy3acusqwSQ9uGB3contePze9Yt/n+eA==
"@abhijithvijayan/tsconfig@^1.1.2":
version "1.1.2"