Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
cezaraugusto committed Sep 9, 2024
1 parent f2358f2 commit 84125a6
Show file tree
Hide file tree
Showing 42 changed files with 145 additions and 135 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@ pnpm dev
## License

MIT (c) Cezar Augusto and the Extension.js authors.

4 changes: 1 addition & 3 deletions _WIP_Advanced/Create Your Own Template.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
---
sort: 1

---

TODO
---
## TODO

**🧩 Extension** • create cross-browser extensions with no build configuration.
5 changes: 2 additions & 3 deletions _WIP_Advanced/Usage Via NodeJS API.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
sort: 3

---
TODO
---

## TODO

**🧩 Extension** • create cross-browser extensions with no build configuration.
22 changes: 11 additions & 11 deletions _WIP_Configuration Files/Babel.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ To allow developers to use the latest language features without worrying about b

Here’s how each Babel plugin and preset contributes to this feature:

* [@babel/plugin-proposal-decorators](https://www.npmjs.com/package/@babel/plugin-proposal-decorators): Allows developers to use decorators in their code, providing a convenient and readable way to annotate and modify classes and properties at design time.
* [@babel/plugin-syntax-dynamic-import](https://www.npmjs.com/package/@babel/plugin-syntax-dynamic-import): Enables the use of dynamic import() syntax, facilitating code-splitting and lazy-loading of modules, which can significantly improve the performance of web applications.
* [@babel/preset-env](https://www.npmjs.com/package/@babel/preset-env): Automatically determines the Babel plugins and polyfills needed based on the target environment's feature support, ensuring that the output code runs efficiently across all platforms.
* [@babel/preset-react](https://www.npmjs.com/package/@babel/preset-react): Transforms JSX into standard JavaScript, making it compatible with the browser and enabling the use of React's powerful UI library and its ecosystem.
* [@babel/preset-typescript](https://www.npmjs.com/package/@babel/preset-typescript): Provides support for TypeScript, allowing developers to leverage type-safe programming, interfaces, and other TypeScript features, which are compiled down to standard JavaScript.
* [babel-plugin-react-require](https://www.npmjs.com/package/babel-plugin-react-require): Automatically injects the React import statement in files that use JSX, ensuring that the React namespace is always available where needed.
* [babel-plugin-transform-react-remove-prop-types](https://www.npmjs.com/package/babel-plugin-transform-react-remove-prop-types): Removes PropTypes from the production build of React components, reducing the bundle size and improving the performance of the production app.
- [@babel/plugin-proposal-decorators](https://www.npmjs.com/package/@babel/plugin-proposal-decorators): Allows developers to use decorators in their code, providing a convenient and readable way to annotate and modify classes and properties at design time.
- [@babel/plugin-syntax-dynamic-import](https://www.npmjs.com/package/@babel/plugin-syntax-dynamic-import): Enables the use of dynamic import() syntax, facilitating code-splitting and lazy-loading of modules, which can significantly improve the performance of web applications.
- [@babel/preset-env](https://www.npmjs.com/package/@babel/preset-env): Automatically determines the Babel plugins and polyfills needed based on the target environment's feature support, ensuring that the output code runs efficiently across all platforms.
- [@babel/preset-react](https://www.npmjs.com/package/@babel/preset-react): Transforms JSX into standard JavaScript, making it compatible with the browser and enabling the use of React's powerful UI library and its ecosystem.
- [@babel/preset-typescript](https://www.npmjs.com/package/@babel/preset-typescript): Provides support for TypeScript, allowing developers to leverage type-safe programming, interfaces, and other TypeScript features, which are compiled down to standard JavaScript.
- [babel-plugin-react-require](https://www.npmjs.com/package/babel-plugin-react-require): Automatically injects the React import statement in files that use JSX, ensuring that the React namespace is always available where needed.
- [babel-plugin-transform-react-remove-prop-types](https://www.npmjs.com/package/babel-plugin-transform-react-remove-prop-types): Removes PropTypes from the production build of React components, reducing the bundle size and improving the performance of the production app.

This comprehensive setup empowers developers to write modern, efficient, and clean extension code across various modern web technologies, including [[React]] and [[TypeScript]].

## Next Steps

* Add a custom [[Babel]] config (`babel.config.js`) to your extension.
* To maintain compatibility across diverse browser vendors, see [[Polyfill]].
* Learn about [[React]] in Extension.
* Learn about [[TypeScript]] in Extension.
- Add a custom [[Babel]] config (`babel.config.js`) to your extension.
- To maintain compatibility across diverse browser vendors, see [[Polyfill]].
- Learn about [[React]] in Extension.
- Learn about [[TypeScript]] in Extension.

---

Expand Down
1 change: 0 additions & 1 deletion _WIP_Configuration Files/PostCSS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
sort: 3
---


---

**🧩 Extension** • create cross-browser extensions with no build configuration.
2 changes: 1 addition & 1 deletion _WIP_Configuration Files/_Webpack.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
sort: 7

---

TODO

---
Expand Down
1 change: 0 additions & 1 deletion _WIP_Contribute/Architecture Overview.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
sort: 2

---

TODO
Expand Down
2 changes: 1 addition & 1 deletion _WIP_Contribute/Help Ensuring Quality.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
sort: 5

---

TODO

---
Expand Down
2 changes: 1 addition & 1 deletion _WIP_Contribute/Help Me Fixing Stuff.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
sort: 4

---

TODO

---
Expand Down
2 changes: 1 addition & 1 deletion _WIP_Contribute/Run This Project Locally.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
sort: 3

---

TODO

---
Expand Down
2 changes: 1 addition & 1 deletion _WIP_Contribute/What This Project Is All About.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
sort: 1

---

TODO

---
Expand Down
29 changes: 13 additions & 16 deletions _WIP_Development/_Modern CSS/Less.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ npx extension dev @Extension/templates/less
#### In an HTML file

```html
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand All @@ -24,23 +24,20 @@ npx extension dev @Extension/templates/less
</head>
<body>
<!-- Add the styles you need -->
<h1 className="text-4xl font-bold">Hello, Extension.</h1>
<h1 className="text-4xl font-bold">Hello, Extension.</h1>
</body>
</html>

```

#### In a JavaScript File

```js
// ./NewTabApp.jsx

import './css/globals.css'
import "./css/globals.css";

export default function MyNewTabPage() {
return (
<h1 className="text-4xl font-bold">Hello, Extension.</h1>
)
return <h1 className="text-4xl font-bold">Hello, Extension.</h1>;
}
```

Expand All @@ -50,20 +47,20 @@ export default function MyNewTabPage() {
// ./content_script.jsx

// There is no HTML in a content_script file, so
// we import our global CSS file via dynamic import.
import('./css/globals.css')
// we import our global CSS file via dynamic import.
import("./css/globals.css");

export default function MyNewTabPage() {
return <h1 className="text-3xl font-bold underline">Hello, Extension!</h1>
return <h1 className="text-3xl font-bold underline">Hello, Extension!</h1>;
}
```

## Next Steps

* Learn how to apply styles to the multiple extension contexts in [[Working With Stylesheets]].
* Learn how to enable [[PostCSS]] capabilities in your extension.
* Configure [[Tailwind]] in your extension.
* Using [[Stylelint]] with Extension to lint your stylesheets.
- Learn how to apply styles to the multiple extension contexts in [[Working With Stylesheets]].
- Learn how to enable [[PostCSS]] capabilities in your extension.
- Configure [[Tailwind]] in your extension.
- Using [[Stylelint]] with Extension to lint your stylesheets.

---

Expand Down
23 changes: 11 additions & 12 deletions _WIP_Development/_Modern CSS/Sass.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ From [https://sass-lang.com/](https://sass-lang.com/):

<!-- <img src="https://place-hold.it/700x400"> -->

### Try it yourself
### Try it yourself

```sh
npx extension dev @Extension/templates/sass
```

## Usage With An Existing Extension
## Usage With An Existing Extension

### Installation & Configuration

Expand All @@ -34,7 +34,7 @@ npm install -D sass
#### In An HTML File

```html
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand All @@ -45,10 +45,9 @@ npm install -D sass
</head>
<body>
<!-- Add the styles you need -->
<h1 className="text-4xl font-bold">Hello, Extension.</h1>
<h1 className="text-4xl font-bold">Hello, Extension.</h1>
</body>
</html>

```

#### In A JavaScript File
Expand All @@ -57,7 +56,7 @@ npm install -D sass
// ./NewTabApp.jsx

import styles from './styles/button.module.scss'

export default function MyNewTabPage({ Component, pageProps }) {
return (
<h1 className={{styles.primaryColor}}>Hello, Extension.</h1>
Expand All @@ -72,9 +71,9 @@ export default function MyNewTabPage({ Component, pageProps }) {
// ./content_script.jsx
// There is no HTML in a content_script file, so
// we import our global CSS file via dynamic import.
// we import our global CSS file via dynamic import.
import('./css/globals.css')
export default function MyNewTabPage() {
return <h1 className="text-3xl font-bold underline">Hello, Extension!</h1>
}
Expand All @@ -87,7 +86,7 @@ export default function MyNewTabPage() {
/* styles/button.module.scss */

$primary-color: #64ff00;

:export {
primaryColor: $primary-color;
}
Expand All @@ -97,19 +96,19 @@ $primary-color: #64ff00;
// ./NewTabApp.jsx

import styles from './styles/button.module.scss'

export default function MyNewTabPage({ Component, pageProps }) {
return (
<h1 className={{styles.primaryColor}}>Hello, Extension.</h1>
)
}
```

Now, add `css/button.scss` as an import for the file you want Sass to work. For example:
Now, add `css/button.scss` as an import for the file you want Sass to work. For example:

## Next Steps

* Ensure the semantics and code quality of your CSS files by using [[Stylelint]].
- Ensure the semantics and code quality of your CSS files by using [[Stylelint]].

---

Expand Down
6 changes: 4 additions & 2 deletions _WIP_Features/HTML Fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
templateEngineOverride: njk,md
sort: 2
---
<!--

<!--
AUTHOR HINT: Features of HtmlPlugin
-->
TODO

TODO
6 changes: 4 additions & 2 deletions _WIP_Features/Icon Fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
templateEngineOverride: njk,md
sort: 3
---
<!--

<!--
AUTHOR HINT: Features of ScriptsPlugin
-->
TODO

TODO
6 changes: 4 additions & 2 deletions _WIP_Features/JSON Fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
templateEngineOverride: njk,md
sort: 6
---
<!--

<!--
AUTHOR HINT: Features of JsonPlugin
-->
TODO

TODO
6 changes: 4 additions & 2 deletions _WIP_Features/Locales Files.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
templateEngineOverride: njk,md
sort: 7
---
<!--

<!--
AUTHOR HINT: Features of LocalesPlugin
-->
TODO

TODO
8 changes: 4 additions & 4 deletions _WIP_Features/Migrating Your Extension.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
sort: 2

---
<!--

<!--
AUTHOR HINT: "I already have an extension" of README
-->
TODO
---

## TODO

**🧩 Extension** • create cross-browser extensions with no build configuration.
4 changes: 2 additions & 2 deletions _WIP_Features/Page Reload And HMR.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
sort: 11
---

<!--
AUTHOR HINT: Reload capabilities are the "reload" and "browser" plugins in the webpack-confi
<!--
AUTHOR HINT: Reload capabilities are the "reload" and "browser" plugins in the webpack-config
-->

TODO
Expand Down
4 changes: 2 additions & 2 deletions _WIP_Features/Script Fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
templateEngineOverride: njk,md
sort: 3
---
<!--

<!--
AUTHOR HINT: Features of ScriptsPlugin
-->

6 changes: 4 additions & 2 deletions _WIP_Features/Static Assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
templateEngineOverride: njk,md
sort: 5
---
<!--

<!--
AUTHOR HINT: Features of ResourcesPlugin
-->
TODO

TODO
6 changes: 4 additions & 2 deletions _WIP_Features/The Manifest File.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
templateEngineOverride: njk,md
sort: 1
---
<!--

<!--
AUTHOR HINT: Features of ManifestPlugin
-->
TODO

TODO
Loading

0 comments on commit 84125a6

Please sign in to comment.