Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESLint Default Formatter Don't Work During Watch #128

Closed
chriserwin opened this issue Jul 27, 2017 · 1 comment
Closed

ESLint Default Formatter Don't Work During Watch #128

chriserwin opened this issue Jul 27, 2017 · 1 comment

Comments

@chriserwin
Copy link

Environment

  • Node Version: 6.11.1
  • Eslint-Watch Version: 3.1.2
  • Eslint Version: 4.3.0

Basic Description of the problem

When trying to use one of the default ESLint formatters while using the watch (-w) option, an error is returned even though the formatter appears to work.

image

How to reproduce it

  1. Command: esw -w -f table dir/**

Debug output:

esw:internal-settings Eslint installed locally node_modules/.bin/eslint +0ms
  esw:internal-settings { eslintPath: 'node_modules/.bin/eslint',
  esw:internal-settings   platform: 'darwin',
  esw:internal-settings   isWindows: false } +3ms
  esw:eslint-cli Loaded +77ms
  esw:eslint-help Loaded +107ms
  esw:options Loaded +0ms
  esw:eslint-help Executing help +1ms
  esw:eslint-cli eslint: '--help' +2ms
  esw:executor node_modules/.bin/eslint [ '--help' ] +2ms
  esw:eslint-cli { exitCode: 0,
  esw:eslint-cli   message: 'eslint [options] file.js [file.js] [dir]\n\nBasic configuration:\n  -c, --config path::String    Use configuration from this file or shareable config\n  --no-eslintrc                Disable use of configuration from .eslintrc\n  --env [String]               Specify environments\n  --ext [String]               Specify JavaScript file extensions - default: .js\n  --global [String]            Define global variables\n  --parser String              Specify the parser to be used\n  --parser-options Object      Specify parser options\n\nCaching:\n  --cache                      Only check changed files - default: false\n  --cache-file path::String    Path to the cache file. Deprecated: use --cache-location - default: .eslintcache\n  --cache-location path::String  Path to the cache file or directory\n\nSpecifying rules and plugins:\n  --rulesdir [path::String]    Use additional rules from this directory\n  --plugin [String]            Specify plugins\n  --rule Object                Specify rules\n\nIgnoring files:\n  --ignore-path path::String   Specify path of ignore file\n  --no-ignore                  Disable use of ignore files and patterns\n  --ignore-pattern [String]    Pattern of files to ignore (in addition to those in .eslintignore)\n\nUsing stdin:\n  --stdin                      Lint code provided on <STDIN> - default: false\n  --stdin-filename String      Specify filename to process STDIN as\n\nHandling warnings:\n  --quiet                      Report errors only - default: false\n  --max-warnings Int           Number of warnings to trigger nonzero exit code - default: -1\n\nOutput:\n  -o, --output-file path::String  Specify file to write report to\n  -f, --format String          Use a specific output format - default: stylish\n  --color, --no-color          Force enabling/disabling of color\n\nMiscellaneous:\n  --init                       Run config initialization wizard - default: false\n  --fix                        Automatically fix problems\n  --debug                      Output debugging information\n  -h, --help                   Show help\n  -v, --version                Output the version number\n  --no-inline-config           Prevent comments from changing config or rules\n  --print-config path::String  Print the configuration for the given file\n' } +2s
  esw:eslint-help Alias found: -c +2ms
  esw:eslint-help Parsing --config +1ms
  esw:eslint-help Parsing --no-eslintrc +0ms
  esw:eslint-help Parsing no option --no-eslintrc +0ms
  esw:eslint-help Parsing --env +0ms
  esw:eslint-help Parsing --ext +0ms
  esw:eslint-help Parsing --global +0ms
  esw:eslint-help Parsing --parser +0ms
  esw:eslint-help Parsing --parser-options +1ms
  esw:eslint-help Parsing --cache +0ms
  esw:eslint-help Parsing --cache-file +0ms
  esw:eslint-help Parsing --cache-location +0ms
  esw:eslint-help Parsing --rulesdir +0ms
  esw:eslint-help Parsing --plugin +0ms
  esw:eslint-help Parsing --rule +0ms
  esw:eslint-help Parsing --ignore-path +0ms
  esw:eslint-help Parsing --no-ignore +0ms
  esw:eslint-help Parsing no option --no-ignore +0ms
  esw:eslint-help Parsing --ignore-pattern +0ms
  esw:eslint-help Parsing --stdin +0ms
  esw:eslint-help Parsing --stdin-filename +0ms
  esw:eslint-help Parsing --quiet +0ms
  esw:eslint-help Parsing --max-warnings +1ms
  esw:eslint-help Alias found: -o +0ms
  esw:eslint-help Parsing --output-file +0ms
  esw:eslint-help Alias found: -f +0ms
  esw:eslint-help Parsing --format +0ms
  esw:eslint-help Parsing --init +1ms
  esw:eslint-help Parsing --fix +0ms
  esw:eslint-help Parsing --debug +0ms
  esw:eslint-help Alias found: -h +0ms
  esw:eslint-help Parsing --help +0ms
  esw:eslint-help Alias found: -v +0ms
  esw:eslint-help Parsing --version +0ms
  esw:eslint-help Parsing --no-inline-config +0ms
  esw:eslint-help Parsing no option --no-inline-config +0ms
  esw:eslint-help Parsing --print-config +1ms
  esw:watcher Loaded +1s
  esw:arg-parser Loaded +16ms
  esw:esw-cli Loaded +5ms
  esw:esw-cli Eslint-Watch: 3.1.2 +0ms
  esw:esw-cli Arguments passed: [ '/usr/local/bin/node', '/usr/local/bin/esw', '-w', '-f', 'table', 'app/config', 'app/endpoints', 'app/lib', 'app/server.js' ] +0ms
  esw:esw-cli Parsing args +2ms
  esw:arg-parser Directories to check: [ 'app/config', 'app/endpoints', 'app/lib', 'app/server.js' ] +0ms
  esw:arg-parser Args [ '-w', '-f', 'table', 'app/config', 'app/endpoints', 'app/lib', 'app/server.js' ] +1ms
  esw:arg-parser Pushing item: -f +0ms
  esw:arg-parser Pushing item: table +0ms
  esw:arg-parser Pushing item: app/config +0ms
  esw:arg-parser Pushing item: app/endpoints +0ms
  esw:arg-parser Pushing item: app/lib +0ms
  esw:arg-parser Pushing item: app/server.js +0ms
  esw:esw-cli Running initial lint +0ms
  esw:esw-cli [ '-f',
  esw:esw-cli   'table',
  esw:esw-cli   'app/config',
  esw:esw-cli   'app/endpoints',
  esw:esw-cli   'app/lib',
  esw:esw-cli   'app/server.js' ] +1ms
  esw:eslint-cli eslint: '-f table app/config app/endpoints app/lib app/server.js' +0ms
  esw:executor node_modules/.bin/eslint [ '-f',
  'table',
  'app/config',
  'app/endpoints',
  'app/lib',
  'app/server.js' ] +0ms

[REDACTED]router.js

║ Line     │ Column   │ Type     │ Message                                                │ Rule ID              ║
╟──────────┼──────────┼──────────┼────────────────────────────────────────────────────────┼──────────────────────╢
║ 1        │ 7        │ error    │ 'router' is assigned a value but never used.           │ no-unused-vars       ║
║ 1        │ 35       │ error    │ A function with a name starting with an uppercase      │ new-cap              ║
║          │          │          │ letter should only be used as a constructor.           │                      ║
║ 3        │ 1        │ error    │ Expected { after 'if' condition.                       │ curly                ║
║ 3        │ 5        │ error    │ 'farts' is not defined.                                │ no-undef             ║
║ 4        │ 2        │ warning  │ Unexpected console statement.                          │ no-console           ║
║ 4        │ 21       │ error    │ Missing semicolon.                                     │ semi                 ║

╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
║ 5 Errors                                                                                                       ║
╟────────────────────────────────────────────────────────────────────────────────────────────────────────────────╢
║ 1 Warning                                                                                                      ║
╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝

  esw:eslint-cli { exitCode: 1, message: '' } +2s
  esw:esw-cli lint completed. Exit Code: 1 +0ms

  esw:esw-cli -w seen +0ms
  esw:watcher { useEslintrc: true, ignore: true, format: 'table' } +3ms
  esw:watcher { watch: true,
  esw:watcher   format: 'table',
  esw:watcher   eslintrc: true,
  esw:watcher   ignore: true,
  esw:watcher   inlineConfig: true,
  esw:watcher   _: [ 'app/config', 'app/endpoints', 'app/lib', 'app/server.js' ] } +0ms
  esw:watcher Trying to load formatter for re-lint from ./formatters/table +2ms
Error: There was a problem loading formatter: ./formatters/table
Error: Cannot find module './formatters/table'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at watcher (/usr/local/lib/node_modules/eslint-watch/src/watcher.js:75:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/eslint-watch/src/index.js:69:7)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
@rizowski
Copy link
Owner

@chriserwin Has this been solved with the latest release? I wrote some integration tests to ensure that the CLI can find eslint's table formatter.

rizowski added a commit that referenced this issue Dec 21, 2017
@rizowski rizowski mentioned this issue Dec 21, 2017
rizowski added a commit that referenced this issue Dec 21, 2017
rizowski added a commit that referenced this issue Jan 1, 2018
rizowski added a commit that referenced this issue Jan 5, 2018
stiang pushed a commit to stiang/eslint-watch that referenced this issue Jan 19, 2018
rizowski added a commit that referenced this issue Jan 31, 2018
rizowski added a commit that referenced this issue Feb 16, 2018
rizowski added a commit that referenced this issue Mar 28, 2018
rizowski added a commit that referenced this issue Mar 28, 2018
rizowski added a commit that referenced this issue Mar 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants