Skip to content

Commit

Permalink
chore:added tailwind removed sass modified linting
Browse files Browse the repository at this point in the history
  • Loading branch information
sandstone991 committed Aug 31, 2023
1 parent f7a0d54 commit e114cfd
Show file tree
Hide file tree
Showing 17 changed files with 461 additions and 385 deletions.
28 changes: 21 additions & 7 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{
"extends": [
"@abhijithvijayan/eslint-config/typescript",
"@abhijithvijayan/eslint-config/node",
"@abhijithvijayan/eslint-config/react"
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:node/recommended",
"plugin:prettier/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended"
],
"plugins": [
"jsx-a11y"
],
"parserOptions": {
"project": [
Expand All @@ -19,16 +26,23 @@
"max-classes-per-file": "off",
"node/no-missing-import": "off",
"node/no-unpublished-import": "off",
"node/no-unsupported-features/es-syntax": ["error", {
"ignores": ["modules"]
}]
"node/no-unsupported-features/es-syntax": [
"error",
{
"ignores": [
"modules"
]
}
]
},
"env": {
"webextensions": true
},
"settings": {
"node": {
"tryExtensions": [".tsx"] // append tsx to the list as well
"tryExtensions": [
".tsx"
] // append tsx to the list as well
}
}
}
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"singleQuote": true,
"tabWidth": 4,
"trailingComma": "all",
"endOfLine": "lf"
}
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@
"emoji-log": "^1.0.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"tailwindcss": "^3.3.3",
"webext-base-css": "^1.3.1",
"webextension-polyfill-ts": "^0.25.0"
},
"devDependencies": {
"@abhijithvijayan/eslint-config": "2.6.3",
"@abhijithvijayan/eslint-config-airbnb": "^1.0.2",
"@abhijithvijayan/tsconfig": "^1.3.0",
"@babel/core": "^7.14.3",
"@babel/eslint-parser": "^7.12.16",
Expand Down Expand Up @@ -74,8 +73,6 @@
"postcss-loader": "^4.3.0",
"prettier": "^2.3.0",
"resolve-url-loader": "^3.1.3",
"sass": "^1.53.0",
"sass-loader": "^10.2.0",
"terser-webpack-plugin": "^4.2.3",
"typescript": "4.1.5",
"webpack": "^4.46.0",
Expand Down
6 changes: 6 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
37 changes: 8 additions & 29 deletions source/Options/Options.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,13 @@
import * as React from 'react';

import './styles.scss';

import '../styles/index.css';
const Options: React.FC = () => {
return (
<div>
<form>
<p>
<label htmlFor="username">Your Name</label>
<br />
<input
type="text"
id="username"
name="username"
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>cool cool cool</p>
</p>
</form>
</div>
);
return (
<div className="w-full h-full flex flex-col justify-center items-center">
<form className="shadow-md m-auto w-3/4 h-3/4">
<input type="checkbox" name="checkbox" id="checkbox" />
</form>
</div>
);
};

export default Options;
10 changes: 0 additions & 10 deletions source/Options/styles.scss

This file was deleted.

84 changes: 42 additions & 42 deletions source/Popup/Popup.tsx
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
import * as React from 'react';
import {browser, Tabs} from 'webextension-polyfill-ts';
import { browser, Tabs } from 'webextension-polyfill-ts';

import './styles.scss';
import '../styles/index.css';

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>
<button
id="options__button"
type="button"
onClick={(): Promise<Tabs.Tab> => {
return openWebPage('options.html');
}}
>
Options Page
</button>
<div className="links__holder">
<ul>
<li>
return (
<section id="popup">
<h2>WEB-EXTENSION-STARTER</h2>
<button
type="button"
onClick={(): Promise<Tabs.Tab> => {
return openWebPage(
'https://github.com/abhijithvijayan/web-extension-starter'
);
}}
id="options__button"
type="button"
onClick={(): Promise<Tabs.Tab> => {
return openWebPage('options.html');
}}
>
GitHub
Options Page
</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>
);
<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>
);
};

export default Popup;
53 changes: 0 additions & 53 deletions source/Popup/styles.scss

This file was deleted.

1 change: 0 additions & 1 deletion source/styles/_fonts.scss

This file was deleted.

10 changes: 0 additions & 10 deletions source/styles/_reset.scss

This file was deleted.

23 changes: 0 additions & 23 deletions source/styles/_variables.scss

This file was deleted.

3 changes: 3 additions & 0 deletions source/styles/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
9 changes: 9 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./source/**/*.tsx"],
theme: {
extend: {},
},
plugins: [],
}

18 changes: 9 additions & 9 deletions views/options.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Options</title>
</head>
<body>
<div id="options-root"></div>
</body>
<html lang="en" style="height: 100%">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Options</title>
</head>
<body style="height: 100%">
<div style="height: 100%" id="options-root"></div>
</body>
</html>
18 changes: 9 additions & 9 deletions views/popup.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=500" />
<title>Popup</title>
</head>
<body>
<div id="popup-root"></div>
</body>
<html lang="en" style="height: 100%">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=500" />
<title>Popup</title>
</head>
<body style="height: 100%">
<div style="height: 100%" id="popup-root"></div>
</body>
</html>
Loading

0 comments on commit e114cfd

Please sign in to comment.