@mgtitimoli/eslint-config
v0.3.0
Published
A predictable and strict ESLint Shareable Config
Downloads
3
Readme
@mgtitimoli / eslint-config
A predictable and strict ESLint Shareable Config
Installation
$ npm install --save-dev eslint @mgtitimoli/eslint-config
This configuration just specifies a group of ESLint settings, this is why we need to install
eslint
, since by its use (also have a look to the available integrations), is how we check our rules are respected
Usage
[ DISCLAIMER ]
I decided not to extend eslint:recommended configuration to support setups where this is not desired (I personally have not found any one yet, but it might appear... long silence... someday...). Anyway, if you want to use it together with this config, and I highly recommend you to do that, it is as simple as using on each part of the documentation where it says:
"@mgtitimoli/eslint-config"
the following instead:
[
"eslint:recommended",
"@mgtitimoli/eslint-config"
]
We can do this since ESLint does not restrict you to extend just one configuration file
General
ESLint allows being configured using a widely amount of flavours, but I personally find the followings very practical:
- Place all the settings under an eslintConfig entry in your
package.json
:
{
"name": "my-awesome-project",
"eslintConfig": {
"extends": "@mgtitimoli/eslint-config"
}
}
- Create an
.eslintrc.json
to hold all the configuration:
{
"extends": "@mgtitimoli/eslint-config"
}
Custom
This configuration, at the same time, extends the following ones (also present in this package)
- @mgtitimoli/eslint-config/best-practices
- @mgtitimoli/eslint-config/variables
- @mgtitimoli/eslint-config/stylistic
- @mgtitimoli/eslint-config/es6
You can pick just the one(s) that you need, specifying them as follows:
- For example, if you would want to use best-practices and variables configurations, then your
.eslintrc.json
should contain:
{
"extends": [
"@mgtitimoli/eslint-config/best-practices",
"@mgtitimoli/eslint-config/variables"
]
}
About
I will enumerate below some of the reasons that pushed me to publish this package:
- The obvious one: it allows anyone to be able to use it just doing a simple
npm install
- I have been using this configuration in a lot of projects and I really liked their resulting shape and low complexity
- It helps me sharing my passion about code quality and best practices, and encourages teams to take some time to discuss about this
Other configurations
You might also be interested in the following configurations: