-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A new package has been added for CommonJS projects. Primarily this configuration will allow CommonJS globals such as `require`. The environment config generation script was updated to support this new package. This required changes to allow combining both `shared-node-browser` and `commonjs` globals in the same configuration.
- Loading branch information
Showing
11 changed files
with
5,840 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [Unreleased] | ||
|
||
[Unreleased]: https://github.com/MetaMask/eslint-config/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 MetaMask | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# `@metamask/eslint-config-commonjs` | ||
|
||
MetaMask's ESLint configuration for projects using CommonJS. | ||
|
||
## Usage | ||
|
||
```bash | ||
yarn add --dev \ | ||
@metamask/eslint-config@^11.0.1 \ | ||
@metamask/eslint-config-commonjs@^11.0.2 \ | ||
eslint@^8.27.0 \ | ||
eslint-config-prettier@^8.5.0 \ | ||
eslint-plugin-import@^2.26.0 \ | ||
eslint-plugin-jsdoc@^39.6.2 \ | ||
eslint-plugin-prettier@^4.2.1 \ | ||
prettier@^2.7.1 | ||
``` | ||
|
||
The order in which you extend ESLint rules matters. | ||
The `@metamask/*` eslint configs should be added to the `extends` array _last_, | ||
with `@metamask/eslint-config` first, and `@metamask/eslint-config-*` in any | ||
order thereafter. | ||
|
||
```js | ||
module.exports = { | ||
extends: [ | ||
// This should be added last unless you know what you're doing. | ||
'@metamask/eslint-config', | ||
'@metamask/eslint-config-commonjs', | ||
], | ||
}; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const packageJson = require('./package.json'); | ||
|
||
module.exports = { | ||
displayName: packageJson.name, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"name": "@metamask/eslint-config-commonjs", | ||
"version": "11.0.2", | ||
"description": "Shareable MetaMask ESLint config for CommonJS projects.", | ||
"homepage": "https://github.com/MetaMask/eslint-config#readme", | ||
"bugs": { | ||
"url": "https://github.com/MetaMask/eslint-config/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/MetaMask/eslint-config.git" | ||
}, | ||
"license": "MIT", | ||
"main": "src/index.js", | ||
"files": [ | ||
"src/", | ||
"!src/**/*.test.js" | ||
], | ||
"scripts": { | ||
"lint:changelog": "auto-changelog validate", | ||
"publish": "npm publish", | ||
"test": "eslint ." | ||
}, | ||
"devDependencies": { | ||
"@metamask/auto-changelog": "^3.0.0", | ||
"eslint": "^8.27.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-jsdoc": "^39.6.2", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"prettier": "^2.7.1" | ||
}, | ||
"peerDependencies": { | ||
"eslint": "^8.27.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-jsdoc": "^39.6.2", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"prettier": "^2.7.1" | ||
}, | ||
"engines": { | ||
"node": ">=14.0.0" | ||
}, | ||
"publishConfig": { | ||
"access": "public", | ||
"registry": "https://registry.npmjs.org/" | ||
} | ||
} |
Oops, something went wrong.