Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eslint: switch from custom rules to eslint-config-wikimedia #1976

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Jun 22, 2024

  1. https://github.com/wikimedia/eslint-config-wikimedia

    Why switch?
    - it's standard for wikimedia projects
    - it has some cool features such as jquery deprecation warnings, and enforcing a specific version of JavaScript
    - I believe it has many more rules than our previous configuration, which will help with identifying areas of the code to modernize
    
    What this patch does
    - delete all old linter rules, except for these rules I carried over:
    	- `no-nested-ternary`
    	- `no-restricted-syntax` for `.done()` and `.fail()`
    - upgrade eslint a couple minor versions
    - add eslint-config-wikimedia and its default rules
    - disable controversial rules such as
    	- whitespace in parentheses (`space-in-parens`, `space-before-function-paren`, `array-bracket-spacing`, `computed-property-spacing`, `object-curly-spacing`)
    	- max line length 100 (`max-len`)
    - disable some rules
    	- `indent` because it would involve touching almost every line, messing up git blame (although I may autofix this in the future and set a .git-blame-ignore-revs to reduce git blame spam)
    	- `wrap-iife` to reduce VS Code yellow underline spam (will autofix this in a future patch)
    	- couple others that I don't like and have disabled in my other projects
    - set it to ES6 since wikimedia "modern layer" support is now on ES6
    - warn/error for syntax or internal functions higher than ES6 (this is more thorough than the old >ES6 detection we were using)
    - set all remaining detected violations to "warn" for now, so that CI passes
    - will apply autofixes for all the rules that "warn" in a future patch
    
    The rules are in two groups, with an extra line break in the middle separating them.
    - The top group are rules that should not be fixed
    - The bottom group are rules that should be fixed over time via autofixes and manual fixing. Once everything for that rule is fixed, that rule can be deleted, so that the linter starts enforcing it in CI.
    
    Over time, rules will be fixed and removed from the config, and the code will be incrementally modernized, until it arrives at the Wikimedia standard.
    NovemLinguae committed Jun 22, 2024
    Configuration menu
    Copy the full SHA
    d4f15ae View commit details
    Browse the repository at this point in the history

Commits on Sep 6, 2024

  1. Configuration menu
    Copy the full SHA
    7f92399 View commit details
    Browse the repository at this point in the history