eslint-config-braintree v6.0.1
eslint-config-braintree
Shared linting configuration for braintree js projects.
- index.js: shared configuration
- client.js: client side configuration
- server.js: server side configuration
- jsdoc.js: jsdoc configuration
Consuming
Install eslint@^8
npm install eslint@^8Install the eslint config
npm i --save-dev eslint-config-braintreeEslint requires all the plugins that the configu uses to be installed at the root of the project as well.
npm i --save-dev @typescript-eslint/eslint-plugin eslint-plugin-prettierIn your project's .eslintrc.*:
yaml
default
---
extends: braintreebrowserify
---
extends: braintree/clientnode
---
extends: braintree/serverbrowserify + es6
---
extends:
- braintree/client
- braintree/es6json
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.
12 months ago
2 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
8 years ago
9 years ago
10 years ago
10 years ago