Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
eslint-config-wikimedia
Advanced tools
npm install --save-dev eslint-config-wikimedia
Then, configure ESLint with one or more .eslintrc.json
files as appropriate.
Below are some potential recommended uses:
This config allows ES6 code and browser native functions. It will complain about ES2016+ code and language features.
It also automatically applies the Vue plugin and Vue-specific rules to .vue
files.
.eslintrc.json
:
{
"extends": "wikimedia/client/es6"
}
If you want to only allow ES5 code and browser native functions, you can use wikimedia/client/es5
instead.
This config adds the jQuery $
global, and additional rules preventing the use of jQuery features which are deprecated, have performance issues, or have simple ES6 alternatives.
.eslintrc.json
:
{
"extends": [
"wikimedia/client/es6",
"wikimedia/jquery"
]
}
Code that runs in MediaWiki can use this config. It enforces rules that are specific to the MediaWiki codebase (core and extensions), such as correct documentation of mw.message
usage, and prohibiting self-closing tags in Vue templates.
.eslintrc.json
:
{
"extends": [
"wikimedia/client/es6",
"wikimedia/mediawiki"
]
}
You can extend the above config by also adding a second .eslintrc.json
file in your tests directory:
tests/qunit/.eslintrc.json
:
{
"extends": [
"wikimedia/mediawiki/qunit"
]
}
Or for standalone JavaScript libraries and Node.js projects:
tests/.eslintrc.json
:
{
"extends": [
"wikimedia/qunit"
]
}
The following config will the Mocha environment and some Mocha related rules:
tests/mocha/.eslintrc.json
:
{
"root": true,
"extends": [
"wikimedia/server",
"wikimedia/mocha"
]
}
The following config will enable WDIO globals, as well as the Mocha and server configs:
tests/selenium/.eslintrc.json
:
{
"root": true,
"extends": [
"wikimedia/selenium"
]
}
This config allows ES2018 code and Node native functions (i.e., Node 10.x). It will complain about ES2019+ code and language features.
.eslintrc.json
:
{
"extends": "wikimedia/server"
}
The wikimedia/server
config consists of wikimedia
, wikimedia/node
and wikimedia/language/es2018
. To use later versions of ES, for example ES2019, you can use the following config:
.eslintrc.json
:
{
"extends": [
"wikimedia",
"wikimedia/node",
"wikimedia/language/es2019"
]
}
Please note that the basic project configuration does not specify any language or environmental defaults, and is unlikely to be suitable. However, if you wish to target clients with ES3 language support, or earlier versions of Node, this is a good place from which to start.
.eslintrc.json
:
{
"extends": "wikimedia"
}
Major changes should be discussed on mediawiki.org or on the Wikitech mailing list beforehand.
Same approach as in ESLint, see https://github.com/eslint/eslint#user-content-semantic-versioning-policy.
FAQs
ESLint config following Wikimedia code conventions.
We found that eslint-config-wikimedia demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 25 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.