xo icon indicating copy to clipboard operation
xo copied to clipboard

Bug: xo ignores package.json config when run from a project subfolder

Open teehemkay opened this issue 5 years ago • 0 comments

When xo is run from a project subfolder, it ignores the config in package.json.

This is regression introduced between 0.26.1 and 0.27.0 (likely in #416)

How to reproduce (see my SSCCE here):

  • setup xo with a config minimally different from the default one (e.g. use spaces instead of tab)
  • create a foo/bar.js file that uses spaces instead of tabs
  • from the top-level project folder (the one that contains package.json) run:
$ xo foo/bar.js
  • observer that there are no error or warning
  • now run the following commands:
$ cd foo
$ xo bar.js
  • observe the following error message:
bar.js:2:1
  ✖  2:1  Expected indentation of 1 tab but found 2 spaces.  indent

teehemkay avatar May 11 '20 13:05 teehemkay