@@ -11,6 +11,7 @@ import chalk from 'chalk';
1111import logSymbols from 'log-symbols' ;
1212
1313const ignoreFileName = '.addonslinterignore' ;
14+ const noFileToken = '<no_file>' ;
1415
1516/**
1617 * Lints a Firefox addon.
@@ -47,8 +48,7 @@ async function lintFirefoxAddon(options) {
4748 result . count = 0 ;
4849 for ( let list of lists ) {
4950 result [ list ] = result [ list ] . filter ( ( message ) => {
50- const file = message . file ? resolvePath ( message . file ) : '<no file>' ;
51-
51+ const file = message . file ? resolvePath ( message . file ) : noFileToken ;
5252 const ignoreEntry = ignoreList . find (
5353 ( ignore ) => ignore . file === file && ignore . code === message . code
5454 ) ;
@@ -100,17 +100,18 @@ function getIgnoreList() {
100100 // <file> <code>
101101 let [ file , code ] = line . split ( ' ' ) ;
102102
103+ if ( file !== noFileToken ) {
104+ file = resolvePath ( file ) ;
105+ }
106+
103107 // Some codes sentences instead of short, uppercase names. In
104108 // this case the code should start with "_" in the ignore file
105109 // and all spaces should be replaced by "_".
106110 if ( code . startsWith ( '_' ) ) {
107111 code = code . substr ( 1 ) . replace ( / _ / g, ' ' ) ;
108112 }
109113
110- ignore . push ( {
111- file : resolvePath ( file ) ,
112- code,
113- } ) ;
114+ ignore . push ( { file, code } ) ;
114115 } ) ;
115116
116117 lineReader . on ( 'close' , ( ) => {
0 commit comments