This repository was archived by the owner on Aug 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -168,6 +168,10 @@ export function refreshModulesPath(modulesDir) {
168168}
169169
170170function getProjectDir ( filePath ) {
171+ if ( ! filePath ) {
172+ // No file (e.g. in the specs)
173+ return null ;
174+ }
171175 const projectDir = atom . project . relativizePath ( filePath ) [ 0 ] ;
172176 return projectDir !== null ? projectDir : path . dirname ( filePath ) ;
173177}
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import hasValidScope from './validate';
77// Dependencies
88let helpers ;
99let dirname ;
10- let stylelint ;
1110
1211function loadDeps ( ) {
1312 if ( ! helpers ) {
@@ -16,9 +15,6 @@ function loadDeps() {
1615 if ( ! dirname ) {
1716 ( { dirname } = require ( 'path' ) ) ;
1817 }
19- if ( ! stylelint ) {
20- stylelint = require ( 'stylelint' ) ;
21- }
2218}
2319
2420export default {
@@ -156,6 +152,8 @@ export default {
156152 }
157153
158154 helpers . startMeasure ( 'linter-stylelint: Create Linter' ) ;
155+ // Use the project local stylelint to resolve the config if one exists
156+ const stylelint = await helpers . getStylelintInstance ( ) ;
159157 const stylelintLinter = await stylelint . createLinter ( ) ;
160158 helpers . endMeasure ( 'linter-stylelint: Create Linter' ) ;
161159
You can’t perform that action at this time.
0 commit comments