tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

node-package-names.rst (1437B)


      1 Node Package Names
      2 ==================
      3 
      4 This linter verifies that ``package.json`` files don't include a ``name``
      5 property, unless we are publishing them.
      6 
      7 For ``package.json`` files that are only used for defining dependencies or
      8 commands, we should not include a ``name`` property, as that can cause confusion
      9 as to if the package is published or not.
     10 
     11 Fixing Node Package Names Errors
     12 --------------------------------
     13 
     14 * If the directory/package is an imported third party package, it should be added
     15  to :searchfox:`ThirdPartyPaths.txt <tools/rewriting/ThirdPartyPaths.txt>`.
     16 * If the directory/package is not going to be published, remove the ``name`` and
     17  ``version`` properties.
     18 * If the directory/package is going to be published:
     19 
     20    * The name must include the ``@mozilla/`` scope.
     21    * It must be published under the Mozilla organisation on npmjs.com before landing.
     22    * Once the package has been published initially, it may be added as an exclusion
     23      in :searchfox:`node-package-names.yml <tools/lint/node-package-names.yml>`.
     24 
     25 Run Locally
     26 -----------
     27 
     28 This mozlint linter can be run using mach:
     29 
     30 .. parsed-literal::
     31 
     32    $ mach lint --linter node-package-names <file paths>
     33 
     34 Configuration
     35 -------------
     36 
     37 This linter is enabled on most of the whole code base.
     38 
     39 Sources
     40 -------
     41 
     42 * :searchfox:`Configuration (YAML) <tools/lint/node-package-names.yml>`
     43 * :searchfox:`Source <tools/lint/node-package-names/__init__.py>`