Skip to content

Latest commit

 

History

History
264 lines (210 loc) · 15.6 KB

BUNDLES.md

File metadata and controls

264 lines (210 loc) · 15.6 KB

eslint Configuration Bundles

This module contains several different configurations for eslint. These bundles in turn package together specific pairings of our eslint configuration for eslint rules, environments, and rule overrides to provide you with a singular, complete eslint configuration for a variety of types of codebase scenarios.

We highly recommend that you use one of the provided bundles when utilizing this module, but you can optionally use any combination our underlying rule configurations, environment configurations, and/or rule override configurations if you'd like.

The below table summarizes all of the various eslint configuration bundles that are included in this module, and the value listed for Consumption Path for the bundle is what you'd add to the value of your eslint config file extends key to utilize that configuration. Each configuration bundle has a partner bundle (has a ts- prefix in the bundle name) that is geared for run the same eslint configuration, but in a repo that contains TypeScript source.

Bundle Summary Consumption Path
node Our primary eslint config for node.js targetted codebases which utilizes our configuration of the eslint:recommended ruleset. Should be the default config option for node.js repos. @swellaby/eslint-config
ts-node Same as above, but use when your source code is TypeScript and eslint is primarily analyzing transpiled JavaScript. Should be the default config option for node.js targetted repos with TypeScript source. @swellaby/eslint-config/lib/bundles/ts-node
browser Our primary eslint config lib for browser/web targetted codebases which utilizes our configuration of the eslint:recommended ruleset. Should be the default config option for browser/web repos. @swellaby/eslint-config/lib/bundles/browser
ts-browser Same as above, but use when your source code is TypeScript and eslint is primarily analyzing transpiled JavaScript. Should be the default config option for browser/web repos with TypeScript source. @swellaby/eslint-config/lib/bundles/ts-browser
node-browser Our eslint config for codebases that have a mix of code targetted both for node.js as well as browser/web. Utilizes our configuration of the eslint:recommended ruleset. @swellaby/eslint-config/lib/bundles/node-browser
ts-node-browser Same as above, but use when your source code is TypeScript and eslint is primarily analyzing transpiled JavaScript. Utilizes our configuration of the eslint:recommended ruleset. Use with codebases that have a mix of code targetted both for node.js as well as browser/web with TypeScript source @swellaby/eslint-config/lib/bundles/ts-node-browser
node-all A more complex eslint config for node.js codebases, utilizing the eslint:all ruleset. Use this config option for node.js repos where you want to enforce a stricter set of linting rules. @swellaby/eslint-config/lib/bundles/node-all
ts-node-all Same as above, but use when your source code is TypeScript and eslint is primarily analyzing transpiled JavaScript. Use this config option for node.js targetted repos with TypeScript source where you want to enforce a stricter set of linting rules. @swellaby/eslint-config/lib/bundles/ts-node-all
browser-all A more complex eslint config for browser/web targetted codebases, utilizing the eslint:all ruleset. Use this config option for browser/web repos where you want to enforce a stricter set of linting rules. @swellaby/eslint-config/lib/bundles/browser-all
ts-browser-all Same as above, but use when your source code is TypeScript and eslint is primarily analyzing transpiled JavaScript. Use this config option for browser/web targetted repos with TypeScript source where you want to enforce a stricter set of linting rules. @swellaby/eslint-config/lib/bundles/ts-browser-all
node-browser-all A more complex eslint config for codebases that have a mix of code targetted both for node.js as well as browser/web. Utilizes our configuration of the eslint:all ruleset so use it when you want to enforce a stricter set of linting rules @swellaby/eslint-config/lib/bundles/node-browser-all
ts-node-browser-all Same as above, but use when your source code is TypeScript and eslint is primarily analyzing transpiled JavaScript. Use this config option for repos targetting both node and browser/web with TypeScript source where you want to enforce a stricter set of linting rules. @swellaby/eslint-config/lib/bundles/ts-node-browser-all

node Bundle

This is our default configuration for node.js targetted repos, and it is also the default configuration exported by the module.

You can consume this eslint configuration by adding the value: @swellaby/eslint-config to the extends key in your eslint configuration file. For example:

{
    "extends": [ "@swellaby/eslint-config" ]
}

This bundle utilizes:

Back to Top

ts-node Bundle

This is the same configuration as our default node bundle, except that it is designed to be used when the repo contains source TypeScript code and eslint is linting transpiled/emitted JavaScript files.

You can consume this eslint configuration by adding the value: @swellaby/eslint-config/lib/bundles/ts-node to the extends key in your eslint configuration file. For example:

