Comparing version 3.2.0 to 4.0.0
#!/usr/bin/env node | ||
/* eslint no-console:0 */ | ||
// Based on https://gist.github.com/oculus42/99092766633ca2451e9d6e2217a94a80 | ||
const configs = require('../src/configs'); | ||
const run = require('../index'); | ||
@@ -18,18 +19,6 @@ const defaultArgs = ['airbnb']; | ||
// Check if the argument is one of our named configs | ||
if (configs[configName]) { | ||
// Args arrive as strings, so this might need more work. | ||
// Arrays and Objects are probably not convenient. | ||
console.log(`Installing ${configName}`); | ||
// Execute our configName with the rest of the command-line arguments | ||
configs[configName].apply(null, myArgs.slice(1)) | ||
.then(({ data }) => console.log(data), err => console.error(err)); | ||
} else { | ||
// You could put a default here if you don't want it to use the configs above | ||
console.log('The config you requested was not found.'); | ||
} | ||
run(configName); | ||
} else { | ||
// Required by another file | ||
module.exports = configs; | ||
module.exports = run; | ||
} |
15
index.js
@@ -1,1 +0,14 @@ | ||
module.exports = require('./src/configs'); | ||
/* eslint no-console:0 */ | ||
const getConfig = require('./src/getConfig'); | ||
const runConfig = require('./src/runConfig'); | ||
const run = configName => getConfig(configName) | ||
.then((config) => { | ||
console.log(`Installing ${configName}`); | ||
return config; | ||
}) | ||
.then(runConfig) | ||
.then(({ data }) => console.log(data), err => console.error(err)); | ||
module.exports = run; |
@@ -44,3 +44,3 @@ { | ||
}, | ||
"version": "3.2.0" | ||
"version": "4.0.0" | ||
} |
@@ -15,3 +15,3 @@ # Eastwood | ||
### Supported Rulesets | ||
### Internal Rulesets | ||
@@ -27,4 +27,18 @@ * `airbnb` - The [Airbnb Style Guide](http://airbnb.io/javascript/) as provided by [eslint-config-airbnb](https://www.npmjs.com/package/eslint-config-airbnb). | ||
### External Rulesets | ||
Rulesets not in the internal list will cause Eastwood to check for a npm package prefixed with `eastwood-config-`. | ||
`eastwood-config-example` has been created to demonstrate this. | ||
```bash | ||
npm install --save-dev eastwood-config-example | ||
eastwood example | ||
``` | ||
Currently, the package must be in the local `npm_modules` folder. Support for globally installed modules is upcoming. | ||
## Plans | ||
* Support checks for globally installed `eastwood-config-*` packages | ||
* Writing an `.eslintrc` to the local directory | ||
* Updating `.eslintrc` rather than just an initial write. | ||
@@ -36,3 +50,2 @@ * Updating `.editorconfig` rather than just an initial write. | ||
* Prettier? | ||
* Plugin support for configs? | ||
* Who knows? |
12395
16
293
49
2