Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-config-oceanprotocol

Package Overview
Dependencies
Maintainers
4
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-oceanprotocol

ESLint configuration for all of Ocean Protocol's JavaScript

  • 1.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
682
increased by20.28%
Maintainers
4
Weekly downloads
 
Created
Source

banner

eslint-config-oceanprotocol

💅 🦋 Shareable ESLint config for keeping JavaScript consistent across all of Ocean Protocol's projects, built upon JavaScript Standard Style.

js oceanprotocol npm Build Status Codacy Badge Greenkeeper badge

This cat clearly forgot to lint her JavaScript before deployment:

cat not linting correctly
Exhibit A: cat not linting correctly

Don't be like that cat.

Table of Contents


Usage

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

npm install --save-dev eslint eslint-config-oceanprotocol

Then, create a new file .eslintrc in the root of your project and fill with:

{
  "extends": "oceanprotocol"
}

React

When using within a React project use this to get set up:

npm install --save-dev eslint eslint-config-oceanprotocol

And in your .eslintrc:

{
  "extends": ["oceanprotocol", "oceanprotocol/react"]
}

Editor Plugins

For maximum fun during coding, install an ESLint plugin in your favorite editor to get suggestions and autofixes as you type.

Rules

We keep it simple and follow almost everything defined in the JavaScript Standard Style. Only deviations are:

  • indentation: 4
  • no space before function parenthesis
  • double quotes for jsx attributes
  • prefer destructuring from objects & arrays
  • enforce spacing inside curly braces

Development

Again, keeping it simple with 2 files for now:

  • index.js: holds all the custom JavaScript linting rules
  • react.js: holds all the custom React linting rules

For local development, clone this repo and install all dependencies:

git clone git@github.com:oceanprotocol/eslint-config-oceanprotocol.git
cd eslint-config-oceanprotocol/

npm i

Linting is setup against the actual rules within this repo so for testing new rules against every js file in this repo, you can run:

npm test

npm releases

For a new patch release, execute on the machine where you're logged into your npm account:

npm run release

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

npm run release --otp <yourcode>

Command is powered by release-it package, defined in the package.json.

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

  • 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

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

npm run release-minor
npm run release-major

License

Copyright 2018 Ocean Protocol Ltd.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Keywords

FAQs

Package last updated on 29 Oct 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc