GithubHelp home page GithubHelp logo

isabella232 / eslint-config-4 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from braintree/eslint-config

0.0 0.0 0.0 394 KB

Shared linting configuration for braintree js projects

License: MIT License

JavaScript 4.46% TypeScript 95.54%

eslint-config-4's Introduction

eslint-config-braintree

Shared linting configuration for braintree js projects.

Consuming

Install the eslint config

npm i --save-dev eslint-config-braintree

In your project's .eslintrc.*:

yaml

default

---
extends: braintree

browserify

---
extends: braintree/client

node

---
extends: braintree/server

browserify + es6

---
extends:
  - braintree/client
  - braintree/es6

json

default

{
  "extends": "braintree"
}

browserify

{
  "extends": "braintree/client"
}

node

{
  "extends": "braintree/server"
}

browserify + es6

{
  "extends": ["braintree/client", "braintree/es6"]
}

You can specify a .eslintrc for a subdirectory to change the rules that are enforced. For instance, in a node project you could extend from eslint-config-braintree/server at the top-level, and eslint-braintree-config/client at the public/.eslintrc level.

See Configuration File Formats for information on all supported .eslintrc file formats.

To override rules, add the new config under rules in your rc file. Be sure to properly override any options set by the parent. See Extending Configuration Files for details.

For example, to change the no-new-object rule to warn instead of error:

---
extends: braintree/server
rules:
  no-new-object: 1
{
  "extends": "braintree/server",
  "rules": {
    "no-new-object": 1
  }
}

In another example, to allow end of line comments, you'd override the "no-multi-spaces" rule options:

---
extends: braintree/server
rules:
  no-multi-spaces:
    - 2
    - ignoreEOLComments: false
{
  "extends": "braintree/server",
  "rules": {
    "no-multi-spaces": [2, { "ignoreEOLComments": false }]
  }
}

Test Files

By default, any files in a __tests__ folder, whether at the top level of the directory or within another directory will be configured to be used in the Jest and ES2020 environments.

eslint-config-4's People

Contributors

crookedneighbor avatar braintreeps avatar gesa avatar msv avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.