open-wc / custom-elements-manifest-deprecated

Custom Elements Manifest is a file format that describes custom elements in your project.
8 stars 4 forks source link

analyzer: Globs in configuration file do not override CLI defaults #61

Closed jsantell closed 3 years ago

jsantell commented 3 years ago

There are different results between using CLI globbing custom-elements-manifest analyze --globs="src/*.js" and via config file { globs: ["src/*.js"] }.

The values passed into globby differ here, such that when using the CLI, the glob paths are what is defined, plus some node_modules etc. filtering.

 [
  'src/*.js',
  '!node_modules/**/*.*',
  '!bower_components/**/*.*',
  '!**/*.test.{js,ts}',
  '!**/*.suite.{js,ts}',
  '!**/*.config.{js,ts}'
]

The same defined in a configuration file results in the same set of globs, plus the CLI's default value for globbing:

 [
  '**/*.{js,ts}', // <- these are CLI defaults
  '!**/.*.{js,ts}', // <- these are CLI defaults
  'src/*.js',
  '!node_modules/**/*.*',
  '!bower_components/**/*.*',
  '!**/*.test.{js,ts}',
  '!**/*.suite.{js,ts}',
  '!**/*.config.{js,ts}'
]

If globs are specified, I'd expect the same result regardless if they were via CLI or configuration file, and only use the default glob paths if neither specified.

thepassle commented 3 years ago

This should be fixed in the new version of the analyzer, please let me know if the problem still persists