@@ -73,8 +73,7 @@ const parseClangRanges = (ranges) => {
7373 */
7474const findTextEditor = ( filePath ) => {
7575 const allEditors = atom . workspace . getTextEditors ( ) ;
76- const matchingEditor = allEditors . find (
77- textEditor => textEditor . getPath ( ) === filePath ) ;
76+ const matchingEditor = allEditors . find ( textEditor => textEditor . getPath ( ) === filePath ) ;
7877 return matchingEditor || false ;
7978} ;
8079
@@ -97,38 +96,24 @@ export default {
9796 atom . config . observe ( 'linter-clang.executablePath' , ( value ) => {
9897 this . executablePath = value ;
9998 } ) ,
100- ) ;
101- this . subscriptions . add (
10299 atom . config . observe ( 'linter-clang.clangIncludePaths' , ( value ) => {
103100 this . clangIncludePaths = value ;
104101 } ) ,
105- ) ;
106- this . subscriptions . add (
107102 atom . config . observe ( 'linter-clang.clangSuppressWarnings' , ( value ) => {
108103 this . clangSuppressWarnings = value ;
109104 } ) ,
110- ) ;
111- this . subscriptions . add (
112105 atom . config . observe ( 'linter-clang.clangDefaultCFlags' , ( value ) => {
113106 this . clangDefaultCFlags = value ;
114107 } ) ,
115- ) ;
116- this . subscriptions . add (
117108 atom . config . observe ( 'linter-clang.clangDefaultCppFlags' , ( value ) => {
118109 this . clangDefaultCppFlags = value ;
119110 } ) ,
120- ) ;
121- this . subscriptions . add (
122111 atom . config . observe ( 'linter-clang.clangDefaultObjCFlags' , ( value ) => {
123112 this . clangDefaultObjCFlags = value ;
124113 } ) ,
125- ) ;
126- this . subscriptions . add (
127114 atom . config . observe ( 'linter-clang.clangDefaultObjCppFlags' , ( value ) => {
128115 this . clangDefaultObjCppFlags = value ;
129116 } ) ,
130- ) ;
131- this . subscriptions . add (
132117 atom . config . observe ( 'linter-clang.clangErrorLimit' , ( value ) => {
133118 this . clangErrorLimit = value ;
134119 } ) ,
@@ -210,9 +195,7 @@ export default {
210195 args . push ( '--verbose' ) ;
211196 }
212197
213- this . clangIncludePaths . forEach ( path =>
214- args . push ( `-I${ path } ` ) ,
215- ) ;
198+ this . clangIncludePaths . forEach ( path => args . push ( `-I${ path } ` ) ) ;
216199
217200 let usingClangComplete = false ;
218201 try {
@@ -222,7 +205,7 @@ export default {
222205 usingClangComplete = true ;
223206 const workingDir = / - w o r k i n g - d i r e c t o r y = ( .+ ) / . exec ( flag ) ;
224207 if ( workingDir !== null ) {
225- basePath = workingDir [ 1 ] ;
208+ [ , basePath ] = workingDir ;
226209 }
227210 } ) ;
228211 } catch ( error ) {
@@ -269,7 +252,7 @@ export default {
269252 if ( isCurrentFile ) {
270253 file = filePath ;
271254 } else if ( isAbsolute ( match [ 1 ] ) ) {
272- file = match [ 1 ] ;
255+ [ , file ] = match ;
273256 } else {
274257 file = resolve ( basePath , match [ 1 ] ) ;
275258 }
@@ -300,6 +283,7 @@ export default {
300283 // There is a -Wflag specified, for now just re-insert that into the excerpt
301284 excerpt = `${ match [ 6 ] } [${ match [ 7 ] } ]` ;
302285 } else {
286+ // eslint-disable-next-line prefer-destructuring
303287 excerpt = match [ 6 ] ;
304288 }
305289 const message = {
0 commit comments