ESLint shareable config for internal projects at Titanium
Install ESLint locally.
You don't need ESLint if you use create-react-app boilerplate.
$ npm install eslint --save-dev
Install eslint-config-titanium with peer dependencies
$ npm install --save-dev eslint-config-airbnb eslint-config-prettier eslint-plugin-jest eslint-plugin-react eslint-config-titanium
Once the eslint-config-titanium
package is installed, you can use it by specifying titanium
in the extends
section of your ESLint configuration.
{
"extends": "titanium",
"rules": {
// Additional, per-project rules...
}
}
To use Titanium style in conjunction with ESLint's recommended rule set, extend them both, making sure to list titanium
last:
{
"extends": ["eslint:recommended", "titanium"],
"rules": {
// Additional, per-project rules...
}
}
To see how the titanium
config compares with eslint:recommended
, refer to the source code of index.js
, which lists every ESLint rule along with whether (and how) it is enforced by the titanium
config.