Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-74301

Upgrade Eslint and audit rules

XMLWordPrintable

    • MOODLE_400_STABLE, MOODLE_403_STABLE
    • MOODLE_403_STABLE
    • MDL-74301-master
    • Hide

      From moodle root directory run:
      1. Upgrade eslint (npm install)
      2. Run grunt (grunt ignorefiles)
      2. Run grunt eslint tasks (grunt eslint)
      3. Make sure there are no errors or warnings.
      4. Make sure there are no untracked changes in minified/map files.

      Show
      From moodle root directory run: 1. Upgrade eslint ( npm install ) 2. Run grunt ( grunt ignorefiles ) 2. Run grunt eslint tasks ( grunt eslint ) 3. Make sure there are no errors or warnings. 4. Make sure there are no untracked changes in minified/map files.

      Following MDL-73915, it would make sense to upgrade Eslint and audit all existing rules.

      This includes:

      • Remove plugins already included into current "@babel/preset-env":
        • "@babel/plugin-proposal-class-properties"
        • "@babel/plugin-proposal-json-strings"
        • "@babel/plugin-syntax-dynamic-import"
        • "@babel/plugin-syntax-import-meta"
      • Upgrade "eslint" to latest version
      • Replace "eslint-plugin-babel" (depreacted in 2019) with "@babel/eslint-parser" and "@babel/eslint-plugin"

      Eslint changes:

      • Use 'eslint:recommended' and make it pass with no errors having minimum possible number of rules defined in .eslintrc file.

      All removed rules need to be audited in a way:

      • deprecated rules needs to be removed (may be with help of sarbbottam/eslint-find-rules)
      • those covered by "eslint:recommended" set also can be removed from explicit listing if they match recommeded value
      • only additionally required rules to complay with coding style should remain
      • while auditing rules, consider using 'plugin:promise/recommended' and 'plugin:jsdoc/recommended'
      • finally, add 'reportUnusedDisableDirectives' eslint setting - this will help to clean up unused /* eslint-disable... */ statements

            kabalin Ruslan Kabalin
            kabalin Ruslan Kabalin
            Andrew Lyons Andrew Lyons
            Ilya Tregubov Ilya Tregubov
            Jun Pataleta Jun Pataleta
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days, 2 hours, 2 minutes
                2d 2h 2m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.