File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,8 @@ module.exports.lintFiles = (patterns, options) => {
9898 cwd : options . cwd
9999 }
100100 ) . then ( paths => {
101+ paths = paths . map ( x => path . relative ( options . cwd , path . resolve ( options . cwd , x ) ) ) ;
102+
101103 // Filter out unwanted file extensions
102104 // For silly users that don't specify an extension in the glob pattern
103105 if ( ! isEmptyPatterns ) {
Original file line number Diff line number Diff line change @@ -45,6 +45,24 @@ test('overrides fixture', async t => {
4545 await t . notThrowsAsync ( main ( [ ] , { cwd} ) ) ;
4646} ) ;
4747
48+ test ( 'overrides work with relative path' , async t => {
49+ const cwd = path . join ( __dirname , 'fixtures/overrides' ) ;
50+ const file = path . join ( 'test' , 'bar.js' ) ;
51+ await t . notThrowsAsync ( main ( [ file ] , { cwd} ) ) ;
52+ } ) ;
53+
54+ test ( 'overrides work with relative path starting with `./`' , async t => {
55+ const cwd = path . join ( __dirname , 'fixtures/overrides' ) ;
56+ const file = '.' + path . sep + path . join ( 'test' , 'bar.js' ) ;
57+ await t . notThrowsAsync ( main ( [ file ] , { cwd} ) ) ;
58+ } ) ;
59+
60+ test ( 'overrides work with absolute path' , async t => {
61+ const cwd = path . join ( __dirname , 'fixtures/overrides' ) ;
62+ const file = path . join ( cwd , 'test' , 'bar.js' ) ;
63+ await t . notThrowsAsync ( main ( [ file ] , { cwd} ) ) ;
64+ } ) ;
65+
4866// #65
4967test . failing ( 'ignores fixture' , async t => {
5068 const cwd = path . join ( __dirname , 'fixtures/ignores' ) ;
You can’t perform that action at this time.
0 commit comments