rizowski / eslint-watch

ESLint with simple watching capabilities
https://www.npmjs.com/package/eslint-watch
MIT License
196 stars 29 forks source link

Fix rules option error #151

Closed HsuTing closed 5 years ago

HsuTing commented 5 years ago

What was the problem/Ticket Number

  1. I got this errors with using esw --rule 'prettier/prettier: off':
  esw:eslint Executing [ '--cache', '--rule', { 'prettier/prettier': 'off' }, '--quiet', '--eslintrc', '--ignore', '--inline-config', '.' ] +0ms
  esw:eslint Error: Command failed: eslint --cache --rule [object Object] --quiet --eslintrc --ignore --inline-config .
  esw:eslint 2019-03-26T08:11:05.924Z eslint:cli CLI args: [ '--cache', '--rule', '[object Object]', '--quiet', '--eslintrc', '--ignore', '--inline-config', '.' ]
  esw:eslint Invalid value for option 'rule' - expected type Object, received value: [object Object].
  1. The other problem is that .eslintcache will trigger chokidar changed event.

How does this solve the problem?

  1. Make rules options to be string.
  2. Ignore cacheLocation.

How to duplicate the issue

  1. Use esw --rule 'prettier/prettier: off'.
coveralls commented 5 years ago

Coverage Status

Coverage decreased (-1.5%) to 88.959% when pulling cb3cfaceb1260a40235068cf5407fd1daedf5106 on HsuTing:fix-rule-error into abfcc95f333c3fc0e22f5703fd4d53706aa494d6 on rizowski:master.

coveralls commented 5 years ago

Coverage Status

Coverage decreased (-0.2%) to 90.221% when pulling 09ccf5821546a7b9ff72df700bc4cd048fd98b71 on HsuTing:fix-rule-error into abfcc95f333c3fc0e22f5703fd4d53706aa494d6 on rizowski:master.

HsuTing commented 5 years ago

Thank you 👍

rizowski commented 5 years ago

You bet. Thanks for contributing