Skip to content

Commit

Permalink
Merge pull request #99 from Flet/remove-rules
Browse files Browse the repository at this point in the history
Remove "rules" option
  • Loading branch information
feross committed Apr 24, 2016
2 parents 252751f + b52a158 commit 365eb9c
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ function Linter (opts) {
useEslintrc: false,
globals: [],
plugins: [],
envs: [],
rules: {}
envs: []
})
if (!self.eslintConfig) {
throw new Error('No eslintConfig passed.')
Expand All @@ -51,7 +50,6 @@ function Linter (opts) {
* @param {Array.<string>=} opts.globals custom global variables to declare
* @param {Array.<string>=} opts.plugins custom eslint plugins
* @param {Array.<string>=} opts.envs custom eslint environment
* @param {Object=} opts.rules custom eslint rules
* @param {string=} opts.parser custom js parser (e.g. babel-eslint)
* @param {function(Error, Object)} cb callback
*/
Expand Down Expand Up @@ -79,7 +77,6 @@ Linter.prototype.lintText = function (text, opts, cb) {
* @param {Array.<string>=} opts.globals custom global variables to declare
* @param {Array.<string>=} opts.plugins custom eslint plugins
* @param {Array.<string>=} opts.envs custom eslint environment
* @param {Object=} opts.rules custom eslint rules
* @param {string=} opts.parser custom js parser (e.g. babel-eslint)
* @param {function(Error, Object)} cb callback
*/
Expand Down Expand Up @@ -129,7 +126,6 @@ Linter.prototype.parseOpts = function (opts) {
setGlobals(opts.globals || opts.global)
setPlugins(opts.plugins || opts.plugin)
setEnvs(opts.envs || opts.env)
setRules(opts.rules || opts.rule)
setParser(opts.parser)

var root
Expand All @@ -140,7 +136,6 @@ Linter.prototype.parseOpts = function (opts) {
if (packageOpts) {
setGlobals(packageOpts.globals || packageOpts.global)
setPlugins(packageOpts.plugins || packageOpts.plugin)
setRules(packageOpts.rules || packageOpts.rule)
setEnvs(packageOpts.envs || packageOpts.env)
if (!opts.parser) setParser(packageOpts.parser)
}
Expand All @@ -156,11 +151,6 @@ Linter.prototype.parseOpts = function (opts) {
opts.eslintConfig.plugins = self.eslintConfig.plugins.concat(plugins)
}

function setRules (rules) {
if (!rules) return
opts.eslintConfig.rules = extend(opts.eslintConfig.rules, rules)
}

function setEnvs (envs) {
if (!envs) return
if (!Array.isArray(envs) && typeof envs !== 'string') {
Expand Down

0 comments on commit 365eb9c

Please sign in to comment.