Skip to content

Commit

Permalink
Merge pull request #32 from oceanprotocol/feature/updates
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
kremalicious committed Aug 19, 2019
2 parents e8365ff + 84ff8f7 commit 3bc6738
Show file tree
Hide file tree
Showing 7 changed files with 259 additions and 89 deletions.
5 changes: 3 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"extends": "./index.js"
}
"extends": ["./index.js", "prettier/standard", "plugin:prettier/recommended"],
"plugins": ["prettier"]
}
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "none"
}
117 changes: 117 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
### Changelog

All notable changes to this project will be documented in this file. Dates are displayed in UTC.

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v1.3.0](https://github.com/oceanprotocol/eslint-config-oceanprotocol/compare/v1.3.0...v1.3.0)

> 19 August 2019
- Update release-it to the latest version 馃殌 [`#28`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/pull/28)
- Update eslint-plugin-node to the latest version 馃殌 [`#27`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/pull/27)
- Update release-it to the latest version 馃殌 [`#26`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/pull/26)
- Update release-it to the latest version 馃殌 [`#24`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/pull/24)
- Update release-it to the latest version 馃殌 [`#23`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/pull/23)
- Standardize contrib guidelines across public repos [`#22`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/pull/22)
- 1.3.0 [`#20`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/pull/20)
- Update release-it to the latest version 馃殌 [`#21`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/pull/21)
- chore(package): update release-it to version 12.0.0 [`9016b6d`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/9016b6ddbccb48872a8a49f5a8155eca992c622c)
- fix(package): update eslint-plugin-node to version 9.0.0 [`075796a`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/075796a71e53b2b33f298bce487ddcce0022cf5e)
- chore(package): update release-it to version 11.0.0 [`b8b3649`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/b8b364962b5a7a06eeb60be50d756d9ceaeed60e)

#### [v1.2.0](https://github.com/oceanprotocol/eslint-config-oceanprotocol/compare/v1.1.1...v1.2.0)

> 29 August 2018
- sync dependencies [`#17`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/pull/17)
- chore(package): update eslint-config-standard-react to version 7.0.2 [`#16`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/pull/16)
- Update eslint-plugin-standard to the latest version 馃殌 [`#14`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/pull/14)
- Update eslint-config-standard to the latest version 馃殌 [`#15`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/pull/15)
- chore(package): update eslint-config-standard-react to version 7.0.2 [`#13`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/issues/13)
- Release 1.2.0 [`3c567db`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/3c567dbcf2785823d996a5ea4ddfc5bfdacdf90c)
- fix syntax [`832431e`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/832431eab791d563961f9f7b4a06cec308791c90)
- chore(package): update eslint-config-standard to version 12.0.0 [`72c6c5a`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/72c6c5a55668497974e80b19e2258d6ca5185901)

#### [v1.1.1](https://github.com/oceanprotocol/eslint-config-oceanprotocol/compare/v1.1.0...v1.1.1)

> 27 August 2018
- Disable detect-object-injection [`#12`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/pull/12)
- Release 1.1.1 [`5516427`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/5516427fa3dc182accb540bcadd259dd43948c4e)

#### [v1.1.0](https://github.com/oceanprotocol/eslint-config-oceanprotocol/compare/v1.0.7...v1.1.0)

> 24 August 2018
- add eslint-plugin-security [`#11`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/pull/11)
- Feature/recommended [`#8`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/pull/8)
- add codacy badge [`#10`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/pull/10)
- Update eslint-plugin-promise to the latest version 馃殌 [`#7`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/pull/7)
- add eslint-plugin-security checking for security issues [`8b9b2a4`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/8b9b2a44a9c409d3c6150c0de8815748ad2c6b74)
- load recommended styles [`c6fefea`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/c6fefea1e40b9e8af1ee74adc29ba3219b27ef2f)
- Release 1.1.0 [`0b36b56`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/0b36b56ac88699060d9853acd76697550271a679)

#### [v1.0.7](https://github.com/oceanprotocol/eslint-config-oceanprotocol/compare/v1.0.6...v1.0.7)

> 26 July 2018
- chore(package): update eslint-plugin-node to version 7.0.1 [`#6`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/pull/6)
- chore(package): update eslint-plugin-node to version 7.0.1 [`#5`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/issues/5)
- add list of editor plugins [`b566e5a`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/b566e5a171a112c83885d8e4a7a0ad49d1143416)
- Release 1.0.7 [`8d6a2c7`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/8d6a2c77c9511785e134043d908c8062d382687f)
- sync peerDependencies [`aaeb34e`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/aaeb34ec68fbc762329e4a689b5f7ad45d29b03f)

#### [v1.0.6](https://github.com/oceanprotocol/eslint-config-oceanprotocol/compare/v1.0.5...v1.0.6)

> 28 June 2018
- Enforce consistent spacing inside braces [`#4`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/pull/4)
- Release 1.0.6 [`6331166`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/63311664268a04ac1eff3652f9626d6db9b701e1)

#### [v1.0.5](https://github.com/oceanprotocol/eslint-config-oceanprotocol/compare/v1.0.4...v1.0.5)

> 28 June 2018
- prefer destructuring from arrays and objects [`#3`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/pull/3)
- Add Greenkeeper badge 馃尨 [`#1`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/pull/1)
- tweak dependencies [`016f733`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/016f733142f86315c446776ef4d3ad42cff4003f)
- Release 1.0.5 [`5950c5e`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/5950c5ed8f2a94b4d86dc94f6e955fca919dabc3)
- docs(readme): add Greenkeeper badge [`6a3e33b`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/6a3e33b2a35fce7e9cae4e59ddbb17729c84b0ab)

#### [v1.0.4](https://github.com/oceanprotocol/eslint-config-oceanprotocol/compare/v1.0.3...v1.0.4)

> 27 June 2018
- fix react config [`24d4327`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/24d43272f0ad885b514ac0de45ac204ad9e9d56d)
- mention 2FA for npm releases [`57f107c`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/57f107c7c542bac1134ea2dc383dc21d80e4035e)
- Release 1.0.4 [`45d9c85`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/45d9c8532e6da52b78896d599505bbd5ba898f90)

#### [v1.0.3](https://github.com/oceanprotocol/eslint-config-oceanprotocol/compare/v1.0.2...v1.0.3)

> 27 June 2018
- Release 1.0.3 [`252f641`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/252f641b64da005febaf3ab987b6dd60d7ef9961)

#### [v1.0.2](https://github.com/oceanprotocol/eslint-config-oceanprotocol/compare/v1.0.1...v1.0.2)

> 27 June 2018
- add TOC [`0f36c56`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/0f36c563f0e350b2eaa479f5e896cdac3d4d1277)
- update usage instructions [`377798a`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/377798a8aadbc1237bc8f85fc1701bfde2eed638)
- Release 1.0.2 [`94854f4`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/94854f474d6dc4615539bb9e613598184ac02333)

#### [v1.0.1](https://github.com/oceanprotocol/eslint-config-oceanprotocol/compare/v1.0.0...v1.0.1)

> 27 June 2018
- Release 1.0.1 [`ae776b5`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/ae776b55cfbe3d0073bed42cc3e35c411780cec8)
- fix repo link [`8543270`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/854327083627bbb440e715451488645bc158bd95)

#### v1.0.0

> 27 June 2018
- add license [`34914f0`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/34914f0c30e0542f4ad8288dc2d8080763ff9b57)
- drop da base 馃拝 [`afa2615`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/afa26153bcd873022ceaf8867e73d5679ac23226)
- test & release setup [`955343e`](https://github.com/oceanprotocol/eslint-config-oceanprotocol/commit/955343e62f49b57fb8f083d3db5a5c0a5b2bb735)
91 changes: 60 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,24 @@ This cat clearly forgot to lint her JavaScript before deployment:

Don't be like that cat.

## Table of Contents

- [Usage](#usage)
- [React](#react)
- [Editor Plugins](#editor-plugins)
- [Rules](#rules)
- [Development](#development)
- [npm releases](#npm-releases)
- [License](#license)
**Table of Contents**

- [Usage](#usage)
- [React](#react)
- [Prettier](#prettier)
- [Editor Plugins](#editor-plugins)
- [Rules](#rules)
- [Development](#development)
- [npm releases](#npm-releases)
- [Changelog](#changelog)
- [Contributing](#contributing)
- [License](#license)

---

## Usage

For every project containing JavaScript, ESLint should be set up with this config.
For every project containing JavaScript, ESLint should be set up with this base setup.

```bash
npm install --save-dev eslint eslint-config-oceanprotocol
Expand All @@ -49,7 +52,7 @@ Then, create a new file `.eslintrc` in the root of your project and fill with:
When using within a React project use this to get set up:

```bash
npm install --save-dev eslint eslint-config-oceanprotocol
npm i -D eslint eslint-config-oceanprotocol
```

And in your `.eslintrc`:
Expand All @@ -60,6 +63,33 @@ And in your `.eslintrc`:
}
```

### Prettier

Additionally, you should add [Prettier](https://prettier.io) to your project and work with it through ESLint:

```bash
npm i -D prettier eslint-config-prettier eslint-plugin-prettier
```

Then add a `.prettierrc` file to the root of your project with this content:

```json
{
"semi": false,
"singleQuote": true,
"trailingComma": "none"
}
```

Finally, modify your `.eslintrc`:

```json
{
"extends": ["oceanprotocol", "prettier/standard", "plugin:prettier/recommended"],
"plugins": ["prettier"]
}
```

### Editor Plugins

For maximum fun during coding, install an ESLint plugin in your favorite editor to get suggestions and autofixes as you type.
Expand Down Expand Up @@ -105,37 +135,36 @@ npm test

## npm releases

For a new **patch release**, execute on the machine where you're logged into your npm account:
From a clean `master` branch you can run any release task doing the following:

```bash
npm run release
```
- bumps the project version in `package.json`, `package-lock.json`
- auto-generates and updates the CHANGELOG.md file from commit messages
- creates a Git tag
- commits and pushes everything
- creates a GitHub release with commit messages as description
- Git tag push will trigger Travis to do a npm release

Command is powered by [`release-it`](https://github.com/webpro/release-it) package, defined in the `package.json`. You can execute the script using arguments to bump the version accordingly:

- To bump a patch version: `npm run release`
- To bump a minor version: `npm run release minor`
- To bump a major version: `npm run release major`

For the GitHub releases steps a GitHub personal access token, exported as `GITHUB_TOKEN` is required. [Setup](https://github.com/release-it/release-it#github-releases)

In case you have 2FA setup on npm.js, pass a code as One Time Password:

```bash
npm run release --otp <yourcode>
```

Command is powered by [`release-it`](https://github.com/webpro/release-it) package, defined in the `package.json`.

That's what the command does without any user interaction:
## Changelog

- create release commit by updating version in `package.json`
- create tag for that release commit
- push commit & tag
- create a new release on GitHub, with change log auto-generated from commit messages
- publish to npm as a new release
See the [CHANGELOG.md](./CHANGELOG.md) file. This file is auto-generated during the above mentioned release process.

If you want to create a **minor** or **major release**, use these commands:
## Contributing

```bash
npm run release-minor
```

```bash
npm run release-major
```
See the page titled "[Ways to Contribute](https://docs.oceanprotocol.com/concepts/contributing/)" in the Ocean Protocol documentation.

## License

Expand Down
60 changes: 30 additions & 30 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
module.exports = {
extends: [
'eslint:recommended',
'plugin:security/recommended',
'standard'
],
extends: ['eslint:recommended', 'plugin:security/recommended', 'standard'],

'plugins': ['security'],
plugins: ['security'],

rules: {
'indent': [2, 4, { 'SwitchCase': 1, 'VariableDeclarator': 1 }],
'space-before-function-paren': [2, { 'anonymous': 'never', 'named': 'never' }],
rules: {
indent: [2, 4, { SwitchCase: 1, VariableDeclarator: 1 }],
'space-before-function-paren': [2, { anonymous: 'never', named: 'never' }],

// Prefer destructuring from arrays and objects
// https://eslint.org/docs/rules/prefer-destructuring
'prefer-destructuring': ['error', {
VariableDeclarator: {
array: false,
object: true
},
AssignmentExpression: {
array: true,
object: true
}
}, {
enforceForRenamedProperties: false
}],
// Prefer destructuring from arrays and objects
// https://eslint.org/docs/rules/prefer-destructuring
'prefer-destructuring': [
'error',
{
VariableDeclarator: {
array: false,
object: true
},
AssignmentExpression: {
array: true,
object: true
}
},
{
enforceForRenamedProperties: false
}
],

// Enforce consistent spacing inside braces
// https://eslint.org/docs/rules/object-curly-spacing
'object-curly-spacing': ['error', 'always'],
// Enforce consistent spacing inside braces
// https://eslint.org/docs/rules/object-curly-spacing
'object-curly-spacing': ['error', 'always'],

// Disable detect-object-injection
// https://github.com/nodesecurity/eslint-plugin-security/issues/21
'security/detect-object-injection': 0
}
// Disable detect-object-injection
// https://github.com/nodesecurity/eslint-plugin-security/issues/21
'security/detect-object-injection': 0
}
}
Loading

0 comments on commit 3bc6738

Please sign in to comment.