Giter Site home page Giter Site logo

tinywebex / addontemplate Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 2.0 131 KB

A template for WebExtensions, so you can quickly start with one…

Home Page: https://addons.mozilla.org/firefox/addon/THIS_ADDON_NAME_AMO/?utm_source=github.com&utm_medium=github&utm_content=github-url-description&campaign=github-url-description

License: Other

HTML 24.38% Shell 3.91% JavaScript 71.13% CSS 0.58%
template templates addon web-extension browser-extension browser-addon firefox firefox-addon firefox-extension firefox-webextension

addontemplate's Introduction

THIS_ADDON_NAME_HUMAN

Mozilla Add-on version
Mozilla Add-on downloads Mozilla Add-on users Mozilla Add-on stars

This is a (Firefox) add-on (WebExtension) …

In contrast to many other add-ons, …

It is/has/features…

It is inspired by …. This extension only works with modern Firefox v60 or higher.

Download

Get it for Firefox!

In action…

what shows this screencast description in alt text

See:

Features

  • Puts your privacy first! Privacy is the default here.
  • Follows the Firefox Photon Design.
  • Has a simple, but intuitive and usable User Interface.
  • Translated in several languages already. Contribute your own language!
  • Compatible with Firefox for Android
  • […]

Notes

How to setup this template

  1. Clone this repo.
  2. Replace the following strings in all files of this dir accordingly:
  • THIS_ADDON_AUTHOR -> rugk
  • THIS_ADDON_NAME_HUMAN -> My Awesome Add-on
  • THIS_ADDON_NAME_SHORT_HUMAN -> Awesome Add-on
  • THIS_ADDON_NAME_SHORT_TEC_HUMAN -> AwesomeAdd-on (technical short name)
  • THIS_ADDON_NAME_AMO -> my-awesome-addon (as in the URL of addons.mozilla.org)
  • THIS_ADDON_NAME_ID -> [email protected]
  • THIS_ADDON_GITHUB_URL -> https://github.com/user/project
  1. Remove modules you may not need in .gitmodules.
  2. Run git submodule update --init --recursive to initialize the remaining modules.
  3. Remove this text here.
  4. Remove the .git dir and run git init to get a fresh repo to start.

LICENSE

The MIT license file included is also a template. You may choose any license.

This template itself is published under CC0, so do not have to attribute me for a simple template or so. That makes no sense. :) Just remember that the TinyWebEx modules do have their own licenses, usually MIT licenses, so you need to include them, if you want to use these modules.

CC0
To the extent possible under law, rugk has waived all copyright and related or neighboring rights to AddonTemplate. This work is published from: Germany.

addontemplate's People

Contributors

prometheos2 avatar rugk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

prometheos2 hueyy

addontemplate's Issues

Consider adding more ESLint rules

Looking at the over 260 ESLint rules, there have been a lot of potenchally useful ones implemented since this .eslintrc file was created. It would probably be good to add some them to this repository and your other add-ons.

Here are the rules I would specifically suggest adding (listed in the same order as the documentation):

        // Problems
        "array-callback-return": "error",
        "no-await-in-loop": "error",
        "no-constant-binary-expression": "error",
        "no-promise-executor-return": "error",
        "no-template-curly-in-string": "error",
        "no-unmodified-loop-condition": "error",
        "no-unreachable-loop": "error",

        // Suggestions
        "default-param-last": "warn",
        "func-names": "warn",
        "init-declarations": "warn",
        "no-caller": "warn",
        "no-else-return": "warn",
        "no-extend-native": "warn",
        "no-extra-bind": "warn",
        "no-extra-label": "warn",
        "no-floating-decimal": "warn",
        "no-implicit-coercion": "warn",
        "no-invalid-this": "warn",
        "no-lonely-if": "warn",
        "no-new": "warn",
        "no-new-func": "error",
        "no-octal-escape": "warn",
        "no-return-assign": "warn",
        "no-return-await": "warn",
        "no-undef-init": "warn",
        "no-undefined": "warn",
        "no-unneeded-ternary": "warn",
        "no-useless-computed-key": "warn",
        "no-useless-concat": "warn",
        "no-useless-rename": "warn",
        "no-useless-return": "warn",
        "operator-assignment": "warn",
        "prefer-exponentiation-operator": "warn",
        "prefer-named-capture-group": "warn",
        "prefer-object-has-own": "warn",
        "prefer-object-spread": "warn",
        "prefer-regex-literals": "warn",
        "quote-props": ["error", "as-needed"],
        "require-unicode-regexp": "warn",
        "strict": "warn",

        // Layout & Formatting
        "block-spacing": "warn",
        "comma-dangle": "warn",
        "comma-spacing": "warn",
        "comma-style": "warn",
        "computed-property-spacing": "warn",
        "func-call-spacing": "warn",
        "key-spacing": "warn",
        "keyword-spacing": "warn",
        "no-extra-parens": "warn",
        "no-trailing-spaces": "warn",
        "no-whitespace-before-property": "warn",
        "rest-spread-spacing": "warn",
        "space-before-blocks": "warn",
        "space-in-parens": "warn",
        "space-infix-ops": "warn",
        "space-unary-ops": "warn",
        "switch-colon-spacing": "warn"

Many of these would have automatically caught things you have mentioned in your reviews of my various PRs. Using these additional rules to check Unicodify and the Awesome Emoji Picker found a few mostly minor issues.

Add common unit tests

E.g.:

import "/common/modules/AddonSettings/tests/dataTest/defaultSettings.test.js";

ESLint JSDoc rules removed

The two ESLint JSDoc rules used by this template and your other add-ons were deprecated in 2018: https://eslint.org/blog/2018/11/jsdoc-end-of-life/ and it looks like they might be removed soon: eslint/eslint#15820

AddonTemplate/.eslintrc

Lines 79 to 102 in 2068d62

"require-jsdoc": ["error", {
"require": {
"FunctionDeclaration": true,
"MethodDefinition": false,
"ClassDeclaration": false,
"ArrowFunctionExpression": false
}
}],
"valid-jsdoc": ["error", {
"prefer": {
"return": "returns"
},
"preferType": {
"Boolean": "boolean",
"Number": "number",
"object": "Object",
"String": "string",
"HtmlElement": "HTMLElement"
},
"requireReturnType": true,
"matchDescription": ".+",
"requireParamDescription": false,
"requireReturnDescription": false
}],

It would probably be good to find a replacement. They recommended using the eslint-plugin-jsdoc plugin, but I would recommend using the TypeScript compiler instead (it supports checking JS code), as it is built into many editors by default (such as VS Code) and it can also validate the data types. Using it just requires adding a few keys to the compilerOptions section of the existing jsconfig.json file, such as:

    "module": "es2021",
    "checkJs": true,
    "strict": true,
    "noImplicitAny": false,
    "forceConsistentCasingInFileNames": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,

See the documentation for more information: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html

Using this to check Unicodify and the Awesome Emoji Picker found a significant number of JSDoc (mostly incorrect datatypes) and other issues, which I can summit respective PRs to fix if you want.

Mozilla is tracking this issue in Bug 1510561.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.