Step 0 JS codestyle: Exclude non passing eslint rules

Created on 30 September 2017, almost 7 years ago
Updated 12 September 2023, 12 months ago

Problem/Motivation

In order to fix our eslintrc rules we need to execute the following steps:

  1. Make the current .eslintrc compliant with our current code
  2. Therefore we will exclude all rules which rules currently don't follow
  3. As next step we will create a meta issue which is the hub to fix every previously excluded rule
  4. Fix each rule, by removing the exclusion from the .eslintrc.json file and fixing all the instances

As first step we determine all the rules which don't work right now:

node ./node_modules/eslint/bin/eslint.js --format=json --ext=.es6.js . | jq '[.[] | .messages[] |  .ruleId]' | sort | uniq -c | sort -r | pbcopy
 469   "func-names",
 146   "no-mutable-exports",
 121   "no-unused-vars",
  75   "no-use-before-define",
  70   "max-len",
  66   "camelcase",
  54   "no-restricted-syntax",
  42   "no-shadow",
  35   "newline-per-chained-call",
  24   "vars-on-top",
  24   "no-var",
  24   "no-mixed-operators",
  19   "no-useless-escape",
  18   "new-cap",
  16   "no-plusplus",
  16   "default-case",
  14   "no-multi-assign",
   9   "no-new",
   9   "no-continue",
   6   "prefer-const",
   3   "prefer-rest-params",
   2   "padded-blocks",
   2   "no-lonely-if",
   2   "no-confusing-arrow",
   2   "comma-dangle",
   2   "array-callback-return",
   1   "no-var"
   1   "no-useless-concat",
   1   "no-throw-literal",
   1   "no-empty",

Proposed resolution

Add a .eslintrc.passing.json which extends our existing .eslintrc.jsonfile and ensures that everything is passing. Over time we can then reduce overridden rules, while not affecting new JS files to have less coverage.

Remaining tasks

User interface changes

:

API changes

Data model changes

📌 Task
Status

Fixed

Version

8.5 ⚰️

Component
Javascript 

Last updated 1 day ago

Created by

🇩🇪Germany dawehner

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024