{
    "extends": [ "@swellaby/eslint-config/lib/bundles/ts-node" ]
}

This bundle utilizes:

Back to Top

browser Bundle

This is our default configuration for browser/web targetted repos.

You can consume this eslint configuration by adding the value: @swellaby/eslint-config/lib/bundles/browser to the extends key in your eslint configuration file. For example:

{
    "extends": [ "@swellaby/eslint-config/lib/bundles/browser" ]
}

This bundle utilizes:

Back to Top

ts-browser Bundle

This is the same configuration as our default browser bundle, except that it is designed to be used when the repo contains source TypeScript code and eslint is linting transpiled/emitted JavaScript files.

You can consume this eslint configuration by adding the value: @swellaby/eslint-config/lib/bundles/ts-browser to the extends key in your eslint configuration file. For example:

{
    "extends": [ "@swellaby/eslint-config/lib/bundles/ts-browser" ]
}

This bundle utilizes:

Back to Top

node-browser Bundle

A combintation of our node and browser configuration bundles designed for repos that have JavaScript code both targetted browser/web as well as node.js.

You can consume this eslint configuration by adding the value: @swellaby/eslint-config/lib/bundles/node-browser to the extends key in your eslint configuration file. For example:

{
    "extends": [ "@swellaby/eslint-config/lib/bundles/node-browser" ]
}

This bundle utilizes:

Back to Top

ts-node-browser Bundle

This is the same configuration as our node-browser bundle, except that it is designed to be used when the repo contains source TypeScript code and eslint is linting transpiled/emitted JavaScript files.

You can consume this eslint configuration by adding the value: @swellaby/eslint-config/lib/bundles/ts-node-browser to the extends key in your eslint configuration file. For example:

{
    "extends": [ "@swellaby/eslint-config/lib/bundles/ts-node-browser" ]
}

This bundle utilizes:

Back to Top

node-all Bundle

Similar to our node bundle, but utilizes our configuration of the broader eslint:all ruleset.

You can consume this eslint configuration by adding the value: @swellaby/eslint-config/bundles/node-all to the extends key in your eslint configuration file. For example:

{
    "extends": [ "@swellaby/eslint-config/lib/bundles/node-all" ]
}

This bundle utilizes:

Back to Top

ts-node-all Bundle

This is the same configuration as our node-all bundle, except that it is designed to be used when the repo contains source TypeScript code and eslint is linting transpiled/emitted JavaScript files.

You can consume this eslint configuration by adding the value: @swellaby/eslint-config/lib/bundles/ts-node-all to the extends key in your eslint configuration file. For example:

{
    "extends": [ "@swellaby/eslint-config/lib/bundles/ts-node-all" ]
}

This bundle utilizes:

Back to Top

browser-all Bundle

Similar to our browser bundle, but utilizes our configuration of the broader eslint:all ruleset.

You can consume this eslint configuration by adding the value: @swellaby/eslint-config/lib/bundles/browser-all to the extends key in your eslint configuration file.

For example:

{
    "extends": [ "@swellaby/eslint-config/lib/bundles/browser-all" ]
}

This bundle utilizes:

Back to Top

ts-browser-all Bundle

This is the same configuration as our browser-all bundle, except that it is designed to be used when the repo contains source TypeScript code and eslint is linting transpiled/emitted JavaScript files.

You can consume this eslint configuration by adding the value: @swellaby/eslint-config/lib/bundles/ts-browser-all to the extends key in your eslint configuration file. For example:

{
    "extends": [ "@swellaby/eslint-config/lib/bundles/ts-browser-all" ]
}

This bundle utilizes:

Back to Top

node-browser-all Bundle

Similar to our node-browser bundle, but utilizes our configuration of the broader eslint:all ruleset.

You can consume this eslint configuration by adding the value: @swellaby/eslint-config/lib/bundles/node-browser-all to the extends key in your eslint configuration file.

For example:

{
    "extends": [ "@swellaby/eslint-config/lib/bundles/node-browser-all" ]
}

This bundle utilizes:

Back to Top

ts-node-browser-all Bundle

This is the same configuration as our node-browser-all bundle, except that it is designed to be used when the repo contains source TypeScript code and eslint is linting transpiled/emitted JavaScript files.

You can consume this eslint configuration by adding the value: @swellaby/eslint-config/lib/bundles/ts-node-browser-all to the extends key in your eslint configuration file. For example:

{
    "extends": [ "@swellaby/eslint-config/lib/bundles/ts-node-browser-all" ]
}

This bundle utilizes:

Back to Top