7

Simplify and fix newtab's ESLint configuration

 1 year ago
source link: https://bugzilla.mozilla.org/show_bug.cgi?id=1842869
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Details

The newtab ESLint configuration is still largely set up as if it was being managed in a separate repository. Additionally the way it is set up causes confusion and complications.

I am working on some clean up which will:

  • Remove extending the configuration from eslint:recommended and plugin:mozilla/recommended - these are not required since the newtab directory inherits from the top-level .eslintrc.js of the source directory.
    • This also means we don't have to redo the application of test configurations to xpcshell & browser tests.
  • Stops marking everything as a module. This was causing issues such as:
    • enabling no-unused-vars at the global scope on the head.js files for tests,
    • not enabling rules when they should be enabled as they don't apply to modules.
  • Collapses the configurations from the content-src and test directories into browser/components/newtab/.eslintrc.js
    • This centralises everything and makes it easier to know what applies.
  • Disables no-insecure-url on a line/file basis rather than in the main configuration (the general idea is to do this).
  • Fixes some ESLint issues that are raised due to the fixed configuration.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK