https://github.com/parro-it/eslint-config-features
Automatically configure eslint ecmaFeatures according to package.json `engines` field.
https://github.com/parro-it/eslint-config-features
Last synced: about 1 year ago
JSON representation
Automatically configure eslint ecmaFeatures according to package.json `engines` field.
- Host: GitHub
- URL: https://github.com/parro-it/eslint-config-features
- Owner: parro-it
- License: mit
- Created: 2016-01-13T09:39:44.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-02-08T22:30:12.000Z (over 10 years ago)
- Last Synced: 2024-10-10T18:23:15.796Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 15.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# eslint-config-features
> Automatically configure eslint ecmaFeatures according to package.json `engines` field.
[](http://travis-ci.org/parro-it/eslint-config-features)
[](https://npmjs.org/package/eslint-config-features)
[](https://npmjs.org/package/eslint-config-features)
# Usage
Install the module as a development dependency:
```bash
npm install -D eslint-config-features
```
Then, you have to configure it as a eslint configuration preset.
In your package.json files, add:
```js
"eslintConfig": {
"extends": [
"features"
]
},
```
You also need to add an `engines` section to `package.json`, to let this module know what minimum node version you target, e.g.:
```js
"engines": {
"node": ">=0.12"
},
```
Now, whenever you lint your code with eslint, you get
the set of es2015 rules supported by node 0.12.
# How it works
It uses [babel-preset-es2015-auto](https://www.npmjs.com/package/babel-preset-es2015-auto) module to discover what babel-transforms are required by node version you specify in `engines` features.
The babel transforms not needed are already implemented natively by node, so they are converted
to eslint rules using [babelplugin-to-eslintrule](https://github.com/parro-it/babelplugin-to-eslintrule)
# Related modules
* [babel-preset-es2015-auto](https://github.com/jakepusateri/auto-babel) - a project that aims to bring autoprefixer-like functionality to babel.
* [babelplugin-to-eslintrule](https://github.com/parro-it/babelplugin-to-eslintrule) - Map babel plugins to corresponding eslint ecmaFeatures
* [semver-first-satisfied](https://github.com/parro-it/semver-first-satisfied) -Find minimum in an array of versions that satisfies a semver range.
# License
The MIT License (MIT)
Copyright (c) 2016 Andrea Parodi